@@ -35,12 +35,12 @@ discard block |
||
35 | 35 | * @param string[] $attributes List of attribute codes as keys and strings entered by the customer as value |
36 | 36 | * @return string[] List of attributes codes as keys and error messages as values for invalid or missing values |
37 | 37 | */ |
38 | - public function checkAttributes( $serviceId, array $attributes ) |
|
38 | + public function checkAttributes($serviceId, array $attributes) |
|
39 | 39 | { |
40 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
41 | - $provider = $manager->getProvider( $manager->getItem( $serviceId, [], true ) ); |
|
40 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
41 | + $provider = $manager->getProvider($manager->getItem($serviceId, [], true)); |
|
42 | 42 | |
43 | - return array_filter( $provider->checkConfigFE( $attributes ) ); |
|
43 | + return array_filter($provider->checkConfigFE($attributes)); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | * @param string[] $ref List of domain names whose items should be fetched too |
52 | 52 | * @return \Aimeos\MShop\Service\Provider\Iface Service provider object |
53 | 53 | */ |
54 | - public function getProvider( $serviceId, $ref = ['media', 'price', 'text'] ) |
|
54 | + public function getProvider($serviceId, $ref = ['media', 'price', 'text']) |
|
55 | 55 | { |
56 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
57 | - return $manager->getProvider( $manager->getItem( $serviceId, $ref, true ) ); |
|
56 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
57 | + return $manager->getProvider($manager->getItem($serviceId, $ref, true)); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | |
@@ -65,26 +65,26 @@ discard block |
||
65 | 65 | * @param string[] $ref List of domain names whose items should be fetched too |
66 | 66 | * @return \Aimeos\MShop\Service\Provider\Iface[] List of service IDs as keys and service provider objects as values |
67 | 67 | */ |
68 | - public function getProviders( $type = null, $ref = ['media', 'price', 'text'] ) |
|
68 | + public function getProviders($type = null, $ref = ['media', 'price', 'text']) |
|
69 | 69 | { |
70 | 70 | $list = []; |
71 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
71 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
72 | 72 | |
73 | - $search = $manager->createSearch( true ); |
|
74 | - $search->setSortations( array( $search->sort( '+', 'service.position' ) ) ); |
|
73 | + $search = $manager->createSearch(true); |
|
74 | + $search->setSortations(array($search->sort('+', 'service.position'))); |
|
75 | 75 | |
76 | - if( $type != null ) |
|
76 | + if ($type != null) |
|
77 | 77 | { |
78 | 78 | $expr = array( |
79 | 79 | $search->getConditions(), |
80 | - $search->compare( '==', 'service.type.code', $type ), |
|
81 | - $search->compare( '==', 'service.type.domain', 'service' ), |
|
80 | + $search->compare('==', 'service.type.code', $type), |
|
81 | + $search->compare('==', 'service.type.domain', 'service'), |
|
82 | 82 | ); |
83 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
83 | + $search->setConditions($search->combine('&&', $expr)); |
|
84 | 84 | } |
85 | 85 | |
86 | - foreach( $manager->searchItems( $search, $ref ) as $id => $item ) { |
|
87 | - $list[$id] = $manager->getProvider( $item ); |
|
86 | + foreach ($manager->searchItems($search, $ref) as $id => $item) { |
|
87 | + $list[$id] = $manager->getProvider($item); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | return $list; |
@@ -102,14 +102,14 @@ discard block |
||
102 | 102 | * @return \Aimeos\MShop\Common\Item\Helper\Form\Iface|null Form object with URL, parameters, etc. |
103 | 103 | * or null if no form data is required |
104 | 104 | */ |
105 | - public function process( \Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params ) |
|
105 | + public function process(\Aimeos\MShop\Order\Item\Iface $orderItem, $serviceId, array $urls, array $params) |
|
106 | 106 | { |
107 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
107 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
108 | 108 | |
109 | - $provider = $manager->getProvider( $manager->getItem( $serviceId, [], true ) ); |
|
110 | - $provider->injectGlobalConfigBE( $urls ); |
|
109 | + $provider = $manager->getProvider($manager->getItem($serviceId, [], true)); |
|
110 | + $provider->injectGlobalConfigBE($urls); |
|
111 | 111 | |
112 | - return $provider->process( $orderItem, $params ); |
|
112 | + return $provider->process($orderItem, $params); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
@@ -122,35 +122,35 @@ discard block |
||
122 | 122 | * (keys are <type>.url-self, <type>.url-success, <type>.url-update where type can be "delivery" or "payment") |
123 | 123 | * @return \Aimeos\MShop\Order\Item\Iface $orderItem Order item that has been updated |
124 | 124 | */ |
125 | - public function updateSync( ServerRequestInterface $request, ResponseInterface &$response, array $urls ) |
|
125 | + public function updateSync(ServerRequestInterface $request, ResponseInterface & $response, array $urls) |
|
126 | 126 | { |
127 | 127 | $queryParams = $request->getQueryParams(); |
128 | 128 | |
129 | - if( !isset( $queryParams['code'] ) ) { |
|
129 | + if (!isset($queryParams['code'])) { |
|
130 | 130 | return; |
131 | 131 | } |
132 | 132 | |
133 | 133 | $context = $this->getContext(); |
134 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'service' ); |
|
134 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'service'); |
|
135 | 135 | |
136 | - $provider = $manager->getProvider( $manager->findItem( $queryParams['code'] ) ); |
|
137 | - $provider->injectGlobalConfigBE( $urls ); |
|
136 | + $provider = $manager->getProvider($manager->findItem($queryParams['code'])); |
|
137 | + $provider->injectGlobalConfigBE($urls); |
|
138 | 138 | |
139 | - $params = array_merge( $queryParams, (array) $request->getParsedBody() ); |
|
139 | + $params = array_merge($queryParams, (array) $request->getParsedBody()); |
|
140 | 140 | $body = (string) $request->getBody(); |
141 | 141 | $response = null; |
142 | 142 | $headers = []; |
143 | 143 | |
144 | - if( ( $orderItem = $provider->updateSync( $params, $body, $response, $headers ) ) !== null ) |
|
144 | + if (($orderItem = $provider->updateSync($params, $body, $response, $headers)) !== null) |
|
145 | 145 | { |
146 | - if( $orderItem->getPaymentStatus() === \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED |
|
147 | - && $provider->isImplemented( \Aimeos\MShop\Service\Provider\Payment\Base::FEAT_QUERY ) |
|
146 | + if ($orderItem->getPaymentStatus() === \Aimeos\MShop\Order\Item\Base::PAY_UNFINISHED |
|
147 | + && $provider->isImplemented(\Aimeos\MShop\Service\Provider\Payment\Base::FEAT_QUERY) |
|
148 | 148 | ) { |
149 | - $provider->query( $orderItem ); |
|
149 | + $provider->query($orderItem); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | // update stock, coupons, etc. |
153 | - \Aimeos\Controller\Frontend\Factory::createController( $context, 'order' )->update( $orderItem ); |
|
153 | + \Aimeos\Controller\Frontend\Factory::createController($context, 'order')->update($orderItem); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | return $orderItem; |
@@ -167,38 +167,38 @@ discard block |
||
167 | 167 | * @throws \Exception If an error occurs |
168 | 168 | * @deprecated Use getProviders() instead |
169 | 169 | */ |
170 | - public function getServices( $type, \Aimeos\MShop\Order\Item\Base\Iface $basket, $ref = ['media', 'price', 'text'] ) |
|
170 | + public function getServices($type, \Aimeos\MShop\Order\Item\Base\Iface $basket, $ref = ['media', 'price', 'text']) |
|
171 | 171 | { |
172 | - $serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
172 | + $serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
173 | 173 | |
174 | - $search = $serviceManager->createSearch( true ); |
|
174 | + $search = $serviceManager->createSearch(true); |
|
175 | 175 | $expr = array( |
176 | 176 | $search->getConditions(), |
177 | - $search->compare( '==', 'service.type.domain', 'service' ), |
|
178 | - $search->compare( '==', 'service.type.code', $type ), |
|
177 | + $search->compare('==', 'service.type.domain', 'service'), |
|
178 | + $search->compare('==', 'service.type.code', $type), |
|
179 | 179 | ); |
180 | - $search->setConditions( $search->combine( '&&', $expr ) ); |
|
181 | - $search->setSortations( array( $search->sort( '+', 'service.position' ) ) ); |
|
180 | + $search->setConditions($search->combine('&&', $expr)); |
|
181 | + $search->setSortations(array($search->sort('+', 'service.position'))); |
|
182 | 182 | |
183 | - $items = $serviceManager->searchItems( $search, $ref ); |
|
183 | + $items = $serviceManager->searchItems($search, $ref); |
|
184 | 184 | |
185 | 185 | |
186 | - foreach( $items as $id => $service ) |
|
186 | + foreach ($items as $id => $service) |
|
187 | 187 | { |
188 | 188 | try |
189 | 189 | { |
190 | - $provider = $serviceManager->getProvider( $service ); |
|
190 | + $provider = $serviceManager->getProvider($service); |
|
191 | 191 | |
192 | - if( $provider->isAvailable( $basket ) ) { |
|
192 | + if ($provider->isAvailable($basket)) { |
|
193 | 193 | $this->providers[$type][$id] = $provider; |
194 | 194 | } else { |
195 | - unset( $items[$id] ); |
|
195 | + unset($items[$id]); |
|
196 | 196 | } |
197 | 197 | } |
198 | - catch( \Aimeos\MShop\Service\Exception $e ) |
|
198 | + catch (\Aimeos\MShop\Service\Exception $e) |
|
199 | 199 | { |
200 | - $msg = sprintf( 'Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id ); |
|
201 | - $this->getContext()->getLogger()->log( $msg, \Aimeos\MW\Logger\Base::WARN ); |
|
200 | + $msg = sprintf('Unable to create provider "%1$s" for service with ID "%2$s"', $service->getCode(), $id); |
|
201 | + $this->getContext()->getLogger()->log($msg, \Aimeos\MW\Logger\Base::WARN); |
|
202 | 202 | } |
203 | 203 | } |
204 | 204 | |
@@ -219,16 +219,16 @@ discard block |
||
219 | 219 | * @throws \Exception If an error occurs |
220 | 220 | * @deprecated Use getProvider() instead |
221 | 221 | */ |
222 | - public function getServiceAttributes( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
222 | + public function getServiceAttributes($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
223 | 223 | { |
224 | - if( isset( $this->providers[$type][$serviceId] ) ) { |
|
225 | - return $this->providers[$type][$serviceId]->getConfigFE( $basket ); |
|
224 | + if (isset($this->providers[$type][$serviceId])) { |
|
225 | + return $this->providers[$type][$serviceId]->getConfigFE($basket); |
|
226 | 226 | } |
227 | 227 | |
228 | - $serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
229 | - $item = $serviceManager->getItem( $serviceId, ['price'], true ); |
|
228 | + $serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
229 | + $item = $serviceManager->getItem($serviceId, ['price'], true); |
|
230 | 230 | |
231 | - return $serviceManager->getProvider( $item )->getConfigFE( $basket ); |
|
231 | + return $serviceManager->getProvider($item)->getConfigFE($basket); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | |
@@ -244,16 +244,16 @@ discard block |
||
244 | 244 | * @throws \Exception If an error occurs |
245 | 245 | * @deprecated Use getProvider() instead |
246 | 246 | */ |
247 | - public function getServicePrice( $type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
247 | + public function getServicePrice($type, $serviceId, \Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
248 | 248 | { |
249 | - if( isset( $this->providers[$type][$serviceId] ) ) { |
|
250 | - return $this->providers[$type][$serviceId]->calcPrice( $basket ); |
|
249 | + if (isset($this->providers[$type][$serviceId])) { |
|
250 | + return $this->providers[$type][$serviceId]->calcPrice($basket); |
|
251 | 251 | } |
252 | 252 | |
253 | - $serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
254 | - $item = $serviceManager->getItem( $serviceId, ['price'], true ); |
|
253 | + $serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
254 | + $item = $serviceManager->getItem($serviceId, ['price'], true); |
|
255 | 255 | |
256 | - return $serviceManager->getProvider( $item )->calcPrice( $basket ); |
|
256 | + return $serviceManager->getProvider($item)->calcPrice($basket); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | |
@@ -269,22 +269,22 @@ discard block |
||
269 | 269 | * @throws \Aimeos\Controller\Frontend\Service\Exception If no active service provider for this ID is available |
270 | 270 | * @deprecated Use checkAttributes() instead |
271 | 271 | */ |
272 | - public function checkServiceAttributes( $type, $serviceId, array $attributes ) |
|
272 | + public function checkServiceAttributes($type, $serviceId, array $attributes) |
|
273 | 273 | { |
274 | - if( !isset( $this->providers[$type][$serviceId] ) ) |
|
274 | + if (!isset($this->providers[$type][$serviceId])) |
|
275 | 275 | { |
276 | - $serviceManager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'service' ); |
|
277 | - $item = $serviceManager->getItem( $serviceId, ['price'], true ); |
|
276 | + $serviceManager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'service'); |
|
277 | + $item = $serviceManager->getItem($serviceId, ['price'], true); |
|
278 | 278 | |
279 | - $this->providers[$type][$serviceId] = $serviceManager->getProvider( $item ); |
|
279 | + $this->providers[$type][$serviceId] = $serviceManager->getProvider($item); |
|
280 | 280 | } |
281 | 281 | |
282 | - $errors = $this->providers[$type][$serviceId]->checkConfigFE( $attributes ); |
|
282 | + $errors = $this->providers[$type][$serviceId]->checkConfigFE($attributes); |
|
283 | 283 | |
284 | - foreach( $errors as $key => $msg ) |
|
284 | + foreach ($errors as $key => $msg) |
|
285 | 285 | { |
286 | - if( $msg === null ) { |
|
287 | - unset( $errors[$key] ); |
|
286 | + if ($msg === null) { |
|
287 | + unset($errors[$key]); |
|
288 | 288 | } |
289 | 289 | } |
290 | 290 |
@@ -30,18 +30,18 @@ discard block |
||
30 | 30 | * @param \Aimeos\Controller\Frontend\Iface $controller Controller object |
31 | 31 | * @param \Aimeos\MShop\Context\Item\Iface $context Context object with required objects |
32 | 32 | */ |
33 | - public function __construct( \Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context ) |
|
33 | + public function __construct(\Aimeos\Controller\Frontend\Iface $controller, \Aimeos\MShop\Context\Item\Iface $context) |
|
34 | 34 | { |
35 | 35 | $iface = '\Aimeos\Controller\Frontend\Order\Iface'; |
36 | - if( !( $controller instanceof $iface ) ) |
|
36 | + if (!($controller instanceof $iface)) |
|
37 | 37 | { |
38 | - $msg = sprintf( 'Class "%1$s" does not implement interface "%2$s"', get_class( $controller ), $iface ); |
|
39 | - throw new \Aimeos\Controller\Frontend\Exception( $msg ); |
|
38 | + $msg = sprintf('Class "%1$s" does not implement interface "%2$s"', get_class($controller), $iface); |
|
39 | + throw new \Aimeos\Controller\Frontend\Exception($msg); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | $this->controller = $controller; |
43 | 43 | |
44 | - parent::__construct( $context ); |
|
44 | + parent::__construct($context); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | * @return mixed Returns the value of the called method |
54 | 54 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
55 | 55 | */ |
56 | - public function __call( $name, array $param ) |
|
56 | + public function __call($name, array $param) |
|
57 | 57 | { |
58 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
58 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | * @param string $type Arbitrary order type (max. eight chars) |
67 | 67 | * @return \Aimeos\MShop\Order\Item\Iface Created order object |
68 | 68 | */ |
69 | - public function addItem( $baseId, $type ) |
|
69 | + public function addItem($baseId, $type) |
|
70 | 70 | { |
71 | - return $this->controller->addItem( $baseId, $type ); |
|
71 | + return $this->controller->addItem($baseId, $type); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | * @param string $id Unique order ID |
90 | 90 | * @return \Aimeos\MShop\Order\Item\Iface Order object |
91 | 91 | */ |
92 | - public function getItem( $id ) |
|
92 | + public function getItem($id) |
|
93 | 93 | { |
94 | - return $this->controller->getItem( $id ); |
|
94 | + return $this->controller->getItem($id); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | * @param integer &$total|null Variable that will contain the total number of available items |
103 | 103 | * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values |
104 | 104 | */ |
105 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null ) |
|
105 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null) |
|
106 | 106 | { |
107 | - return $this->controller->searchItems( $filter, $total ); |
|
107 | + return $this->controller->searchItems($filter, $total); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
128 | 128 | * @return void |
129 | 129 | */ |
130 | - public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
130 | + public function block(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
131 | 131 | { |
132 | - $this->getController()->block( $orderItem ); |
|
132 | + $this->getController()->block($orderItem); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | |
@@ -152,9 +152,9 @@ discard block |
||
152 | 152 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
153 | 153 | * @return void |
154 | 154 | */ |
155 | - public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
155 | + public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
156 | 156 | { |
157 | - $this->getController()->unblock( $orderItem ); |
|
157 | + $this->getController()->unblock($orderItem); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
174 | 174 | * @return void |
175 | 175 | */ |
176 | - public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
176 | + public function update(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
177 | 177 | { |
178 | - $this->getController()->update( $orderItem ); |
|
178 | + $this->getController()->update($orderItem); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | |
@@ -190,9 +190,9 @@ discard block |
||
190 | 190 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
191 | 191 | * @deprecated 2017.04 Use store() from basket controller instead |
192 | 192 | */ |
193 | - public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
193 | + public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
194 | 194 | { |
195 | - return $this->getController()->store( $basket ); |
|
195 | + return $this->getController()->store($basket); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 |
@@ -29,12 +29,12 @@ discard block |
||
29 | 29 | * @param string $type Arbitrary order type (max. eight chars) |
30 | 30 | * @return \Aimeos\MShop\Order\Item\Iface Created order object |
31 | 31 | */ |
32 | - public function addItem( $baseId, $type ) |
|
32 | + public function addItem($baseId, $type) |
|
33 | 33 | { |
34 | - $manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' ); |
|
34 | + $manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'order'); |
|
35 | 35 | |
36 | - $item = $manager->createItem()->setBaseId( $baseId )->setType( $type ); |
|
37 | - $manager->saveItem( $item ); |
|
36 | + $item = $manager->createItem()->setBaseId($baseId)->setType($type); |
|
37 | + $manager->saveItem($item); |
|
38 | 38 | |
39 | 39 | return $item; |
40 | 40 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | public function createFilter() |
49 | 49 | { |
50 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' )->createSearch(); |
|
50 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'order')->createSearch(); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | * @param string $id Unique order ID |
58 | 58 | * @return \Aimeos\MShop\Order\Item\Iface Order object |
59 | 59 | */ |
60 | - public function getItem( $id ) |
|
60 | + public function getItem($id) |
|
61 | 61 | { |
62 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' )->getItem( $id ); |
|
62 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'order')->getItem($id); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | * @param integer|null &$total Variable that will contain the total number of available items |
71 | 71 | * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values |
72 | 72 | */ |
73 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null ) |
|
73 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null) |
|
74 | 74 | { |
75 | - return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' )->searchItems( $filter, [], $total ); |
|
75 | + return \Aimeos\MShop\Factory::createManager($this->getContext(), 'order')->searchItems($filter, [], $total); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
96 | 96 | */ |
97 | - public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
97 | + public function block(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
98 | 98 | { |
99 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->block( $orderItem ); |
|
99 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->block($orderItem); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | * |
119 | 119 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
120 | 120 | */ |
121 | - public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
121 | + public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
122 | 122 | { |
123 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->unblock( $orderItem ); |
|
123 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->unblock($orderItem); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | * |
139 | 139 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
140 | 140 | */ |
141 | - public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ) |
|
141 | + public function update(\Aimeos\MShop\Order\Item\Iface $orderItem) |
|
142 | 142 | { |
143 | - \Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->update( $orderItem ); |
|
143 | + \Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->update($orderItem); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | |
@@ -155,22 +155,22 @@ discard block |
||
155 | 155 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
156 | 156 | * @deprecated 2017.04 Use store() from basket controller instead |
157 | 157 | */ |
158 | - public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ) |
|
158 | + public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket) |
|
159 | 159 | { |
160 | 160 | $context = $this->getContext(); |
161 | 161 | |
162 | - $orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
163 | - $orderBaseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' ); |
|
162 | + $orderManager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
163 | + $orderBaseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base'); |
|
164 | 164 | |
165 | 165 | |
166 | 166 | $orderBaseManager->begin(); |
167 | - $orderBaseManager->store( $basket ); |
|
167 | + $orderBaseManager->store($basket); |
|
168 | 168 | $orderBaseManager->commit(); |
169 | 169 | |
170 | 170 | $orderItem = $orderManager->createItem(); |
171 | - $orderItem->setBaseId( $basket->getId() ); |
|
172 | - $orderItem->setType( \Aimeos\MShop\Order\Item\Base::TYPE_WEB ); |
|
173 | - $orderManager->saveItem( $orderItem ); |
|
171 | + $orderItem->setBaseId($basket->getId()); |
|
172 | + $orderItem->setType(\Aimeos\MShop\Order\Item\Base::TYPE_WEB); |
|
173 | + $orderManager->saveItem($orderItem); |
|
174 | 174 | |
175 | 175 | |
176 | 176 | return $orderItem; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | * @param string $type Arbitrary order type (max. eight chars) |
28 | 28 | * @return \Aimeos\MShop\Order\Item\Iface Created order object |
29 | 29 | */ |
30 | - public function addItem( $baseId, $type ); |
|
30 | + public function addItem($baseId, $type); |
|
31 | 31 | |
32 | 32 | |
33 | 33 | /** |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param string $id Unique order ID |
45 | 45 | * @return \Aimeos\MShop\Order\Item\Iface Order object |
46 | 46 | */ |
47 | - public function getItem( $id ); |
|
47 | + public function getItem($id); |
|
48 | 48 | |
49 | 49 | |
50 | 50 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * @param integer &$total|null Variable that will contain the total number of available items |
55 | 55 | * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values |
56 | 56 | */ |
57 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null ); |
|
57 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
77 | 77 | * @return void |
78 | 78 | */ |
79 | - public function block( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
79 | + public function block(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
80 | 80 | |
81 | 81 | |
82 | 82 | /** |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
99 | 99 | * @return void |
100 | 100 | */ |
101 | - public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
101 | + public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
102 | 102 | |
103 | 103 | |
104 | 104 | /** |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object |
117 | 117 | * @return void |
118 | 118 | */ |
119 | - public function update( \Aimeos\MShop\Order\Item\Iface $orderItem ); |
|
119 | + public function update(\Aimeos\MShop\Order\Item\Iface $orderItem); |
|
120 | 120 | |
121 | 121 | |
122 | 122 | /** |
@@ -130,5 +130,5 @@ discard block |
||
130 | 130 | * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket |
131 | 131 | * @deprecated 2017.04 Use store() from basket controller instead |
132 | 132 | */ |
133 | - public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket ); |
|
133 | + public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket); |
|
134 | 134 | } |
@@ -20,136 +20,136 @@ |
||
20 | 20 | { |
21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
22 | 22 | |
23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Standard' ) |
|
23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Standard') |
|
24 | 24 | ->disableOriginalConstructor() |
25 | 25 | ->getMock(); |
26 | 26 | |
27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ) |
|
28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base') |
|
28 | + ->setConstructorArgs([$this->stub, $this->context]) |
|
29 | 29 | ->getMockForAbstractClass(); |
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | protected function tearDown() |
34 | 34 | { |
35 | - unset( $this->context, $this->object, $this->stub ); |
|
35 | + unset($this->context, $this->object, $this->stub); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testConstructException() |
40 | 40 | { |
41 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Iface' )->getMock(); |
|
41 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Iface')->getMock(); |
|
42 | 42 | |
43 | - $this->setExpectedException( '\Aimeos\Controller\Frontend\Exception' ); |
|
43 | + $this->setExpectedException('\Aimeos\Controller\Frontend\Exception'); |
|
44 | 44 | |
45 | - $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ) |
|
46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
45 | + $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base') |
|
46 | + ->setConstructorArgs([$stub, $this->context]) |
|
47 | 47 | ->getMockForAbstractClass(); |
48 | 48 | } |
49 | 49 | |
50 | 50 | |
51 | 51 | public function testCall() |
52 | 52 | { |
53 | - $stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Standard' ) |
|
53 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Standard') |
|
54 | 54 | ->disableOriginalConstructor() |
55 | - ->setMethods( ['invalid'] ) |
|
55 | + ->setMethods(['invalid']) |
|
56 | 56 | ->getMock(); |
57 | 57 | |
58 | - $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ) |
|
59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
58 | + $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Order\Decorator\Base') |
|
59 | + ->setConstructorArgs([$stub, $this->context]) |
|
60 | 60 | ->getMockForAbstractClass(); |
61 | 61 | |
62 | - $stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) ); |
|
62 | + $stub->expects($this->once())->method('invalid')->will($this->returnValue(true)); |
|
63 | 63 | |
64 | - $this->assertTrue( $object->invalid() ); |
|
64 | + $this->assertTrue($object->invalid()); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
68 | 68 | public function testAddItem() |
69 | 69 | { |
70 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
70 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
71 | 71 | |
72 | - $this->stub->expects( $this->once() )->method( 'addItem' )->will( $this->returnValue( $item ) ); |
|
72 | + $this->stub->expects($this->once())->method('addItem')->will($this->returnValue($item)); |
|
73 | 73 | |
74 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, '' ) ); |
|
74 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, '' )); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
78 | 78 | public function testCreateFilter() |
79 | 79 | { |
80 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createSearch(); |
|
80 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createSearch(); |
|
81 | 81 | |
82 | - $this->stub->expects( $this->once() )->method( 'createFilter' )->will( $this->returnValue( $search ) ); |
|
82 | + $this->stub->expects($this->once())->method('createFilter')->will($this->returnValue($search)); |
|
83 | 83 | |
84 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
84 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
88 | 88 | public function testGetItem() |
89 | 89 | { |
90 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
90 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
91 | 91 | |
92 | - $this->stub->expects( $this->once() )->method( 'getItem' )->will( $this->returnValue( $item ) ); |
|
92 | + $this->stub->expects($this->once())->method('getItem')->will($this->returnValue($item)); |
|
93 | 93 | |
94 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( -1 ) ); |
|
94 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( -1 )); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
98 | 98 | public function testSearchItems() |
99 | 99 | { |
100 | - $search = $this->getMockBuilder( '\Aimeos\MW\Criteria\Iface' )->getMock(); |
|
100 | + $search = $this->getMockBuilder('\Aimeos\MW\Criteria\Iface')->getMock(); |
|
101 | 101 | |
102 | - $this->stub->expects( $this->once() )->method( 'searchItems' )->will( $this->returnValue( [] ) ); |
|
102 | + $this->stub->expects($this->once())->method('searchItems')->will($this->returnValue([])); |
|
103 | 103 | |
104 | - $this->assertEquals( [], $this->object->searchItems( $search ) ); |
|
104 | + $this->assertEquals([], $this->object->searchItems($search)); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | |
108 | 108 | public function testUnblock() |
109 | 109 | { |
110 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
110 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
111 | 111 | |
112 | - $this->stub->expects( $this->once() )->method( 'unblock' ); |
|
112 | + $this->stub->expects($this->once())->method('unblock'); |
|
113 | 113 | |
114 | - $this->object->unblock( $orderItem ); |
|
114 | + $this->object->unblock($orderItem); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
118 | 118 | public function testUpdate() |
119 | 119 | { |
120 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
120 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
121 | 121 | |
122 | - $this->stub->expects( $this->once() )->method( 'update' ); |
|
122 | + $this->stub->expects($this->once())->method('update'); |
|
123 | 123 | |
124 | - $this->object->update( $orderItem ); |
|
124 | + $this->object->update($orderItem); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | |
128 | 128 | public function testStore() |
129 | 129 | { |
130 | - $orderItem = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
131 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
130 | + $orderItem = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
131 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
132 | 132 | |
133 | - $this->stub->expects( $this->once() )->method( 'store' ) |
|
134 | - ->will( $this->returnValue( $orderItem ) ); |
|
133 | + $this->stub->expects($this->once())->method('store') |
|
134 | + ->will($this->returnValue($orderItem)); |
|
135 | 135 | |
136 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->store( $basket ) ); |
|
136 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->store($basket)); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | |
140 | 140 | public function testGetController() |
141 | 141 | { |
142 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
142 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
143 | 143 | |
144 | - $this->assertSame( $this->stub, $result ); |
|
144 | + $this->assertSame($this->stub, $result); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | |
148 | - protected function access( $name ) |
|
148 | + protected function access($name) |
|
149 | 149 | { |
150 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Order\Decorator\Base' ); |
|
151 | - $method = $class->getMethod( $name ); |
|
152 | - $method->setAccessible( true ); |
|
150 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Order\Decorator\Base'); |
|
151 | + $method = $class->getMethod($name); |
|
152 | + $method->setAccessible(true); |
|
153 | 153 | |
154 | 154 | return $method; |
155 | 155 | } |
@@ -18,154 +18,154 @@ |
||
18 | 18 | |
19 | 19 | protected function setUp() |
20 | 20 | { |
21 | - \Aimeos\MShop\Factory::setCache( true ); |
|
21 | + \Aimeos\MShop\Factory::setCache(true); |
|
22 | 22 | |
23 | 23 | $this->context = \TestHelperFrontend::getContext(); |
24 | - $this->object = new \Aimeos\Controller\Frontend\Order\Standard( $this->context ); |
|
24 | + $this->object = new \Aimeos\Controller\Frontend\Order\Standard($this->context); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | protected function tearDown() |
29 | 29 | { |
30 | - unset( $this->object, $this->context ); |
|
30 | + unset($this->object, $this->context); |
|
31 | 31 | |
32 | - \Aimeos\MShop\Factory::setCache( false ); |
|
32 | + \Aimeos\MShop\Factory::setCache(false); |
|
33 | 33 | \Aimeos\MShop\Factory::clear(); |
34 | 34 | } |
35 | 35 | |
36 | 36 | |
37 | 37 | public function testAddItem() |
38 | 38 | { |
39 | - $manager = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
40 | - ->setConstructorArgs( [$this->context] ) |
|
41 | - ->setMethods( ['saveItem'] ) |
|
39 | + $manager = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
40 | + ->setConstructorArgs([$this->context]) |
|
41 | + ->setMethods(['saveItem']) |
|
42 | 42 | ->getMock(); |
43 | 43 | |
44 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'order', $manager ); |
|
44 | + \Aimeos\MShop\Factory::injectManager($this->context, 'order', $manager); |
|
45 | 45 | |
46 | - $manager->expects( $this->once() )->method( 'saveItem' ); |
|
46 | + $manager->expects($this->once())->method('saveItem'); |
|
47 | 47 | |
48 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' ) ); |
|
48 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->addItem( -1, 'test' )); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
52 | 52 | public function testCreateFilter() |
53 | 53 | { |
54 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
54 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | |
58 | 58 | public function testGetItem() |
59 | 59 | { |
60 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order' ); |
|
61 | - $search = $manager->createSearch()->setSlice( 0, 1 ); |
|
62 | - $result = $manager->searchItems( $search ); |
|
60 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'order'); |
|
61 | + $search = $manager->createSearch()->setSlice(0, 1); |
|
62 | + $result = $manager->searchItems($search); |
|
63 | 63 | |
64 | - if( ( $item = reset( $result ) ) === false ) { |
|
65 | - throw new \RuntimeException( 'No order item found' ); |
|
64 | + if (($item = reset($result)) === false) { |
|
65 | + throw new \RuntimeException('No order item found'); |
|
66 | 66 | } |
67 | 67 | |
68 | - $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( $item->getId() ) ); |
|
68 | + $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->getItem($item->getId())); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
72 | 72 | public function testSearchItems() |
73 | 73 | { |
74 | - $this->assertGreaterThan( 1, $this->object->searchItems( $this->object->createFilter() ) ); |
|
74 | + $this->assertGreaterThan(1, $this->object->searchItems($this->object->createFilter())); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
78 | 78 | public function testStore() |
79 | 79 | { |
80 | 80 | $name = 'ControllerFrontendOrderStore'; |
81 | - $this->context->getConfig()->set( 'mshop/order/manager/name', $name ); |
|
81 | + $this->context->getConfig()->set('mshop/order/manager/name', $name); |
|
82 | 82 | |
83 | 83 | |
84 | - $orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
85 | - ->setMethods( array( 'saveItem', 'getSubManager' ) ) |
|
86 | - ->setConstructorArgs( array( $this->context ) ) |
|
84 | + $orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
85 | + ->setMethods(array('saveItem', 'getSubManager')) |
|
86 | + ->setConstructorArgs(array($this->context)) |
|
87 | 87 | ->getMock(); |
88 | 88 | |
89 | - $orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
90 | - ->setMethods( array( 'store' ) ) |
|
91 | - ->setConstructorArgs( array( $this->context ) ) |
|
89 | + $orderBaseManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard') |
|
90 | + ->setMethods(array('store')) |
|
91 | + ->setConstructorArgs(array($this->context)) |
|
92 | 92 | ->getMock(); |
93 | 93 | |
94 | - \Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub ); |
|
94 | + \Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub); |
|
95 | 95 | |
96 | 96 | |
97 | 97 | $orderBaseItem = $orderBaseManagerStub->createItem(); |
98 | - $orderBaseItem->setId( 1 ); |
|
98 | + $orderBaseItem->setId(1); |
|
99 | 99 | |
100 | 100 | |
101 | - $orderBaseManagerStub->expects( $this->once() )->method( 'store' ); |
|
101 | + $orderBaseManagerStub->expects($this->once())->method('store'); |
|
102 | 102 | |
103 | - $orderManagerStub->expects( $this->once() )->method( 'getSubManager' ) |
|
104 | - ->will( $this->returnValue( $orderBaseManagerStub ) ); |
|
103 | + $orderManagerStub->expects($this->once())->method('getSubManager') |
|
104 | + ->will($this->returnValue($orderBaseManagerStub)); |
|
105 | 105 | |
106 | - $orderManagerStub->expects( $this->once() )->method( 'saveItem' ); |
|
106 | + $orderManagerStub->expects($this->once())->method('saveItem'); |
|
107 | 107 | |
108 | 108 | |
109 | - $this->object->store( $orderBaseItem ); |
|
109 | + $this->object->store($orderBaseItem); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
113 | 113 | public function testBlock() |
114 | 114 | { |
115 | 115 | $name = 'ControllerFrontendOrderBlock'; |
116 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
116 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
117 | 117 | |
118 | 118 | |
119 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
120 | - ->setMethods( array( 'block' ) ) |
|
121 | - ->setConstructorArgs( array( $this->context ) ) |
|
119 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
120 | + ->setMethods(array('block')) |
|
121 | + ->setConstructorArgs(array($this->context)) |
|
122 | 122 | ->getMock(); |
123 | 123 | |
124 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
124 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
125 | 125 | |
126 | - $orderCntlStub->expects( $this->once() )->method( 'block' ); |
|
126 | + $orderCntlStub->expects($this->once())->method('block'); |
|
127 | 127 | |
128 | 128 | |
129 | - $this->object->block( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
129 | + $this->object->block(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
133 | 133 | public function testUnblock() |
134 | 134 | { |
135 | 135 | $name = 'ControllerFrontendOrderUnblock'; |
136 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
136 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
137 | 137 | |
138 | 138 | |
139 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
140 | - ->setMethods( array( 'unblock' ) ) |
|
141 | - ->setConstructorArgs( array( $this->context ) ) |
|
139 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
140 | + ->setMethods(array('unblock')) |
|
141 | + ->setConstructorArgs(array($this->context)) |
|
142 | 142 | ->getMock(); |
143 | 143 | |
144 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
144 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
145 | 145 | |
146 | - $orderCntlStub->expects( $this->once() )->method( 'unblock' ); |
|
146 | + $orderCntlStub->expects($this->once())->method('unblock'); |
|
147 | 147 | |
148 | 148 | |
149 | - $this->object->unblock( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
149 | + $this->object->unblock(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | |
153 | 153 | public function testUpdate() |
154 | 154 | { |
155 | 155 | $name = 'ControllerFrontendOrderUpdate'; |
156 | - $this->context->getConfig()->set( 'controller/common/order/name', $name ); |
|
156 | + $this->context->getConfig()->set('controller/common/order/name', $name); |
|
157 | 157 | |
158 | 158 | |
159 | - $orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' ) |
|
160 | - ->setMethods( array( 'update' ) ) |
|
161 | - ->setConstructorArgs( array( $this->context ) ) |
|
159 | + $orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard') |
|
160 | + ->setMethods(array('update')) |
|
161 | + ->setConstructorArgs(array($this->context)) |
|
162 | 162 | ->getMock(); |
163 | 163 | |
164 | - \Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub ); |
|
164 | + \Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub); |
|
165 | 165 | |
166 | - $orderCntlStub->expects( $this->once() )->method( 'update' ); |
|
166 | + $orderCntlStub->expects($this->once())->method('update'); |
|
167 | 167 | |
168 | 168 | |
169 | - $this->object->update( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() ); |
|
169 | + $this->object->update(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem()); |
|
170 | 170 | } |
171 | 171 | } |