Completed
Push — master ( 5756ac...256eed )
by Aimeos
03:01
created
controller/frontend/tests/Controller/Frontend/Service/StandardTest.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -17,125 +17,125 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop\Factory::setCache( true );
20
+		\Aimeos\MShop\Factory::setCache(true);
21 21
 
22 22
 		$this->context = \TestHelperFrontend::getContext();
23
-		$this->object = new \Aimeos\Controller\Frontend\Service\Standard( $this->context );
23
+		$this->object = new \Aimeos\Controller\Frontend\Service\Standard($this->context);
24 24
 	}
25 25
 
26 26
 
27 27
 	public static function setUpBeforeClass()
28 28
 	{
29
-		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( \TestHelperFrontend::getContext() );
30
-		$orderBaseMgr = $orderManager->getSubManager( 'base' );
29
+		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager(\TestHelperFrontend::getContext());
30
+		$orderBaseMgr = $orderManager->getSubManager('base');
31 31
 		self::$basket = $orderBaseMgr->createItem();
32 32
 	}
33 33
 
34 34
 
35 35
 	protected function tearDown()
36 36
 	{
37
-		unset( $this->object, $this->context );
37
+		unset($this->object, $this->context);
38 38
 
39
-		\Aimeos\MShop\Factory::setCache( false );
39
+		\Aimeos\MShop\Factory::setCache(false);
40 40
 		\Aimeos\MShop\Factory::clear();
41 41
 	}
42 42
 
43 43
 
44 44
 	public function testCheckAttributes()
45 45
 	{
46
-		$attributes = $this->object->checkAttributes( $this->getServiceItem()->getId(), [] );
47
-		$this->assertEquals( [], $attributes );
46
+		$attributes = $this->object->checkAttributes($this->getServiceItem()->getId(), []);
47
+		$this->assertEquals([], $attributes);
48 48
 	}
49 49
 
50 50
 
51 51
 	public function testGetProviders()
52 52
 	{
53
-		$providers = $this->object->getProviders( 'delivery' );
54
-		$this->assertGreaterThan( 0, count( $providers ) );
53
+		$providers = $this->object->getProviders('delivery');
54
+		$this->assertGreaterThan(0, count($providers));
55 55
 
56
-		foreach( $providers as $provider ) {
57
-			$this->assertInstanceOf( '\\Aimeos\\MShop\\Service\\Provider\\Iface', $provider );
56
+		foreach ($providers as $provider) {
57
+			$this->assertInstanceOf('\\Aimeos\\MShop\\Service\\Provider\\Iface', $provider);
58 58
 		}
59 59
 	}
60 60
 
61 61
 
62 62
 	public function testGetProvider()
63 63
 	{
64
-		$provider = $this->object->getProvider( $this->getServiceItem()->getId() );
65
-		$this->assertInstanceOf( '\\Aimeos\\MShop\\Service\\Provider\\Iface', $provider );
64
+		$provider = $this->object->getProvider($this->getServiceItem()->getId());
65
+		$this->assertInstanceOf('\\Aimeos\\MShop\\Service\\Provider\\Iface', $provider);
66 66
 	}
67 67
 
68 68
 
69 69
 	public function testProcess()
70 70
 	{
71 71
 		$form = new \Aimeos\MShop\Common\Item\Helper\Form\Standard();
72
-		$item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem();
73
-		$serviceId = \Aimeos\MShop\Factory::createManager( $this->context, 'service' )->findItem( 'unitcode' )->getId();
72
+		$item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem();
73
+		$serviceId = \Aimeos\MShop\Factory::createManager($this->context, 'service')->findItem('unitcode')->getId();
74 74
 
75
-		$provider = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard' )
75
+		$provider = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard')
76 76
 			->disableOriginalConstructor()
77
-			->setMethods( ['process'] )
77
+			->setMethods(['process'])
78 78
 			->getMock();
79 79
 
80
-		$manager = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Manager\\Standard' )
81
-			->setConstructorArgs( [$this->context] )
82
-			->setMethods( ['getProvider'] )
80
+		$manager = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Manager\\Standard')
81
+			->setConstructorArgs([$this->context])
82
+			->setMethods(['getProvider'])
83 83
 			->getMock();
84 84
 
85
-		\Aimeos\MShop\Factory::injectManager( $this->context, 'service', $manager );
85
+		\Aimeos\MShop\Factory::injectManager($this->context, 'service', $manager);
86 86
 
87
-		$provider->expects( $this->once() )->method( 'process' )->will( $this->returnValue( $form ) );
88
-		$manager->expects( $this->once() )->method( 'getProvider' )->will( $this->returnValue( $provider ) );
87
+		$provider->expects($this->once())->method('process')->will($this->returnValue($form));
88
+		$manager->expects($this->once())->method('getProvider')->will($this->returnValue($provider));
89 89
 
90 90
 
91
-		$result = $this->object->process( $item, $serviceId, [], [] );
92
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Helper\Form\Iface', $result );
91
+		$result = $this->object->process($item, $serviceId, [], []);
92
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Helper\Form\Iface', $result);
93 93
 	}
94 94
 
95 95
 
96 96
 	public function testUpdateSync()
97 97
 	{
98
-		$item = \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem();
98
+		$item = \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem();
99 99
 
100
-		$stream = $this->getMockBuilder( 'Psr\Http\Message\StreamInterface' )->getMock();
101
-		$request = $this->getMockBuilder( '\Psr\Http\Message\ServerRequestInterface' )->getMock();
102
-		$response = $this->getMockBuilder( '\Aimeos\MW\View\Helper\Response\Iface' )
100
+		$stream = $this->getMockBuilder('Psr\Http\Message\StreamInterface')->getMock();
101
+		$request = $this->getMockBuilder('\Psr\Http\Message\ServerRequestInterface')->getMock();
102
+		$response = $this->getMockBuilder('\Aimeos\MW\View\Helper\Response\Iface')
103 103
 			->getMock();
104 104
 
105
-		$provider = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard' )
106
-			->setMethods( ['updateSync', 'query', 'isImplemented'] )
105
+		$provider = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Provider\\Delivery\\Standard')
106
+			->setMethods(['updateSync', 'query', 'isImplemented'])
107 107
 			->disableOriginalConstructor()
108 108
 			->getMock();
109 109
 
110
-		$manager = $this->getMockBuilder( '\\Aimeos\\MShop\\Service\\Manager\\Standard' )
111
-			->setConstructorArgs( array( $this->context ) )
112
-			->setMethods( ['getProvider'] )
110
+		$manager = $this->getMockBuilder('\\Aimeos\\MShop\\Service\\Manager\\Standard')
111
+			->setConstructorArgs(array($this->context))
112
+			->setMethods(['getProvider'])
113 113
 			->getMock();
114 114
 
115
-		\Aimeos\MShop\Factory::injectManager( $this->context, 'service', $manager );
115
+		\Aimeos\MShop\Factory::injectManager($this->context, 'service', $manager);
116 116
 
117 117
 
118
-		$request->expects( $this->once() )->method( 'getQueryParams' )->will( $this->returnValue( ['code' => 'unitcode'] ) );
119
-		$response->expects( $this->once() )->method( 'createStreamFromString' )->will( $this->returnValue( $stream ) );
120
-		$manager->expects( $this->once() )->method( 'getProvider' )->will( $this->returnValue( $provider ) );
121
-		$provider->expects( $this->once() )->method( 'updateSync' )->will( $this->returnValue( $item ) );
122
-		$provider->expects( $this->once() )->method( 'isImplemented' )->will( $this->returnValue( true ) );
123
-		$provider->expects( $this->once() )->method( 'query' );
118
+		$request->expects($this->once())->method('getQueryParams')->will($this->returnValue(['code' => 'unitcode']));
119
+		$response->expects($this->once())->method('createStreamFromString')->will($this->returnValue($stream));
120
+		$manager->expects($this->once())->method('getProvider')->will($this->returnValue($provider));
121
+		$provider->expects($this->once())->method('updateSync')->will($this->returnValue($item));
122
+		$provider->expects($this->once())->method('isImplemented')->will($this->returnValue(true));
123
+		$provider->expects($this->once())->method('query');
124 124
 
125
-		$this->object->updateSync( $request, $response, [] );
125
+		$this->object->updateSync($request, $response, []);
126 126
 	}
127 127
 
128 128
 
129 129
 	public function testGetServices()
130 130
 	{
131
-		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( \TestHelperFrontend::getContext() );
132
-		$basket = $orderManager->getSubManager( 'base' )->createItem();
131
+		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager(\TestHelperFrontend::getContext());
132
+		$basket = $orderManager->getSubManager('base')->createItem();
133 133
 
134
-		$services = $this->object->getServices( 'delivery', $basket );
135
-		$this->assertGreaterThan( 0, count( $services ) );
134
+		$services = $this->object->getServices('delivery', $basket);
135
+		$this->assertGreaterThan(0, count($services));
136 136
 
137
-		foreach( $services as $service ) {
138
-			$this->assertInstanceOf( '\\Aimeos\\MShop\\Service\\Item\\Iface', $service );
137
+		foreach ($services as $service) {
138
+			$this->assertInstanceOf('\\Aimeos\\MShop\\Service\\Item\\Iface', $service);
139 139
 		}
140 140
 	}
141 141
 
@@ -143,83 +143,83 @@  discard block
 block discarded – undo
143 143
 	public function testGetServiceAttributes()
144 144
 	{
145 145
 		$service = $this->getServiceItem();
146
-		$attributes = $this->object->getServiceAttributes( 'delivery', $service->getId(), self::$basket );
146
+		$attributes = $this->object->getServiceAttributes('delivery', $service->getId(), self::$basket);
147 147
 
148
-		$this->assertEquals( 0, count( $attributes ) );
148
+		$this->assertEquals(0, count($attributes));
149 149
 	}
150 150
 
151 151
 
152 152
 	public function testGetServiceAttributesCache()
153 153
 	{
154
-		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( \TestHelperFrontend::getContext() );
155
-		$basket = $orderManager->getSubManager( 'base' )->createItem();
154
+		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager(\TestHelperFrontend::getContext());
155
+		$basket = $orderManager->getSubManager('base')->createItem();
156 156
 
157
-		$services = $this->object->getServices( 'delivery', $basket );
157
+		$services = $this->object->getServices('delivery', $basket);
158 158
 
159
-		if( ( $service = reset( $services ) ) === false ) {
160
-			throw new \RuntimeException( 'No service item found' );
159
+		if (($service = reset($services)) === false) {
160
+			throw new \RuntimeException('No service item found');
161 161
 		}
162 162
 
163
-		$attributes = $this->object->getServiceAttributes( 'delivery', $service->getId(), self::$basket );
163
+		$attributes = $this->object->getServiceAttributes('delivery', $service->getId(), self::$basket);
164 164
 
165
-		$this->assertEquals( 0, count( $attributes ) );
165
+		$this->assertEquals(0, count($attributes));
166 166
 	}
167 167
 
168 168
 
169 169
 	public function testGetServiceAttributesNoItems()
170 170
 	{
171
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
172
-		$this->object->getServiceAttributes( 'invalid', -1, self::$basket );
171
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
172
+		$this->object->getServiceAttributes('invalid', -1, self::$basket);
173 173
 	}
174 174
 
175 175
 
176 176
 	public function testGetServicePrice()
177 177
 	{
178
-		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( \TestHelperFrontend::getContext() );
179
-		$basket = $orderManager->getSubManager( 'base' )->createItem();
178
+		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager(\TestHelperFrontend::getContext());
179
+		$basket = $orderManager->getSubManager('base')->createItem();
180 180
 
181 181
 		$service = $this->getServiceItem();
182
-		$price = $this->object->getServicePrice( 'delivery', $service->getId(), $basket );
182
+		$price = $this->object->getServicePrice('delivery', $service->getId(), $basket);
183 183
 
184
-		$this->assertEquals( '12.95', $price->getValue() );
185
-		$this->assertEquals( '1.99', $price->getCosts() );
184
+		$this->assertEquals('12.95', $price->getValue());
185
+		$this->assertEquals('1.99', $price->getCosts());
186 186
 	}
187 187
 
188 188
 
189 189
 	public function testGetServicePriceCache()
190 190
 	{
191
-		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( \TestHelperFrontend::getContext() );
192
-		$basket = $orderManager->getSubManager( 'base' )->createItem();
191
+		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager(\TestHelperFrontend::getContext());
192
+		$basket = $orderManager->getSubManager('base')->createItem();
193 193
 
194
-		$services = $this->object->getServices( 'delivery', $basket );
194
+		$services = $this->object->getServices('delivery', $basket);
195 195
 
196
-		if( ( $service = reset( $services ) ) === false ) {
197
-			throw new \RuntimeException( 'No service item found' );
196
+		if (($service = reset($services)) === false) {
197
+			throw new \RuntimeException('No service item found');
198 198
 		}
199 199
 
200
-		$price = $this->object->getServicePrice( 'delivery', $service->getId(), $basket );
200
+		$price = $this->object->getServicePrice('delivery', $service->getId(), $basket);
201 201
 
202
-		$this->assertEquals( '12.95', $price->getValue() );
203
-		$this->assertEquals( '1.99', $price->getCosts() );
202
+		$this->assertEquals('12.95', $price->getValue());
203
+		$this->assertEquals('1.99', $price->getCosts());
204 204
 	}
205 205
 
206 206
 
207 207
 	public function testGetServicePriceNoItems()
208 208
 	{
209
-		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager( \TestHelperFrontend::getContext() );
210
-		$basket = $orderManager->getSubManager( 'base' )->createItem();
209
+		$orderManager = \Aimeos\MShop\Order\Manager\Factory::createManager(\TestHelperFrontend::getContext());
210
+		$basket = $orderManager->getSubManager('base')->createItem();
211 211
 
212
-		$this->setExpectedException( '\\Aimeos\\MShop\\Exception' );
213
-		$this->object->getServicePrice( 'invalid', -1, $basket );
212
+		$this->setExpectedException('\\Aimeos\\MShop\\Exception');
213
+		$this->object->getServicePrice('invalid', -1, $basket);
214 214
 	}
215 215
 
216 216
 
217 217
 	public function testCheckServiceAttributes()
218 218
 	{
219 219
 		$service = $this->getServiceItem();
220
-		$attributes = $this->object->checkServiceAttributes( 'delivery', $service->getId(), [] );
220
+		$attributes = $this->object->checkServiceAttributes('delivery', $service->getId(), []);
221 221
 
222
-		$this->assertEquals( [], $attributes );
222
+		$this->assertEquals([], $attributes);
223 223
 	}
224 224
 
225 225
 
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 	 */
229 229
 	protected function getServiceItem()
230 230
 	{
231
-		$manager = \Aimeos\MShop\Service\Manager\Factory::createManager( \TestHelperFrontend::getContext() );
232
-		return $manager->findItem( 'unitcode' );
231
+		$manager = \Aimeos\MShop\Service\Manager\Factory::createManager(\TestHelperFrontend::getContext());
232
+		return $manager->findItem('unitcode');
233 233
 	}
234 234
 }
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Customer/StandardTest.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -18,114 +18,114 @@  discard block
 block discarded – undo
18 18
 	protected function setUp()
19 19
 	{
20 20
 		$this->context = \TestHelperFrontend::getContext();
21
-		$this->object = new \Aimeos\Controller\Frontend\Customer\Standard( $this->context );
21
+		$this->object = new \Aimeos\Controller\Frontend\Customer\Standard($this->context);
22 22
 	}
23 23
 
24 24
 
25 25
 	protected function tearDown()
26 26
 	{
27
-		unset( $this->context, $this->object );
27
+		unset($this->context, $this->object);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testAddEditSaveDeleteItem()
32 32
 	{
33
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' );
34
-		$id = $manager->findItem( 'UTC001' )->getId();
33
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer');
34
+		$id = $manager->findItem('UTC001')->getId();
35 35
 
36
-		$this->context->setUserId( $id );
37
-		$item = $this->object->addItem( ['customer.code' => 'unittest-ctnl', 'customer.status' => 1] );
38
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $item );
36
+		$this->context->setUserId($id);
37
+		$item = $this->object->addItem(['customer.code' => 'unittest-ctnl', 'customer.status' => 1]);
38
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Iface', $item);
39 39
 
40
-		$this->context->setUserId( $item->getId() );
41
-		$item = $this->object->editItem( $item->getId(), ['customer.code' => 'unittest-ctnl2'] );
42
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $item );
40
+		$this->context->setUserId($item->getId());
41
+		$item = $this->object->editItem($item->getId(), ['customer.code' => 'unittest-ctnl2']);
42
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Iface', $item);
43 43
 
44
-		$item->setStatus( 0 );
45
-		$this->object->saveItem( $item );
46
-		$this->assertEquals( 0, $item->getStatus() );
44
+		$item->setStatus(0);
45
+		$this->object->saveItem($item);
46
+		$this->assertEquals(0, $item->getStatus());
47 47
 
48
-		$this->object->deleteItem( $item->getId() );
48
+		$this->object->deleteItem($item->getId());
49 49
 
50
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
51
-		$manager->findItem( 'unittest-ctnl' );
50
+		$this->setExpectedException('\Aimeos\MShop\Exception');
51
+		$manager->findItem('unittest-ctnl');
52 52
 	}
53 53
 
54 54
 
55 55
 	public function testCreateItem()
56 56
 	{
57 57
 		$result = $this->object->createItem();
58
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $result );
58
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Iface', $result);
59 59
 	}
60 60
 
61 61
 
62 62
 	public function testGetItem()
63 63
 	{
64
-		$id = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' )->findItem( 'UTC001' )->getId();
65
-		$this->context->setUserId( $id );
64
+		$id = \Aimeos\MShop\Factory::createManager($this->context, 'customer')->findItem('UTC001')->getId();
65
+		$this->context->setUserId($id);
66 66
 
67
-		$result = $this->object->getItem( $id, ['customer/address', 'text'] );
67
+		$result = $this->object->getItem($id, ['customer/address', 'text']);
68 68
 
69
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $result );
70
-		$this->assertEquals( 1, count( $result->getRefItems( 'text' ) ) );
71
-		$this->assertEquals( 1, count( $result->getAddressItems() ) );
69
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Iface', $result);
70
+		$this->assertEquals(1, count($result->getRefItems('text')));
71
+		$this->assertEquals(1, count($result->getAddressItems()));
72 72
 	}
73 73
 
74 74
 
75 75
 	public function testFindItem()
76 76
 	{
77
-		$result = $this->object->findItem( 'UTC001' );
78
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Iface', $result );
77
+		$result = $this->object->findItem('UTC001');
78
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Iface', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testAddEditSaveDeleteAddressItem()
83 83
 	{
84
-		$customer = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' )->findItem( 'UTC001' );
85
-		$this->context->setUserId( $customer->getId() );
84
+		$customer = \Aimeos\MShop\Factory::createManager($this->context, 'customer')->findItem('UTC001');
85
+		$this->context->setUserId($customer->getId());
86 86
 
87
-		$item = $this->object->addAddressItem( ['customer.address.lastname' => 'unittest-ctnl'] );
88
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Address\Iface', $item );
87
+		$item = $this->object->addAddressItem(['customer.address.lastname' => 'unittest-ctnl']);
88
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Address\Iface', $item);
89 89
 
90
-		$item = $this->object->editAddressItem( $item->getId(), ['customer.address.lastname' => 'unittest-ctnl2'] );
91
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Address\Iface', $item );
90
+		$item = $this->object->editAddressItem($item->getId(), ['customer.address.lastname' => 'unittest-ctnl2']);
91
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Address\Iface', $item);
92 92
 
93
-		$item->setLastName( 'test' );
94
-		$this->object->saveAddressItem( $item );
95
-		$this->assertEquals( 'test', $item->getLastName() );
93
+		$item->setLastName('test');
94
+		$this->object->saveAddressItem($item);
95
+		$this->assertEquals('test', $item->getLastName());
96 96
 
97
-		$this->object->deleteAddressItem( $item->getId() );
97
+		$this->object->deleteAddressItem($item->getId());
98 98
 	}
99 99
 
100 100
 
101 101
 	public function testCreateAddressItem()
102 102
 	{
103 103
 		$result = $this->object->createAddressItem();
104
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Address\Iface', $result );
104
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Address\Iface', $result);
105 105
 	}
106 106
 
107 107
 
108 108
 	public function testGetAddressItem()
109 109
 	{
110
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer/address' );
110
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer/address');
111 111
 		$search = $manager->createSearch();
112
-		$search->setSlice( 0, 1 );
113
-		$result = $manager->searchItems( $search );
112
+		$search->setSlice(0, 1);
113
+		$result = $manager->searchItems($search);
114 114
 
115
-		if( ( $item = reset( $result ) ) === false ) {
116
-			throw new \RuntimeException( 'No customer address available' );
115
+		if (($item = reset($result)) === false) {
116
+			throw new \RuntimeException('No customer address available');
117 117
 		}
118 118
 
119
-		$this->context->setUserId( $item->getParentId() );
120
-		$result = $this->object->getAddressItem( $item->getId() );
121
-		$this->assertInstanceOf( '\Aimeos\MShop\Customer\Item\Address\Iface', $result );
119
+		$this->context->setUserId($item->getParentId());
120
+		$result = $this->object->getAddressItem($item->getId());
121
+		$this->assertInstanceOf('\Aimeos\MShop\Customer\Item\Address\Iface', $result);
122 122
 	}
123 123
 
124 124
 
125 125
 	public function testAddEditDeleteListItem()
126 126
 	{
127
-		$customer = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' )->findItem( 'UTC001' );
128
-		$this->context->setUserId( $customer->getId() );
127
+		$customer = \Aimeos\MShop\Factory::createManager($this->context, 'customer')->findItem('UTC001');
128
+		$this->context->setUserId($customer->getId());
129 129
 
130 130
 		$values = [
131 131
 			'customer.lists.type' => 'favorite',
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 			'customer.lists.refid' => '-1'
134 134
 		];
135 135
 
136
-		$item = $this->object->addListItem( $values );
137
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Lists\Iface', $item );
136
+		$item = $this->object->addListItem($values);
137
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Lists\Iface', $item);
138 138
 
139 139
 		$values = [
140 140
 			'customer.lists.type' => 'favorite',
@@ -142,46 +142,46 @@  discard block
 block discarded – undo
142 142
 			'customer.lists.refid' => '-2'
143 143
 		];
144 144
 
145
-		$item = $this->object->editListItem( $item->getId(), $values );
146
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Lists\Iface', $item );
145
+		$item = $this->object->editListItem($item->getId(), $values);
146
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Lists\Iface', $item);
147 147
 
148
-		$this->object->deleteListItem( $item->getId() );
148
+		$this->object->deleteListItem($item->getId());
149 149
 
150
-		$this->setExpectedException( '\Aimeos\MShop\Exception' );
151
-		$this->object->getListItem( $item->getId() );
150
+		$this->setExpectedException('\Aimeos\MShop\Exception');
151
+		$this->object->getListItem($item->getId());
152 152
 	}
153 153
 
154 154
 
155 155
 	public function testGetListItem()
156 156
 	{
157
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer/lists' );
157
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer/lists');
158 158
 		$search = $manager->createSearch();
159
-		$search->setSlice( 0, 1 );
160
-		$result = $manager->searchItems( $search );
159
+		$search->setSlice(0, 1);
160
+		$result = $manager->searchItems($search);
161 161
 
162
-		if( ( $item = reset( $result ) ) === false ) {
163
-			throw new \RuntimeException( 'No customer lists item available' );
162
+		if (($item = reset($result)) === false) {
163
+			throw new \RuntimeException('No customer lists item available');
164 164
 		}
165 165
 
166
-		$this->context->setUserId( $item->getParentId() );
167
-		$result = $this->object->getListItem( $item->getId() );
168
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Lists\Iface', $result );
166
+		$this->context->setUserId($item->getParentId());
167
+		$result = $this->object->getListItem($item->getId());
168
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Lists\Iface', $result);
169 169
 	}
170 170
 
171 171
 
172 172
 	public function testSearchListItem()
173 173
 	{
174
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' );
175
-		$customer = $manager->findItem( 'UTC001' );
176
-		$this->context->setUserId( $customer->getId() );
174
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer');
175
+		$customer = $manager->findItem('UTC001');
176
+		$this->context->setUserId($customer->getId());
177 177
 
178 178
 		$filter = $this->object->createListsFilter();
179
-		$result = $this->object->searchListItems( $filter );
179
+		$result = $this->object->searchListItems($filter);
180 180
 
181
-		foreach( $result as $item )
181
+		foreach ($result as $item)
182 182
 		{
183
-			$this->assertEquals( $customer->getId(), $item->getParentId() );
184
-			$this->assertInstanceOf( '\Aimeos\MShop\Common\Item\Lists\Iface', $item );
183
+			$this->assertEquals($customer->getId(), $item->getParentId());
184
+			$this->assertInstanceOf('\Aimeos\MShop\Common\Item\Lists\Iface', $item);
185 185
 		}
186 186
 	}
187 187
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Customer/Standard.php 1 patch
Spacing   +103 added lines, -103 removed lines patch added patch discarded remove patch
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
29 29
 	 * @since 2017.04
30 30
 	 */
31
-	public function addItem( array $values )
31
+	public function addItem(array $values)
32 32
 	{
33
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
33
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
34 34
 
35 35
 		$item = $manager->createItem();
36
-		$item->fromArray( $values );
37
-		$item->setId( null );
38
-		$manager->saveItem( $item );
36
+		$item->fromArray($values);
37
+		$item->setId(null);
38
+		$manager->saveItem($item);
39 39
 
40 40
 		return $item;
41 41
 	}
@@ -46,14 +46,14 @@  discard block
 block discarded – undo
46 46
 	 *
47 47
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
48 48
 	 */
49
-	public function createItem( array $values = [] )
49
+	public function createItem(array $values = [])
50 50
 	{
51
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
51
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
52 52
 
53 53
 		$item = $manager->createItem();
54
-		$item->fromArray( $values );
55
-		$item->setId( null );
56
-		$item->setStatus( 1 );
54
+		$item->fromArray($values);
55
+		$item->setId(null);
56
+		$item->setStatus(1);
57 57
 
58 58
 		return $item;
59 59
 	}
@@ -65,12 +65,12 @@  discard block
 block discarded – undo
65 65
 	 * @param string $id Unique customer ID
66 66
 	 * @since 2017.04
67 67
 	 */
68
-	public function deleteItem( $id )
68
+	public function deleteItem($id)
69 69
 	{
70
-		$this->checkUser( $id );
70
+		$this->checkUser($id);
71 71
 
72
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
73
-		$manager->deleteItem( $id );
72
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
73
+		$manager->deleteItem($id);
74 74
 	}
75 75
 
76 76
 
@@ -82,16 +82,16 @@  discard block
 block discarded – undo
82 82
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
83 83
 	 * @since 2017.04
84 84
 	 */
85
-	public function editItem( $id, array $values )
85
+	public function editItem($id, array $values)
86 86
 	{
87
-		$this->checkUser( $id );
87
+		$this->checkUser($id);
88 88
 
89
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
89
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
90 90
 
91
-		$item = $manager->getItem( $id, [], true );
92
-		$item->fromArray( $values );
93
-		$item->setId( $id );
94
-		$manager->saveItem( $item );
91
+		$item = $manager->getItem($id, [], true);
92
+		$item->fromArray($values);
93
+		$item->setId($id);
94
+		$manager->saveItem($item);
95 95
 
96 96
 		return $item;
97 97
 	}
@@ -105,17 +105,17 @@  discard block
 block discarded – undo
105 105
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
106 106
 	 * @since 2017.04
107 107
 	 */
108
-	public function getItem( $id = null, array $domains = [] )
108
+	public function getItem($id = null, array $domains = [])
109 109
 	{
110
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' );
110
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer');
111 111
 
112
-		if( $id == null ) {
113
-			return $manager->getItem( $this->getContext()->getUserId(), $domains, true );
112
+		if ($id == null) {
113
+			return $manager->getItem($this->getContext()->getUserId(), $domains, true);
114 114
 		}
115 115
 
116
-		$this->checkUser( $id );
116
+		$this->checkUser($id);
117 117
 
118
-		return $manager->getItem( $id, $domains, true );
118
+		return $manager->getItem($id, $domains, true);
119 119
 	}
120 120
 
121 121
 
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
130 130
 	 * @since 2017.04
131 131
 	 */
132
-	public function findItem( $code, array $domains = [] )
132
+	public function findItem($code, array $domains = [])
133 133
 	{
134
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' )->findItem( $code, $domains );
134
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer')->findItem($code, $domains);
135 135
 	}
136 136
 
137 137
 
@@ -140,9 +140,9 @@  discard block
 block discarded – undo
140 140
 	 *
141 141
 	 * @param \Aimeos\MShop\Customer\Item\Iface Customer item
142 142
 	 */
143
-	public function saveItem( \Aimeos\MShop\Customer\Item\Iface $item )
143
+	public function saveItem(\Aimeos\MShop\Customer\Item\Iface $item)
144 144
 	{
145
-		\Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer' )->saveItem( $item );
145
+		\Aimeos\MShop\Factory::createManager($this->getContext(), 'customer')->saveItem($item);
146 146
 	}
147 147
 
148 148
 
@@ -153,17 +153,17 @@  discard block
 block discarded – undo
153 153
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
154 154
 	 * @since 2017.04
155 155
 	 */
156
-	public function addAddressItem( array $values )
156
+	public function addAddressItem(array $values)
157 157
 	{
158 158
 		$context = $this->getContext();
159
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/address' );
159
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/address');
160 160
 
161 161
 		$item = $manager->createItem();
162
-		$item->fromArray( $values );
163
-		$item->setId( null );
164
-		$item->setParentId( $context->getUserId() );
162
+		$item->fromArray($values);
163
+		$item->setId(null);
164
+		$item->setParentId($context->getUserId());
165 165
 
166
-		$manager->saveItem( $item );
166
+		$manager->saveItem($item);
167 167
 
168 168
 		return $item;
169 169
 	}
@@ -174,16 +174,16 @@  discard block
 block discarded – undo
174 174
 	 *
175 175
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
176 176
 	 */
177
-	public function createAddressItem( array $values = [] )
177
+	public function createAddressItem(array $values = [])
178 178
 	{
179 179
 		$context = $this->getContext();
180
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/address' );
180
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/address');
181 181
 
182 182
 		$item = $manager->createItem();
183
-		$item->fromArray( $values );
184
-		$item->setId( null );
183
+		$item->fromArray($values);
184
+		$item->setId(null);
185 185
 
186
-		$item->setParentId( $context->getUserId() );
186
+		$item->setParentId($context->getUserId());
187 187
 
188 188
 		return $item;
189 189
 	}
@@ -195,13 +195,13 @@  discard block
 block discarded – undo
195 195
 	 * @param string $id Unique customer address ID
196 196
 	 * @since 2017.04
197 197
 	 */
198
-	public function deleteAddressItem( $id )
198
+	public function deleteAddressItem($id)
199 199
 	{
200
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' );
200
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address');
201 201
 
202
-		$this->checkUser( $manager->getItem( $id, [], true )->getParentId() );
202
+		$this->checkUser($manager->getItem($id, [], true)->getParentId());
203 203
 
204
-		$manager->deleteItem( $id );
204
+		$manager->deleteItem($id);
205 205
 	}
206 206
 
207 207
 
@@ -213,17 +213,17 @@  discard block
 block discarded – undo
213 213
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
214 214
 	 * @since 2017.04
215 215
 	 */
216
-	public function editAddressItem( $id, array $values )
216
+	public function editAddressItem($id, array $values)
217 217
 	{
218
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' );
218
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address');
219 219
 
220
-		$item = $manager->getItem( $id, [], true );
221
-		$this->checkUser( $item->getParentId() );
220
+		$item = $manager->getItem($id, [], true);
221
+		$this->checkUser($item->getParentId());
222 222
 
223
-		$item->fromArray( $values );
224
-		$item->setId( $id );
223
+		$item->fromArray($values);
224
+		$item->setId($id);
225 225
 
226
-		$manager->saveItem( $item );
226
+		$manager->saveItem($item);
227 227
 
228 228
 		return $item;
229 229
 	}
@@ -236,12 +236,12 @@  discard block
 block discarded – undo
236 236
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
237 237
 	 * @since 2017.04
238 238
 	 */
239
-	public function getAddressItem( $id )
239
+	public function getAddressItem($id)
240 240
 	{
241
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' );
241
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address');
242 242
 
243
-		$item = $manager->getItem( $id );
244
-		$this->checkUser( $item->getParentId() );
243
+		$item = $manager->getItem($id);
244
+		$this->checkUser($item->getParentId());
245 245
 
246 246
 		return $item;
247 247
 	}
@@ -252,9 +252,9 @@  discard block
 block discarded – undo
252 252
 	 *
253 253
 	 * @param \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
254 254
 	 */
255
-	public function saveAddressItem( \Aimeos\MShop\Customer\Item\Address\Iface $item )
255
+	public function saveAddressItem(\Aimeos\MShop\Customer\Item\Address\Iface $item)
256 256
 	{
257
-		\Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/address' )->saveItem( $item );
257
+		\Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/address')->saveItem($item);
258 258
 	}
259 259
 
260 260
 
@@ -265,32 +265,32 @@  discard block
 block discarded – undo
265 265
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
266 266
 	 * @since 2017.06
267 267
 	 */
268
-	public function addListItem( array $values )
268
+	public function addListItem(array $values)
269 269
 	{
270 270
 		$context = $this->getContext();
271
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
271
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
272 272
 
273
-		if( !isset( $values['customer.lists.typeid'] ) )
273
+		if (!isset($values['customer.lists.typeid']))
274 274
 		{
275
-			if( !isset( $values['customer.lists.type'] ) ) {
276
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists type code' ) );
275
+			if (!isset($values['customer.lists.type'])) {
276
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists type code'));
277 277
 			}
278 278
 
279
-			if( !isset( $values['customer.lists.domain'] ) ) {
280
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists domain' ) );
279
+			if (!isset($values['customer.lists.domain'])) {
280
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists domain'));
281 281
 			}
282 282
 
283
-			$typeManager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists/type' );
284
-			$typeItem = $typeManager->findItem( $values['customer.lists.type'], [], $values['customer.lists.domain'] );
283
+			$typeManager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists/type');
284
+			$typeItem = $typeManager->findItem($values['customer.lists.type'], [], $values['customer.lists.domain']);
285 285
 			$values['customer.lists.typeid'] = $typeItem->getId();
286 286
 		}
287 287
 
288 288
 		$item = $manager->createItem();
289
-		$item->fromArray( $values );
290
-		$item->setId( null );
291
-		$item->setParentId( $context->getUserId() );
289
+		$item->fromArray($values);
290
+		$item->setId(null);
291
+		$item->setParentId($context->getUserId());
292 292
 
293
-		$manager->saveItem( $item );
293
+		$manager->saveItem($item);
294 294
 
295 295
 		return $item;
296 296
 	}
@@ -305,10 +305,10 @@  discard block
 block discarded – undo
305 305
 	public function createListsFilter()
306 306
 	{
307 307
 		$context = $this->getContext();
308
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
308
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
309 309
 
310 310
 		$filter = $manager->createSearch();
311
-		$filter->setConditions( $filter->compare( '==', 'customer.lists.parentid', $context->getUserId() ) );
311
+		$filter->setConditions($filter->compare('==', 'customer.lists.parentid', $context->getUserId()));
312 312
 
313 313
 		return $filter;
314 314
 	}
@@ -320,13 +320,13 @@  discard block
 block discarded – undo
320 320
 	 * @param string $id Unique customer address ID
321 321
 	 * @since 2017.06
322 322
 	 */
323
-	public function deleteListItem( $id )
323
+	public function deleteListItem($id)
324 324
 	{
325
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' );
325
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists');
326 326
 
327
-		$this->checkUser( $manager->getItem( $id )->getParentId() );
327
+		$this->checkUser($manager->getItem($id)->getParentId());
328 328
 
329
-		$manager->deleteItem( $id );
329
+		$manager->deleteItem($id);
330 330
 	}
331 331
 
332 332
 
@@ -338,33 +338,33 @@  discard block
 block discarded – undo
338 338
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
339 339
 	 * @since 2017.06
340 340
 	 */
341
-	public function editListItem( $id, array $values )
341
+	public function editListItem($id, array $values)
342 342
 	{
343 343
 		$context = $this->getContext();
344
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists' );
344
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists');
345 345
 
346
-		$item = $manager->getItem( $id, [], true );
347
-		$this->checkUser( $item->getParentId() );
346
+		$item = $manager->getItem($id, [], true);
347
+		$this->checkUser($item->getParentId());
348 348
 
349
-		if( !isset( $values['customer.lists.typeid'] ) )
349
+		if (!isset($values['customer.lists.typeid']))
350 350
 		{
351
-			if( !isset( $values['customer.lists.type'] ) ) {
352
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists type code' ) );
351
+			if (!isset($values['customer.lists.type'])) {
352
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists type code'));
353 353
 			}
354 354
 
355
-			if( !isset( $values['customer.lists.domain'] ) ) {
356
-				throw new \Aimeos\Controller\Frontend\Customer\Exception( sprintf( 'No customer lists domain' ) );
355
+			if (!isset($values['customer.lists.domain'])) {
356
+				throw new \Aimeos\Controller\Frontend\Customer\Exception(sprintf('No customer lists domain'));
357 357
 			}
358 358
 
359
-			$typeManager = \Aimeos\MShop\Factory::createManager( $context, 'customer/lists/type' );
360
-			$typeItem = $typeManager->findItem( $values['customer.lists.type'], [], $values['customer.lists.domain'] );
359
+			$typeManager = \Aimeos\MShop\Factory::createManager($context, 'customer/lists/type');
360
+			$typeItem = $typeManager->findItem($values['customer.lists.type'], [], $values['customer.lists.domain']);
361 361
 			$values['customer.lists.typeid'] = $typeItem->getId();
362 362
 		}
363 363
 
364
-		$item->fromArray( $values );
365
-		$item->setId( $id );
364
+		$item->fromArray($values);
365
+		$item->setId($id);
366 366
 
367
-		$manager->saveItem( $item );
367
+		$manager->saveItem($item);
368 368
 
369 369
 		return $item;
370 370
 	}
@@ -377,12 +377,12 @@  discard block
 block discarded – undo
377 377
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
378 378
 	 * @since 2017.06
379 379
 	 */
380
-	public function getListItem( $id )
380
+	public function getListItem($id)
381 381
 	{
382
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' );
383
-		$item = $manager->getItem( $id );
382
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists');
383
+		$item = $manager->getItem($id);
384 384
 
385
-		$this->checkUser( $item->getParentId() );
385
+		$this->checkUser($item->getParentId());
386 386
 
387 387
 		return $item;
388 388
 	}
@@ -396,11 +396,11 @@  discard block
 block discarded – undo
396 396
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface[] Customer list items
397 397
 	 * @since 2017.06
398 398
 	 */
399
-	public function searchListItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null )
399
+	public function searchListItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null)
400 400
 	{
401
-		$manager = \Aimeos\MShop\Factory::createManager( $this->getContext(), 'customer/lists' );
401
+		$manager = \Aimeos\MShop\Factory::createManager($this->getContext(), 'customer/lists');
402 402
 
403
-		return $manager->searchItems( $filter, [], $total );
403
+		return $manager->searchItems($filter, [], $total);
404 404
 	}
405 405
 
406 406
 
@@ -410,12 +410,12 @@  discard block
 block discarded – undo
410 410
 	 * @param string $id Unique customer ID
411 411
 	 * @throws \Aimeos\Controller\Frontend\Customer\Exception If access isn't allowed
412 412
 	 */
413
-	protected function checkUser( $id )
413
+	protected function checkUser($id)
414 414
 	{
415
-		if( $id != $this->getContext()->getUserId() )
415
+		if ($id != $this->getContext()->getUserId())
416 416
 		{
417
-			$msg = sprintf( 'Not allowed to access customer data for ID "%1$s"', $id );
418
-			throw new \Aimeos\Controller\Frontend\Customer\Exception( $msg );
417
+			$msg = sprintf('Not allowed to access customer data for ID "%1$s"', $id);
418
+			throw new \Aimeos\Controller\Frontend\Customer\Exception($msg);
419 419
 		}
420 420
 	}
421 421
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Customer/Iface.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
27 27
 	 * @since 2017.04
28 28
 	 */
29
-	public function addItem( array $values );
29
+	public function addItem(array $values);
30 30
 
31 31
 
32 32
 	/**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
36 36
 	 * @since 2017.04
37 37
 	 */
38
-	public function createItem( array $values = [] );
38
+	public function createItem(array $values = []);
39 39
 
40 40
 
41 41
 	/**
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	 * @param string $id Unique customer ID
45 45
 	 * @since 2017.04
46 46
 	 */
47
-	public function deleteItem( $id );
47
+	public function deleteItem($id);
48 48
 
49 49
 
50 50
 	/**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item
56 56
 	 * @since 2017.04
57 57
 	 */
58
-	public function editItem( $id, array $values );
58
+	public function editItem($id, array $values);
59 59
 
60 60
 
61 61
 	/**
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
67 67
 	 * @since 2017.04
68 68
 	 */
69
-	public function getItem( $id = null, array $domains = [] );
69
+	public function getItem($id = null, array $domains = []);
70 70
 
71 71
 
72 72
 	/**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer item including the referenced domains items
80 80
 	 * @since 2017.04
81 81
 	 */
82
-	public function findItem( $code, array $domains = [] );
82
+	public function findItem($code, array $domains = []);
83 83
 
84 84
 
85 85
 	/**
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 	 * @param \Aimeos\MShop\Customer\Item\Iface Customer item
89 89
 	 * @since 2017.04
90 90
 	 */
91
-	public function saveItem( \Aimeos\MShop\Customer\Item\Iface $item );
91
+	public function saveItem(\Aimeos\MShop\Customer\Item\Iface $item);
92 92
 
93 93
 
94 94
 	/**
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer address item
99 99
 	 * @since 2017.04
100 100
 	 */
101
-	public function addAddressItem( array $values );
101
+	public function addAddressItem(array $values);
102 102
 
103 103
 
104 104
 	/**
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
108 108
 	 * @since 2017.04
109 109
 	 */
110
-	public function createAddressItem( array $values = [] );
110
+	public function createAddressItem(array $values = []);
111 111
 
112 112
 
113 113
 	/**
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 	 * @param string $id Unique customer address ID
117 117
 	 * @since 2017.04
118 118
 	 */
119
-	public function deleteAddressItem( $id );
119
+	public function deleteAddressItem($id);
120 120
 
121 121
 
122 122
 	/**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 	 * @return \Aimeos\MShop\Customer\Item\Iface Customer address item
128 128
 	 * @since 2017.04
129 129
 	 */
130
-	public function editAddressItem( $id, array $values );
130
+	public function editAddressItem($id, array $values);
131 131
 
132 132
 
133 133
 	/**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
138 138
 	 * @since 2017.04
139 139
 	 */
140
-	public function getAddressItem( $id );
140
+	public function getAddressItem($id);
141 141
 
142 142
 
143 143
 	/**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 	 * @param \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
147 147
 	 * @since 2017.04
148 148
 	 */
149
-	public function saveAddressItem( \Aimeos\MShop\Customer\Item\Address\Iface $item );
149
+	public function saveAddressItem(\Aimeos\MShop\Customer\Item\Address\Iface $item);
150 150
 
151 151
 	/**
152 152
 	 * Creates and returns a new list item object
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
156 156
 	 * @since 2017.06
157 157
 	 */
158
-	public function addListItem( array $values );
158
+	public function addListItem(array $values);
159 159
 
160 160
 	/**
161 161
 	 * Returns a new customer lists filter criteria object
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 * @param string $id Unique customer address ID
172 172
 	 * @since 2017.06
173 173
 	 */
174
-	public function deleteListItem( $id );
174
+	public function deleteListItem($id);
175 175
 
176 176
 	/**
177 177
 	 * Saves a modified customer lists item object
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface Customer lists item
182 182
 	 * @since 2017.06
183 183
 	 */
184
-	public function editListItem( $id, array $values );
184
+	public function editListItem($id, array $values);
185 185
 
186 186
 	/**
187 187
 	 * Returns the customer item for the given customer ID
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 * @return \Aimeos\MShop\Customer\Item\Address\Iface Customer address item
191 191
 	 * @since 2017.06
192 192
 	 */
193
-	public function getListItem( $id );
193
+	public function getListItem($id);
194 194
 
195 195
 	/**
196 196
 	 * Returns the customer lists items filtered by the given criteria
@@ -200,5 +200,5 @@  discard block
 block discarded – undo
200 200
 	 * @return \Aimeos\MShop\Common\Item\Lists\Iface[] Customer list items
201 201
 	 * @since 2017.06
202 202
 	 */
203
-	public function searchListItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null );
203
+	public function searchListItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null);
204 204
 }
Please login to merge, or discard this patch.
controller/frontend/src/Controller/Frontend/Order/Standard.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
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 34
 		$total = 0;
35 35
 		$context = $this->getContext();
36
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
36
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'order');
37 37
 
38 38
 		/** controller/frontend/order/limit-seconds
39 39
 		 * Order limitation time frame in seconds
@@ -51,24 +51,24 @@  discard block
 block discarded – undo
51 51
 		 * @see controller/frontend/basket/limit-count
52 52
 		 * @see controller/frontend/basket/limit-seconds
53 53
 		 */
54
-		$seconds = $context->getConfig()->get( 'controller/frontend/order/limit-seconds', 300 );
54
+		$seconds = $context->getConfig()->get('controller/frontend/order/limit-seconds', 300);
55 55
 
56 56
 		$search = $manager->createSearch();
57 57
 		$expr = [
58
-			$search->compare( '==', 'order.baseid', $baseId ),
59
-			$search->compare( '>=', 'order.ctime', date( 'Y-m-d H:i:s', time() - $seconds ) ),
58
+			$search->compare('==', 'order.baseid', $baseId),
59
+			$search->compare('>=', 'order.ctime', date('Y-m-d H:i:s', time() - $seconds)),
60 60
 		];
61
-		$search->setConditions( $search->combine( '&&', $expr ) );
62
-		$search->setSlice( 0, 0 );
61
+		$search->setConditions($search->combine('&&', $expr));
62
+		$search->setSlice(0, 0);
63 63
 
64
-		$manager->searchItems( $search, [], $total );
64
+		$manager->searchItems($search, [], $total);
65 65
 
66
-		if( $total > 0 ) {
67
-			throw new \Aimeos\Controller\Frontend\Order\Exception( sprintf( 'The order has already been created' ) );
66
+		if ($total > 0) {
67
+			throw new \Aimeos\Controller\Frontend\Order\Exception(sprintf('The order has already been created'));
68 68
 		}
69 69
 
70
-		$item = $manager->createItem()->setBaseId( $baseId )->setType( $type );
71
-		$manager->saveItem( $item );
70
+		$item = $manager->createItem()->setBaseId($baseId)->setType($type);
71
+		$manager->saveItem($item);
72 72
 
73 73
 		return $item;
74 74
 	}
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 	 */
82 82
 	public function createFilter()
83 83
 	{
84
-		return \Aimeos\MShop\Factory::createManager( $this->getContext(), 'order' )->createSearch( true );
84
+		return \Aimeos\MShop\Factory::createManager($this->getContext(), 'order')->createSearch(true);
85 85
 	}
86 86
 
87 87
 
@@ -91,26 +91,26 @@  discard block
 block discarded – undo
91 91
 	 * @param string $id Unique order ID
92 92
 	 * @return \Aimeos\MShop\Order\Item\Iface Order object
93 93
 	 */
94
-	public function getItem( $id )
94
+	public function getItem($id)
95 95
 	{
96 96
 		$context = $this->getContext();
97
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
97
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'order');
98 98
 
99
-		$search = $manager->createSearch( true );
99
+		$search = $manager->createSearch(true);
100 100
 		$expr = [
101
-			$search->compare( '==', 'order.id', $id ),
102
-			$search->compare( '==', 'order.editor', $context->getEditor() ),
101
+			$search->compare('==', 'order.id', $id),
102
+			$search->compare('==', 'order.editor', $context->getEditor()),
103 103
 			$search->getConditions(),
104 104
 		];
105
-		$search->setConditions( $search->combine( '&&', $expr ) );
105
+		$search->setConditions($search->combine('&&', $expr));
106 106
 
107
-		$items = $manager->searchItems( $search );
107
+		$items = $manager->searchItems($search);
108 108
 
109
-		if( ( $item = reset( $items ) ) !== false ) {
109
+		if (($item = reset($items)) !== false) {
110 110
 			return $item;
111 111
 		}
112 112
 
113
-		throw new \Aimeos\Controller\Frontend\Order\Exception( sprintf( 'No order item for ID "%1$s" found', $id ) );
113
+		throw new \Aimeos\Controller\Frontend\Order\Exception(sprintf('No order item for ID "%1$s" found', $id));
114 114
 	}
115 115
 
116 116
 
@@ -121,18 +121,18 @@  discard block
 block discarded – undo
121 121
 	 * @param integer|null &$total Variable that will contain the total number of available items
122 122
 	 * @return \Aimeos\MShop\Order\Item\Iface[] Associative list of IDs as keys and order objects as values
123 123
 	 */
124
-	public function searchItems( \Aimeos\MW\Criteria\Iface $filter, &$total = null )
124
+	public function searchItems(\Aimeos\MW\Criteria\Iface $filter, &$total = null)
125 125
 	{
126 126
 		$context = $this->getContext();
127
-		$manager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
127
+		$manager = \Aimeos\MShop\Factory::createManager($context, 'order');
128 128
 
129 129
 		$expr = [
130 130
 			$filter->getConditions(),
131
-			$filter->compare( '==', 'order.base.customerid', $context->getUserId() ),
131
+			$filter->compare('==', 'order.base.customerid', $context->getUserId()),
132 132
 		];
133
-		$filter->setConditions( $filter->combine( '&&', $expr ) );
133
+		$filter->setConditions($filter->combine('&&', $expr));
134 134
 
135
-		return $manager->searchItems( $filter, [], $total );
135
+		return $manager->searchItems($filter, [], $total);
136 136
 	}
137 137
 
138 138
 
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
 	 *
155 155
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
156 156
 	 */
157
-	public function block( \Aimeos\MShop\Order\Item\Iface $orderItem )
157
+	public function block(\Aimeos\MShop\Order\Item\Iface $orderItem)
158 158
 	{
159
-		\Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->block( $orderItem );
159
+		\Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->block($orderItem);
160 160
 	}
161 161
 
162 162
 
@@ -178,9 +178,9 @@  discard block
 block discarded – undo
178 178
 	 *
179 179
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
180 180
 	 */
181
-	public function unblock( \Aimeos\MShop\Order\Item\Iface $orderItem )
181
+	public function unblock(\Aimeos\MShop\Order\Item\Iface $orderItem)
182 182
 	{
183
-		\Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->unblock( $orderItem );
183
+		\Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->unblock($orderItem);
184 184
 	}
185 185
 
186 186
 
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
 	 *
199 199
 	 * @param \Aimeos\MShop\Order\Item\Iface $orderItem Order item object
200 200
 	 */
201
-	public function update( \Aimeos\MShop\Order\Item\Iface $orderItem )
201
+	public function update(\Aimeos\MShop\Order\Item\Iface $orderItem)
202 202
 	{
203
-		\Aimeos\Controller\Common\Order\Factory::createController( $this->getContext() )->update( $orderItem );
203
+		\Aimeos\Controller\Common\Order\Factory::createController($this->getContext())->update($orderItem);
204 204
 	}
205 205
 
206 206
 
@@ -215,22 +215,22 @@  discard block
 block discarded – undo
215 215
 	 * @return \Aimeos\MShop\Order\Item\Iface Order item that belongs to the stored basket
216 216
 	 * @deprecated 2017.04 Use store() from basket controller instead
217 217
 	 */
218
-	public function store( \Aimeos\MShop\Order\Item\Base\Iface $basket )
218
+	public function store(\Aimeos\MShop\Order\Item\Base\Iface $basket)
219 219
 	{
220 220
 		$context = $this->getContext();
221 221
 
222
-		$orderManager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
223
-		$orderBaseManager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' );
222
+		$orderManager = \Aimeos\MShop\Factory::createManager($context, 'order');
223
+		$orderBaseManager = \Aimeos\MShop\Factory::createManager($context, 'order/base');
224 224
 
225 225
 
226 226
 		$orderBaseManager->begin();
227
-		$orderBaseManager->store( $basket );
227
+		$orderBaseManager->store($basket);
228 228
 		$orderBaseManager->commit();
229 229
 
230 230
 		$orderItem = $orderManager->createItem();
231
-		$orderItem->setBaseId( $basket->getId() );
232
-		$orderItem->setType( \Aimeos\MShop\Order\Item\Base::TYPE_WEB );
233
-		$orderManager->saveItem( $orderItem );
231
+		$orderItem->setBaseId($basket->getId());
232
+		$orderItem->setType(\Aimeos\MShop\Order\Item\Base::TYPE_WEB);
233
+		$orderManager->saveItem($orderItem);
234 234
 
235 235
 
236 236
 		return $orderItem;
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Order/StandardTest.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -18,183 +18,183 @@
 block discarded – undo
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 testAddItemLimit()
53 53
 	{
54
-		$this->context->getConfig()->set( 'controller/frontend/order/limit-seconds', 86400 * 365 );
54
+		$this->context->getConfig()->set('controller/frontend/order/limit-seconds', 86400 * 365);
55 55
 
56
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' );
57
-		$result = $manager->searchItems( $manager->createSearch()->setSlice( 0, 1 ) );
56
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base');
57
+		$result = $manager->searchItems($manager->createSearch()->setSlice(0, 1));
58 58
 
59
-		if( ( $item = reset( $result ) ) === false ) {
60
-			throw new \RuntimeException( 'No order item found' );
59
+		if (($item = reset($result)) === false) {
60
+			throw new \RuntimeException('No order item found');
61 61
 		}
62 62
 
63
-		$this->setExpectedException( '\Aimeos\Controller\Frontend\Order\Exception' );
64
-		$this->object->addItem( $item->getId(), 'test' );
63
+		$this->setExpectedException('\Aimeos\Controller\Frontend\Order\Exception');
64
+		$this->object->addItem($item->getId(), 'test');
65 65
 	}
66 66
 
67 67
 
68 68
 	public function testCreateFilter()
69 69
 	{
70
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() );
70
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter());
71 71
 	}
72 72
 
73 73
 
74 74
 	public function testGetItem()
75 75
 	{
76
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'customer' );
77
-		$customerItem = $manager->findItem( 'UTC001' );
76
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'customer');
77
+		$customerItem = $manager->findItem('UTC001');
78 78
 
79
-		$this->context->setEditor( 'core:unittest' );
79
+		$this->context->setEditor('core:unittest');
80 80
 
81
-		$manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order' );
82
-		$search = $manager->createSearch()->setSlice( 0, 1 );
83
-		$search->setConditions( $search->compare( '==', 'order.base.customerid', $customerItem->getId() ) );
84
-		$result = $manager->searchItems( $search );
81
+		$manager = \Aimeos\MShop\Factory::createManager($this->context, 'order');
82
+		$search = $manager->createSearch()->setSlice(0, 1);
83
+		$search->setConditions($search->compare('==', 'order.base.customerid', $customerItem->getId()));
84
+		$result = $manager->searchItems($search);
85 85
 
86
-		if( ( $item = reset( $result ) ) === false ) {
87
-			throw new \RuntimeException( 'No order item found' );
86
+		if (($item = reset($result)) === false) {
87
+			throw new \RuntimeException('No order item found');
88 88
 		}
89 89
 
90
-		$this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Iface', $this->object->getItem( $item->getId() ) );
90
+		$this->assertInstanceOf('\Aimeos\MShop\Order\Item\Iface', $this->object->getItem($item->getId()));
91 91
 	}
92 92
 
93 93
 
94 94
 	public function testGetItemException()
95 95
 	{
96
-		$this->setExpectedException( '\Aimeos\Controller\Frontend\Order\Exception' );
96
+		$this->setExpectedException('\Aimeos\Controller\Frontend\Order\Exception');
97 97
 		$this->object->getItem( -1 );
98 98
 	}
99 99
 
100 100
 
101 101
 	public function testSearchItems()
102 102
 	{
103
-		$this->assertGreaterThan( 1, $this->object->searchItems( $this->object->createFilter() ) );
103
+		$this->assertGreaterThan(1, $this->object->searchItems($this->object->createFilter()));
104 104
 	}
105 105
 
106 106
 
107 107
 	public function testStore()
108 108
 	{
109 109
 		$name = 'ControllerFrontendOrderStore';
110
-		$this->context->getConfig()->set( 'mshop/order/manager/name', $name );
110
+		$this->context->getConfig()->set('mshop/order/manager/name', $name);
111 111
 
112 112
 
113
-		$orderManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' )
114
-			->setMethods( array( 'saveItem', 'getSubManager' ) )
115
-			->setConstructorArgs( array( $this->context ) )
113
+		$orderManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard')
114
+			->setMethods(array('saveItem', 'getSubManager'))
115
+			->setConstructorArgs(array($this->context))
116 116
 			->getMock();
117 117
 
118
-		$orderBaseManagerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' )
119
-			->setMethods( array( 'store' ) )
120
-			->setConstructorArgs( array( $this->context ) )
118
+		$orderBaseManagerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard')
119
+			->setMethods(array('store'))
120
+			->setConstructorArgs(array($this->context))
121 121
 			->getMock();
122 122
 
123
-		\Aimeos\MShop\Order\Manager\Factory::injectManager( '\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub );
123
+		\Aimeos\MShop\Order\Manager\Factory::injectManager('\\Aimeos\\MShop\\Order\\Manager\\' . $name, $orderManagerStub);
124 124
 
125 125
 
126 126
 		$orderBaseItem = $orderBaseManagerStub->createItem();
127
-		$orderBaseItem->setId( 1 );
127
+		$orderBaseItem->setId(1);
128 128
 
129 129
 
130
-		$orderBaseManagerStub->expects( $this->once() )->method( 'store' );
130
+		$orderBaseManagerStub->expects($this->once())->method('store');
131 131
 
132
-		$orderManagerStub->expects( $this->once() )->method( 'getSubManager' )
133
-			->will( $this->returnValue( $orderBaseManagerStub ) );
132
+		$orderManagerStub->expects($this->once())->method('getSubManager')
133
+			->will($this->returnValue($orderBaseManagerStub));
134 134
 
135
-		$orderManagerStub->expects( $this->once() )->method( 'saveItem' );
135
+		$orderManagerStub->expects($this->once())->method('saveItem');
136 136
 
137 137
 
138
-		$this->object->store( $orderBaseItem );
138
+		$this->object->store($orderBaseItem);
139 139
 	}
140 140
 
141 141
 
142 142
 	public function testBlock()
143 143
 	{
144 144
 		$name = 'ControllerFrontendOrderBlock';
145
-		$this->context->getConfig()->set( 'controller/common/order/name', $name );
145
+		$this->context->getConfig()->set('controller/common/order/name', $name);
146 146
 
147 147
 
148
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
149
-			->setMethods( array( 'block' ) )
150
-			->setConstructorArgs( array( $this->context ) )
148
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
149
+			->setMethods(array('block'))
150
+			->setConstructorArgs(array($this->context))
151 151
 			->getMock();
152 152
 
153
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
153
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
154 154
 
155
-		$orderCntlStub->expects( $this->once() )->method( 'block' );
155
+		$orderCntlStub->expects($this->once())->method('block');
156 156
 
157 157
 
158
-		$this->object->block( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() );
158
+		$this->object->block(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem());
159 159
 	}
160 160
 
161 161
 
162 162
 	public function testUnblock()
163 163
 	{
164 164
 		$name = 'ControllerFrontendOrderUnblock';
165
-		$this->context->getConfig()->set( 'controller/common/order/name', $name );
165
+		$this->context->getConfig()->set('controller/common/order/name', $name);
166 166
 
167 167
 
168
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
169
-			->setMethods( array( 'unblock' ) )
170
-			->setConstructorArgs( array( $this->context ) )
168
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
169
+			->setMethods(array('unblock'))
170
+			->setConstructorArgs(array($this->context))
171 171
 			->getMock();
172 172
 
173
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
173
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
174 174
 
175
-		$orderCntlStub->expects( $this->once() )->method( 'unblock' );
175
+		$orderCntlStub->expects($this->once())->method('unblock');
176 176
 
177 177
 
178
-		$this->object->unblock( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() );
178
+		$this->object->unblock(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem());
179 179
 	}
180 180
 
181 181
 
182 182
 	public function testUpdate()
183 183
 	{
184 184
 		$name = 'ControllerFrontendOrderUpdate';
185
-		$this->context->getConfig()->set( 'controller/common/order/name', $name );
185
+		$this->context->getConfig()->set('controller/common/order/name', $name);
186 186
 
187 187
 
188
-		$orderCntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Order\\Standard' )
189
-			->setMethods( array( 'update' ) )
190
-			->setConstructorArgs( array( $this->context ) )
188
+		$orderCntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Order\\Standard')
189
+			->setMethods(array('update'))
190
+			->setConstructorArgs(array($this->context))
191 191
 			->getMock();
192 192
 
193
-		\Aimeos\Controller\Common\Order\Factory::injectController( '\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub );
193
+		\Aimeos\Controller\Common\Order\Factory::injectController('\\Aimeos\\Controller\\Common\\Order\\' . $name, $orderCntlStub);
194 194
 
195
-		$orderCntlStub->expects( $this->once() )->method( 'update' );
195
+		$orderCntlStub->expects($this->once())->method('update');
196 196
 
197 197
 
198
-		$this->object->update( \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem() );
198
+		$this->object->update(\Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem());
199 199
 	}
200 200
 }
Please login to merge, or discard this patch.