@@ -30,13 +30,13 @@ 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 | - \Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\Controller\\Frontend\\Attribute\\Iface', $controller ); |
|
35 | + \Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Frontend\\Attribute\\Iface', $controller); |
|
36 | 36 | |
37 | 37 | $this->controller = $controller; |
38 | 38 | |
39 | - parent::__construct( $context ); |
|
39 | + parent::__construct($context); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | * @return mixed Returns the value of the called method |
49 | 49 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
50 | 50 | */ |
51 | - public function __call( $name, array $param ) |
|
51 | + public function __call($name, array $param) |
|
52 | 52 | { |
53 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
53 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | * @return \Aimeos\MW\Criteria\Iface Criteria object containing the conditions for searching |
63 | 63 | * @since 2017.03 |
64 | 64 | */ |
65 | - public function addFilterTypes( \Aimeos\MW\Criteria\Iface $filter, array $codes ) |
|
65 | + public function addFilterTypes(\Aimeos\MW\Criteria\Iface $filter, array $codes) |
|
66 | 66 | { |
67 | - return $this->controller->addFilterTypes( $filter, $codes ); |
|
67 | + return $this->controller->addFilterTypes($filter, $codes); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | * @return \Aimeos\MShop\Attribute\Item\Iface Attribute item including the referenced domains items |
90 | 90 | * @since 2017.03 |
91 | 91 | */ |
92 | - public function getItem( $id, array $domains = array( 'media', 'price', 'text' ) ) |
|
92 | + public function getItem($id, array $domains = array('media', 'price', 'text')) |
|
93 | 93 | { |
94 | - return $this->controller->getItem( $id, $domains ); |
|
94 | + return $this->controller->getItem($id, $domains); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
@@ -103,9 +103,9 @@ discard block |
||
103 | 103 | * @return \Aimeos\MShop\Attribute\Item\Iface[] Associative list of attribute item including the referenced domains items |
104 | 104 | * @since 2017.03 |
105 | 105 | */ |
106 | - public function getItems( array $ids, array $domains = array( 'media', 'price', 'text' ) ) |
|
106 | + public function getItems(array $ids, array $domains = array('media', 'price', 'text')) |
|
107 | 107 | { |
108 | - return $this->controller->getItems( $ids, $domains ); |
|
108 | + return $this->controller->getItems($ids, $domains); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | * @return array Ordered list of attribute items implementing \Aimeos\MShop\Attribute\Item\Iface |
119 | 119 | * @since 2017.03 |
120 | 120 | */ |
121 | - public function searchItems( \Aimeos\MW\Criteria\Iface $filter, array $domains = array( 'media', 'price', 'text' ), &$total = null ) |
|
121 | + public function searchItems(\Aimeos\MW\Criteria\Iface $filter, array $domains = array('media', 'price', 'text'), &$total = null) |
|
122 | 122 | { |
123 | - return $this->controller->searchItems( $filter, $domains, $total ); |
|
123 | + return $this->controller->searchItems($filter, $domains, $total); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 |
@@ -30,13 +30,13 @@ 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 | - \Aimeos\MW\Common\Base::checkClass( '\\Aimeos\\Controller\\Frontend\\Basket\\Iface', $controller ); |
|
35 | + \Aimeos\MW\Common\Base::checkClass('\\Aimeos\\Controller\\Frontend\\Basket\\Iface', $controller); |
|
36 | 36 | |
37 | 37 | $this->controller = $controller; |
38 | 38 | |
39 | - parent::__construct( $context ); |
|
39 | + parent::__construct($context); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | * @return mixed Returns the value of the called method |
49 | 49 | * @throws \Aimeos\Controller\Frontend\Exception If method call failed |
50 | 50 | */ |
51 | - public function __call( $name, array $param ) |
|
51 | + public function __call($name, array $param) |
|
52 | 52 | { |
53 | - return @call_user_func_array( array( $this->controller, $name ), $param ); |
|
53 | + return @call_user_func_array(array($this->controller, $name), $param); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | * @param string $type Basket type |
93 | 93 | * @return \Aimeos\Controller\Frontend\Basket\Iface Basket frontend object |
94 | 94 | */ |
95 | - public function setType( $type ) |
|
95 | + public function setType($type) |
|
96 | 96 | { |
97 | - $this->controller->setType( $type ); |
|
97 | + $this->controller->setType($type); |
|
98 | 98 | return $this; |
99 | 99 | } |
100 | 100 | |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | * @param boolean $default True to add default criteria (user logged in), false if not |
119 | 119 | * @return \Aimeos\MShop\Order\Item\Base\Iface Order base object including the given parts |
120 | 120 | */ |
121 | - public function load( $id, $parts = \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL, $default = true ) |
|
121 | + public function load($id, $parts = \Aimeos\MShop\Order\Item\Base\Base::PARTS_ALL, $default = true) |
|
122 | 122 | { |
123 | - return $this->controller->load( $id, $parts, $default ); |
|
123 | + return $this->controller->load($id, $parts, $default); |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | |
@@ -145,8 +145,8 @@ discard block |
||
145 | 145 | * @throws \Aimeos\Controller\Frontend\Basket\Exception If the product isn't available |
146 | 146 | * @return void |
147 | 147 | */ |
148 | - public function addProduct( $prodid, $quantity = 1, $stocktype = 'default', array $variantAttributeIds = [], |
|
149 | - array $configAttributeIds = [], array $hiddenAttributeIds = [], array $customAttributeValues = [] ) |
|
148 | + public function addProduct($prodid, $quantity = 1, $stocktype = 'default', array $variantAttributeIds = [], |
|
149 | + array $configAttributeIds = [], array $hiddenAttributeIds = [], array $customAttributeValues = []) |
|
150 | 150 | { |
151 | 151 | $this->controller->addProduct( |
152 | 152 | $prodid, $quantity, $stocktype, $variantAttributeIds, |
@@ -161,9 +161,9 @@ discard block |
||
161 | 161 | * @param integer $position Position number (key) of the order product item |
162 | 162 | * @return void |
163 | 163 | */ |
164 | - public function deleteProduct( $position ) |
|
164 | + public function deleteProduct($position) |
|
165 | 165 | { |
166 | - $this->controller->deleteProduct( $position ); |
|
166 | + $this->controller->deleteProduct($position); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | |
@@ -175,9 +175,9 @@ discard block |
||
175 | 175 | * @param array $configAttributeCodes Codes of the product config attributes that should be REMOVED |
176 | 176 | * @return void |
177 | 177 | */ |
178 | - public function editProduct( $position, $quantity, array $configAttributeCodes = [] ) |
|
178 | + public function editProduct($position, $quantity, array $configAttributeCodes = []) |
|
179 | 179 | { |
180 | - $this->controller->editProduct( $position, $quantity, $configAttributeCodes ); |
|
180 | + $this->controller->editProduct($position, $quantity, $configAttributeCodes); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | |
@@ -188,9 +188,9 @@ discard block |
||
188 | 188 | * @throws \Aimeos\Controller\Frontend\Basket\Exception if the coupon code is invalid or not allowed |
189 | 189 | * @return void |
190 | 190 | */ |
191 | - public function addCoupon( $code ) |
|
191 | + public function addCoupon($code) |
|
192 | 192 | { |
193 | - $this->controller->addCoupon( $code ); |
|
193 | + $this->controller->addCoupon($code); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | * @throws \Aimeos\Controller\Frontend\Basket\Exception if the coupon code is invalid |
202 | 202 | * @return void |
203 | 203 | */ |
204 | - public function deleteCoupon( $code ) |
|
204 | + public function deleteCoupon($code) |
|
205 | 205 | { |
206 | - $this->controller->deleteCoupon( $code ); |
|
206 | + $this->controller->deleteCoupon($code); |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | |
@@ -216,9 +216,9 @@ discard block |
||
216 | 216 | * if one of the keys is invalid when using an array with key/value pairs |
217 | 217 | * @return void |
218 | 218 | */ |
219 | - public function setAddress( $type, $value ) |
|
219 | + public function setAddress($type, $value) |
|
220 | 220 | { |
221 | - $this->controller->setAddress( $type, $value ); |
|
221 | + $this->controller->setAddress($type, $value); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | |
@@ -232,9 +232,9 @@ discard block |
||
232 | 232 | * @throws \Aimeos\Controller\Frontend\Basket\Exception If there is no price to the service item attached |
233 | 233 | * @return void |
234 | 234 | */ |
235 | - public function addService( $type, $id, array $attributes = [] ) |
|
235 | + public function addService($type, $id, array $attributes = []) |
|
236 | 236 | { |
237 | - $this->controller->addService( $type, $id, $attributes ); |
|
237 | + $this->controller->addService($type, $id, $attributes); |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | |
@@ -243,9 +243,9 @@ discard block |
||
243 | 243 | * |
244 | 244 | * @param string $type Service type code like 'payment' or 'delivery' |
245 | 245 | */ |
246 | - public function deleteService( $type ) |
|
246 | + public function deleteService($type) |
|
247 | 247 | { |
248 | - $this->controller->deleteService( $type ); |
|
248 | + $this->controller->deleteService($type); |
|
249 | 249 | } |
250 | 250 | |
251 | 251 |
@@ -20,97 +20,97 @@ |
||
20 | 20 | { |
21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
22 | 22 | |
23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Locale\Standard' ) |
|
23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Locale\Standard') |
|
24 | 24 | ->disableOriginalConstructor() |
25 | 25 | ->getMock(); |
26 | 26 | |
27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Locale\Decorator\Base' ) |
|
28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Locale\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\MW\Common\Exception' ); |
|
43 | + $this->setExpectedException('\Aimeos\MW\Common\Exception'); |
|
44 | 44 | |
45 | - $this->getMockBuilder( '\Aimeos\Controller\Frontend\Locale\Decorator\Base' ) |
|
46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
45 | + $this->getMockBuilder('\Aimeos\Controller\Frontend\Locale\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\Locale\Standard' ) |
|
53 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Locale\Standard') |
|
54 | 54 | ->disableOriginalConstructor() |
55 | - ->setMethods( ['invalid'] ) |
|
55 | + ->setMethods(['invalid']) |
|
56 | 56 | ->getMock(); |
57 | 57 | |
58 | - $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Locale\Decorator\Base' ) |
|
59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
58 | + $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Locale\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 testCreateFilter() |
69 | 69 | { |
70 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'locale' )->createSearch(); |
|
70 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'locale')->createSearch(); |
|
71 | 71 | |
72 | - $this->stub->expects( $this->once() )->method( 'createFilter' ) |
|
73 | - ->will( $this->returnValue( $search ) ); |
|
72 | + $this->stub->expects($this->once())->method('createFilter') |
|
73 | + ->will($this->returnValue($search)); |
|
74 | 74 | |
75 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
75 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
79 | 79 | public function testGetItem() |
80 | 80 | { |
81 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'locale' )->createItem(); |
|
81 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'locale')->createItem(); |
|
82 | 82 | |
83 | - $this->stub->expects( $this->once() )->method( 'getItem' ) |
|
84 | - ->will( $this->returnValue( $item ) ); |
|
83 | + $this->stub->expects($this->once())->method('getItem') |
|
84 | + ->will($this->returnValue($item)); |
|
85 | 85 | |
86 | - $this->assertInstanceOf( '\Aimeos\MShop\Locale\Item\Iface', $this->object->getItem( -1 ) ); |
|
86 | + $this->assertInstanceOf('\Aimeos\MShop\Locale\Item\Iface', $this->object->getItem( -1 )); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
90 | 90 | public function testSearchItems() |
91 | 91 | { |
92 | - $filter = \Aimeos\MShop\Factory::createManager( $this->context, 'locale' )->createSearch(); |
|
92 | + $filter = \Aimeos\MShop\Factory::createManager($this->context, 'locale')->createSearch(); |
|
93 | 93 | |
94 | - $this->stub->expects( $this->once() )->method( 'searchItems' ) |
|
95 | - ->will( $this->returnValue( [] ) ); |
|
94 | + $this->stub->expects($this->once())->method('searchItems') |
|
95 | + ->will($this->returnValue([])); |
|
96 | 96 | |
97 | - $this->assertEquals( [], $this->object->searchItems( $filter, ['media'] ) ); |
|
97 | + $this->assertEquals([], $this->object->searchItems($filter, ['media'])); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | |
101 | 101 | public function testGetController() |
102 | 102 | { |
103 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
103 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
104 | 104 | |
105 | - $this->assertSame( $this->stub, $result ); |
|
105 | + $this->assertSame($this->stub, $result); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | |
109 | - protected function access( $name ) |
|
109 | + protected function access($name) |
|
110 | 110 | { |
111 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Locale\Decorator\Base' ); |
|
112 | - $method = $class->getMethod( $name ); |
|
113 | - $method->setAccessible( true ); |
|
111 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Locale\Decorator\Base'); |
|
112 | + $method = $class->getMethod($name); |
|
113 | + $method->setAccessible(true); |
|
114 | 114 | |
115 | 115 | return $method; |
116 | 116 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Locale\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Locale\Factory::createController( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Locale\Factory::createController(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Locale\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Locale\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
22 | + $this->assertInstanceOf($target, $controller); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCreateControllerInvalidImplementation() |
27 | 27 | { |
28 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Locale\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Locale\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCreateControllerInvalidName() |
34 | 34 | { |
35 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
36 | - \Aimeos\Controller\Frontend\Locale\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Locale\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateControllerNotExisting() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
43 | - \Aimeos\Controller\Frontend\Locale\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Locale\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -20,122 +20,122 @@ |
||
20 | 20 | { |
21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
22 | 22 | |
23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Subscription\Standard' ) |
|
23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Subscription\Standard') |
|
24 | 24 | ->disableOriginalConstructor() |
25 | 25 | ->getMock(); |
26 | 26 | |
27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Subscription\Decorator\Base' ) |
|
28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Subscription\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\MW\Common\Exception' ); |
|
43 | + $this->setExpectedException('\Aimeos\MW\Common\Exception'); |
|
44 | 44 | |
45 | - $this->getMockBuilder( '\Aimeos\Controller\Frontend\Subscription\Decorator\Base' ) |
|
46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
45 | + $this->getMockBuilder('\Aimeos\Controller\Frontend\Subscription\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\Subscription\Standard' ) |
|
53 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Subscription\Standard') |
|
54 | 54 | ->disableOriginalConstructor() |
55 | - ->setMethods( ['invalid'] ) |
|
55 | + ->setMethods(['invalid']) |
|
56 | 56 | ->getMock(); |
57 | 57 | |
58 | - $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Subscription\Decorator\Base' ) |
|
59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
58 | + $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Subscription\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 testCancel() |
69 | 69 | { |
70 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' )->createItem(); |
|
70 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'subscription')->createItem(); |
|
71 | 71 | |
72 | - $this->stub->expects( $this->once() )->method( 'cancel' )->will( $this->returnValue( $item ) ); |
|
72 | + $this->stub->expects($this->once())->method('cancel')->will($this->returnValue($item)); |
|
73 | 73 | |
74 | - $this->assertInstanceOf( '\Aimeos\MShop\Subscription\Item\Iface', $this->object->cancel( -1, '' ) ); |
|
74 | + $this->assertInstanceOf('\Aimeos\MShop\Subscription\Item\Iface', $this->object->cancel( -1, '' )); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | |
78 | 78 | public function testCreateFilter() |
79 | 79 | { |
80 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' )->createSearch(); |
|
80 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'subscription')->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, 'subscription' )->createItem(); |
|
90 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'subscription')->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\Subscription\Item\Iface', $this->object->getItem( -1 ) ); |
|
94 | + $this->assertInstanceOf('\Aimeos\MShop\Subscription\Item\Iface', $this->object->getItem( -1 )); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
98 | 98 | public function testSaveItem() |
99 | 99 | { |
100 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' )->createItem(); |
|
100 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'subscription')->createItem(); |
|
101 | 101 | |
102 | - $this->stub->expects( $this->once() )->method( 'saveItem' ); |
|
102 | + $this->stub->expects($this->once())->method('saveItem'); |
|
103 | 103 | |
104 | - $this->object->saveItem( $item ); |
|
104 | + $this->object->saveItem($item); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | |
108 | 108 | public function testSearchItems() |
109 | 109 | { |
110 | - $search = $this->getMockBuilder( '\Aimeos\MW\Criteria\Iface' )->getMock(); |
|
110 | + $search = $this->getMockBuilder('\Aimeos\MW\Criteria\Iface')->getMock(); |
|
111 | 111 | |
112 | - $this->stub->expects( $this->once() )->method( 'searchItems' )->will( $this->returnValue( [] ) ); |
|
112 | + $this->stub->expects($this->once())->method('searchItems')->will($this->returnValue([])); |
|
113 | 113 | |
114 | - $this->assertEquals( [], $this->object->searchItems( $search ) ); |
|
114 | + $this->assertEquals([], $this->object->searchItems($search)); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
118 | 118 | public function testGetIntervals() |
119 | 119 | { |
120 | - $this->stub->expects( $this->once() )->method( 'getIntervals' )->will( $this->returnValue( [] ) ); |
|
120 | + $this->stub->expects($this->once())->method('getIntervals')->will($this->returnValue([])); |
|
121 | 121 | |
122 | - $this->assertEquals( [], $this->object->getIntervals() ); |
|
122 | + $this->assertEquals([], $this->object->getIntervals()); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | |
126 | 126 | public function testGetController() |
127 | 127 | { |
128 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
128 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
129 | 129 | |
130 | - $this->assertSame( $this->stub, $result ); |
|
130 | + $this->assertSame($this->stub, $result); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | |
134 | - protected function access( $name ) |
|
134 | + protected function access($name) |
|
135 | 135 | { |
136 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Subscription\Decorator\Base' ); |
|
137 | - $method = $class->getMethod( $name ); |
|
138 | - $method->setAccessible( true ); |
|
136 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Subscription\Decorator\Base'); |
|
137 | + $method = $class->getMethod($name); |
|
138 | + $method->setAccessible(true); |
|
139 | 139 | |
140 | 140 | return $method; |
141 | 141 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Subscription\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Subscription\Factory::createController( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Subscription\Factory::createController(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Subscription\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Subscription\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
22 | + $this->assertInstanceOf($target, $controller); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCreateControllerInvalidImplementation() |
27 | 27 | { |
28 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Subscription\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Subscription\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCreateControllerInvalidName() |
34 | 34 | { |
35 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
36 | - \Aimeos\Controller\Frontend\Subscription\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Subscription\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateControllerNotExisting() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
43 | - \Aimeos\Controller\Frontend\Subscription\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Subscription\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -20,161 +20,161 @@ |
||
20 | 20 | { |
21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
22 | 22 | |
23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Product\Standard' ) |
|
23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Product\Standard') |
|
24 | 24 | ->disableOriginalConstructor() |
25 | 25 | ->getMock(); |
26 | 26 | |
27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Product\Decorator\Base' ) |
|
28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Product\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\MW\Common\Exception' ); |
|
43 | + $this->setExpectedException('\Aimeos\MW\Common\Exception'); |
|
44 | 44 | |
45 | - $this->getMockBuilder( '\Aimeos\Controller\Frontend\Product\Decorator\Base' ) |
|
46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
45 | + $this->getMockBuilder('\Aimeos\Controller\Frontend\Product\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\Product\Standard' ) |
|
53 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Product\Standard') |
|
54 | 54 | ->disableOriginalConstructor() |
55 | - ->setMethods( ['invalid'] ) |
|
55 | + ->setMethods(['invalid']) |
|
56 | 56 | ->getMock(); |
57 | 57 | |
58 | - $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Product\Decorator\Base' ) |
|
59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
58 | + $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Product\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 testAddFilterAttribute() |
69 | 69 | { |
70 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
70 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
71 | 71 | |
72 | - $this->stub->expects( $this->once() )->method( 'addFilterAttribute' ) |
|
73 | - ->will( $this->returnArgument( 0 ) ); |
|
72 | + $this->stub->expects($this->once())->method('addFilterAttribute') |
|
73 | + ->will($this->returnArgument(0)); |
|
74 | 74 | |
75 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterAttribute( $search, [], [], [] ) ); |
|
75 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterAttribute($search, [], [], [])); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
79 | 79 | public function testAddFilterCategory() |
80 | 80 | { |
81 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
81 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
82 | 82 | |
83 | - $this->stub->expects( $this->once() )->method( 'addFilterCategory' ) |
|
84 | - ->will( $this->returnArgument( 0 ) ); |
|
83 | + $this->stub->expects($this->once())->method('addFilterCategory') |
|
84 | + ->will($this->returnArgument(0)); |
|
85 | 85 | |
86 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterCategory( $search, -1 ) ); |
|
86 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterCategory($search, -1)); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
90 | 90 | public function testAddFilterSupplier() |
91 | 91 | { |
92 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
92 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
93 | 93 | |
94 | - $this->stub->expects( $this->once() )->method( 'addFilterSupplier' ) |
|
95 | - ->will( $this->returnArgument( 0 ) ); |
|
94 | + $this->stub->expects($this->once())->method('addFilterSupplier') |
|
95 | + ->will($this->returnArgument(0)); |
|
96 | 96 | |
97 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterSupplier( $search, [] ) ); |
|
97 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterSupplier($search, [])); |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | |
101 | 101 | public function testAddFilterText() |
102 | 102 | { |
103 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
103 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
104 | 104 | |
105 | - $this->stub->expects( $this->once() )->method( 'addFilterText' ) |
|
106 | - ->will( $this->returnArgument( 0 ) ); |
|
105 | + $this->stub->expects($this->once())->method('addFilterText') |
|
106 | + ->will($this->returnArgument(0)); |
|
107 | 107 | |
108 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterText( $search, 'test' ) ); |
|
108 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterText($search, 'test')); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
112 | 112 | public function testAggregate() |
113 | 113 | { |
114 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
114 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
115 | 115 | |
116 | - $this->stub->expects( $this->once() )->method( 'aggregate' ) |
|
117 | - ->will( $this->returnValue( [] ) ); |
|
116 | + $this->stub->expects($this->once())->method('aggregate') |
|
117 | + ->will($this->returnValue([])); |
|
118 | 118 | |
119 | - $this->assertEquals( [], $this->object->aggregate( $search, 'test' ) ); |
|
119 | + $this->assertEquals([], $this->object->aggregate($search, 'test')); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | |
123 | 123 | public function testCreateFilter() |
124 | 124 | { |
125 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
125 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
126 | 126 | |
127 | - $this->stub->expects( $this->once() )->method( 'createFilter' ) |
|
128 | - ->will( $this->returnValue( $search ) ); |
|
127 | + $this->stub->expects($this->once())->method('createFilter') |
|
128 | + ->will($this->returnValue($search)); |
|
129 | 129 | |
130 | - $this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() ); |
|
130 | + $this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter()); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | |
134 | 134 | public function testGetItem() |
135 | 135 | { |
136 | - $prodItem = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createItem(); |
|
136 | + $prodItem = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createItem(); |
|
137 | 137 | |
138 | - $this->stub->expects( $this->once() )->method( 'getItem' ) |
|
139 | - ->will( $this->returnValue( $prodItem ) ); |
|
138 | + $this->stub->expects($this->once())->method('getItem') |
|
139 | + ->will($this->returnValue($prodItem)); |
|
140 | 140 | |
141 | - $this->assertInstanceOf( '\Aimeos\MShop\Product\Item\Iface', $this->object->getItem( -1 ) ); |
|
141 | + $this->assertInstanceOf('\Aimeos\MShop\Product\Item\Iface', $this->object->getItem( -1 )); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
145 | 145 | public function testGetItems() |
146 | 146 | { |
147 | - $this->stub->expects( $this->once() )->method( 'getItems' ) |
|
148 | - ->will( $this->returnValue( [] ) ); |
|
147 | + $this->stub->expects($this->once())->method('getItems') |
|
148 | + ->will($this->returnValue([])); |
|
149 | 149 | |
150 | - $this->assertEquals( [], $this->object->getItems( [-1] ) ); |
|
150 | + $this->assertEquals([], $this->object->getItems([-1])); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
154 | 154 | public function testSearchItems() |
155 | 155 | { |
156 | - $search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch(); |
|
156 | + $search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch(); |
|
157 | 157 | |
158 | - $this->stub->expects( $this->once() )->method( 'searchItems' ) |
|
159 | - ->will( $this->returnValue( [] ) ); |
|
158 | + $this->stub->expects($this->once())->method('searchItems') |
|
159 | + ->will($this->returnValue([])); |
|
160 | 160 | |
161 | - $this->assertEquals( [], $this->object->searchItems( $search ) ); |
|
161 | + $this->assertEquals([], $this->object->searchItems($search)); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
165 | 165 | public function testGetController() |
166 | 166 | { |
167 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
167 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
168 | 168 | |
169 | - $this->assertSame( $this->stub, $result ); |
|
169 | + $this->assertSame($this->stub, $result); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | |
173 | - protected function access( $name ) |
|
173 | + protected function access($name) |
|
174 | 174 | { |
175 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Product\Decorator\Base' ); |
|
176 | - $method = $class->getMethod( $name ); |
|
177 | - $method->setAccessible( true ); |
|
175 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Product\Decorator\Base'); |
|
176 | + $method = $class->getMethod($name); |
|
177 | + $method->setAccessible(true); |
|
178 | 178 | |
179 | 179 | return $method; |
180 | 180 | } |
@@ -15,31 +15,31 @@ |
||
15 | 15 | { |
16 | 16 | $target = '\\Aimeos\\Controller\\Frontend\\Product\\Iface'; |
17 | 17 | |
18 | - $controller = \Aimeos\Controller\Frontend\Product\Factory::createController( \TestHelperFrontend::getContext() ); |
|
19 | - $this->assertInstanceOf( $target, $controller ); |
|
18 | + $controller = \Aimeos\Controller\Frontend\Product\Factory::createController(\TestHelperFrontend::getContext()); |
|
19 | + $this->assertInstanceOf($target, $controller); |
|
20 | 20 | |
21 | - $controller = \Aimeos\Controller\Frontend\Product\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' ); |
|
22 | - $this->assertInstanceOf( $target, $controller ); |
|
21 | + $controller = \Aimeos\Controller\Frontend\Product\Factory::createController(\TestHelperFrontend::getContext(), 'Standard'); |
|
22 | + $this->assertInstanceOf($target, $controller); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | |
26 | 26 | public function testCreateControllerInvalidImplementation() |
27 | 27 | { |
28 | - $this->setExpectedException( '\\Aimeos\\MW\\Common\\Exception' ); |
|
29 | - \Aimeos\Controller\Frontend\Product\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' ); |
|
28 | + $this->setExpectedException('\\Aimeos\\MW\\Common\\Exception'); |
|
29 | + \Aimeos\Controller\Frontend\Product\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | |
33 | 33 | public function testCreateControllerInvalidName() |
34 | 34 | { |
35 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
36 | - \Aimeos\Controller\Frontend\Product\Factory::createController( \TestHelperFrontend::getContext(), '%^' ); |
|
35 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
36 | + \Aimeos\Controller\Frontend\Product\Factory::createController(\TestHelperFrontend::getContext(), '%^'); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | |
40 | 40 | public function testCreateControllerNotExisting() |
41 | 41 | { |
42 | - $this->setExpectedException( '\\Aimeos\\Controller\\Frontend\\Exception' ); |
|
43 | - \Aimeos\Controller\Frontend\Product\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' ); |
|
42 | + $this->setExpectedException('\\Aimeos\\Controller\\Frontend\\Exception'); |
|
43 | + \Aimeos\Controller\Frontend\Product\Factory::createController(\TestHelperFrontend::getContext(), 'notexist'); |
|
44 | 44 | } |
45 | 45 | } |
@@ -20,130 +20,130 @@ |
||
20 | 20 | { |
21 | 21 | $this->context = \TestHelperFrontend::getContext(); |
22 | 22 | |
23 | - $this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Standard' ) |
|
23 | + $this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Standard') |
|
24 | 24 | ->disableOriginalConstructor() |
25 | 25 | ->getMock(); |
26 | 26 | |
27 | - $this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ) |
|
28 | - ->setConstructorArgs( [$this->stub, $this->context] ) |
|
27 | + $this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\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\MW\Common\Exception' ); |
|
43 | + $this->setExpectedException('\Aimeos\MW\Common\Exception'); |
|
44 | 44 | |
45 | - $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ) |
|
46 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
45 | + $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\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\Service\Standard' ) |
|
53 | + $stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\Standard') |
|
54 | 54 | ->disableOriginalConstructor() |
55 | - ->setMethods( ['invalid'] ) |
|
55 | + ->setMethods(['invalid']) |
|
56 | 56 | ->getMock(); |
57 | 57 | |
58 | - $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ) |
|
59 | - ->setConstructorArgs( [$stub, $this->context] ) |
|
58 | + $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Service\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 testCheckAttributes() |
69 | 69 | { |
70 | - $this->stub->expects( $this->once() )->method( 'checkAttributes' ) |
|
71 | - ->will( $this->returnValue( [] ) ); |
|
70 | + $this->stub->expects($this->once())->method('checkAttributes') |
|
71 | + ->will($this->returnValue([])); |
|
72 | 72 | |
73 | - $this->assertEquals( [], $this->object->checkAttributes( -1, [] ) ); |
|
73 | + $this->assertEquals([], $this->object->checkAttributes( -1, [] )); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | |
77 | 77 | public function testGetProvider() |
78 | 78 | { |
79 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'service' ); |
|
80 | - $provider = $manager->getProvider( $manager->findItem( 'unitcode', [], 'service', 'delivery' ), 'delivery' ); |
|
79 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'service'); |
|
80 | + $provider = $manager->getProvider($manager->findItem('unitcode', [], 'service', 'delivery'), 'delivery'); |
|
81 | 81 | |
82 | - $this->stub->expects( $this->once() )->method( 'getProvider' ) |
|
83 | - ->will( $this->returnValue( $provider ) ); |
|
82 | + $this->stub->expects($this->once())->method('getProvider') |
|
83 | + ->will($this->returnValue($provider)); |
|
84 | 84 | |
85 | - $this->assertSame( $provider, $this->object->getProvider( -1 ) ); |
|
85 | + $this->assertSame($provider, $this->object->getProvider( -1 )); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | public function testGetProviders() |
90 | 90 | { |
91 | - $this->stub->expects( $this->once() )->method( 'getProviders' ) |
|
92 | - ->will( $this->returnValue( [] ) ); |
|
91 | + $this->stub->expects($this->once())->method('getProviders') |
|
92 | + ->will($this->returnValue([])); |
|
93 | 93 | |
94 | - $this->assertEquals( [], $this->object->getProviders( 'payment' ) ); |
|
94 | + $this->assertEquals([], $this->object->getProviders('payment')); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | |
98 | 98 | public function testProcess() |
99 | 99 | { |
100 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
100 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
101 | 101 | |
102 | - $this->stub->expects( $this->once() )->method( 'process' ) |
|
103 | - ->will( $this->returnValue( new \Aimeos\MShop\Common\Item\Helper\Form\Standard() ) ); |
|
102 | + $this->stub->expects($this->once())->method('process') |
|
103 | + ->will($this->returnValue(new \Aimeos\MShop\Common\Item\Helper\Form\Standard())); |
|
104 | 104 | |
105 | - $this->assertInstanceOf( 'Aimeos\MShop\Common\Item\Helper\Form\Iface', $this->object->process( $item, -1, [], [] ) ); |
|
105 | + $this->assertInstanceOf('Aimeos\MShop\Common\Item\Helper\Form\Iface', $this->object->process($item, -1, [], [])); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | |
109 | 109 | public function testUpdatePush() |
110 | 110 | { |
111 | - $response = $this->getMockBuilder( '\Psr\Http\Message\ResponseInterface' )->getMock(); |
|
112 | - $request = $this->getMockBuilder( '\Psr\Http\Message\ServerRequestInterface' )->getMock(); |
|
111 | + $response = $this->getMockBuilder('\Psr\Http\Message\ResponseInterface')->getMock(); |
|
112 | + $request = $this->getMockBuilder('\Psr\Http\Message\ServerRequestInterface')->getMock(); |
|
113 | 113 | |
114 | - $this->stub->expects( $this->once() )->method( 'updatePush' ) |
|
115 | - ->will( $this->returnValue( $response ) ); |
|
114 | + $this->stub->expects($this->once())->method('updatePush') |
|
115 | + ->will($this->returnValue($response)); |
|
116 | 116 | |
117 | - $this->assertInstanceOf( '\Psr\Http\Message\ResponseInterface', $this->object->updatePush( $request, $response, 'test' ) ); |
|
117 | + $this->assertInstanceOf('\Psr\Http\Message\ResponseInterface', $this->object->updatePush($request, $response, 'test')); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | |
121 | 121 | public function testUpdateSync() |
122 | 122 | { |
123 | - $response = $this->getMockBuilder( '\Psr\Http\Message\ResponseInterface' )->getMock(); |
|
124 | - $request = $this->getMockBuilder( '\Psr\Http\Message\ServerRequestInterface' )->getMock(); |
|
125 | - $item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
123 | + $response = $this->getMockBuilder('\Psr\Http\Message\ResponseInterface')->getMock(); |
|
124 | + $request = $this->getMockBuilder('\Psr\Http\Message\ServerRequestInterface')->getMock(); |
|
125 | + $item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
126 | 126 | |
127 | - $this->stub->expects( $this->once() )->method( 'updateSync' ) |
|
128 | - ->will( $this->returnValue( $item ) ); |
|
127 | + $this->stub->expects($this->once())->method('updateSync') |
|
128 | + ->will($this->returnValue($item)); |
|
129 | 129 | |
130 | - $this->assertInstanceOf( 'Aimeos\MShop\Order\Item\Iface', $this->object->updateSync( $request, $response, [], 'test', -1 ) ); |
|
130 | + $this->assertInstanceOf('Aimeos\MShop\Order\Item\Iface', $this->object->updateSync($request, $response, [], 'test', -1)); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | |
134 | 134 | public function testGetController() |
135 | 135 | { |
136 | - $result = $this->access( 'getController' )->invokeArgs( $this->object, [] ); |
|
136 | + $result = $this->access('getController')->invokeArgs($this->object, []); |
|
137 | 137 | |
138 | - $this->assertSame( $this->stub, $result ); |
|
138 | + $this->assertSame($this->stub, $result); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | |
142 | - protected function access( $name ) |
|
142 | + protected function access($name) |
|
143 | 143 | { |
144 | - $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Service\Decorator\Base' ); |
|
145 | - $method = $class->getMethod( $name ); |
|
146 | - $method->setAccessible( true ); |
|
144 | + $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Service\Decorator\Base'); |
|
145 | + $method = $class->getMethod($name); |
|
146 | + $method->setAccessible(true); |
|
147 | 147 | |
148 | 148 | return $method; |
149 | 149 | } |