|
@@ -21,46 +21,46 @@ discard block |
|
|
block discarded – undo |
21
|
21
|
|
22
|
22
|
protected function tearDown() |
23
|
23
|
{ |
24
|
|
- $this->context->getSession()->set( 'aimeos', array() ); |
|
24
|
+ $this->context->getSession()->set('aimeos', array()); |
25
|
25
|
|
26
|
|
- unset( $this->context ); |
|
26
|
+ unset($this->context); |
27
|
27
|
} |
28
|
28
|
|
29
|
29
|
|
30
|
30
|
public function testCheckLocale() |
31
|
31
|
{ |
32
|
|
- $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Standard' ) |
33
|
|
- ->setConstructorArgs( [$this->context] ) |
|
32
|
+ $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Basket\Standard') |
|
33
|
+ ->setConstructorArgs([$this->context]) |
34
|
34
|
->setMethods() |
35
|
35
|
->getMock(); |
36
|
36
|
|
37
|
|
- $this->context->getSession()->set( 'aimeos/basket/locale', 'unittest|en|EUR' ); |
38
|
|
- $this->access( 'checkLocale' )->invokeArgs( $object, ['unittest'] ); |
|
37
|
+ $this->context->getSession()->set('aimeos/basket/locale', 'unittest|en|EUR'); |
|
38
|
+ $this->access('checkLocale')->invokeArgs($object, ['unittest']); |
39
|
39
|
} |
40
|
40
|
|
41
|
41
|
|
42
|
42
|
public function testCopyAddresses() |
43
|
43
|
{ |
44
|
|
- $manager = \Aimeos\MShop\Factory::createManager( \TestHelperFrontend::getContext(), 'order/base' ); |
|
44
|
+ $manager = \Aimeos\MShop\Factory::createManager(\TestHelperFrontend::getContext(), 'order/base'); |
45
|
45
|
$ordBaseItem = $manager->createItem(); |
46
|
46
|
|
47
|
|
- $address = $this->getAddress( 'Example company' ); |
48
|
|
- $ordBaseItem->setAddress( $address, \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT ); |
|
47
|
+ $address = $this->getAddress('Example company'); |
|
48
|
+ $ordBaseItem->setAddress($address, \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT); |
49
|
49
|
|
50
|
50
|
|
51
|
|
- $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Standard' ) |
52
|
|
- ->setConstructorArgs( [$this->context] ) |
|
51
|
+ $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Basket\Standard') |
|
52
|
+ ->setConstructorArgs([$this->context]) |
53
|
53
|
->setMethods() |
54
|
54
|
->getMock(); |
55
|
55
|
|
56
|
|
- $result = $this->access( 'copyAddresses' )->invokeArgs( $object, [$ordBaseItem, ['test'], 'unittest|en|EUR'] ); |
|
56
|
+ $result = $this->access('copyAddresses')->invokeArgs($object, [$ordBaseItem, ['test'], 'unittest|en|EUR']); |
57
|
57
|
|
58
|
58
|
|
59
|
|
- $this->assertEquals( ['test'], $result ); |
60
|
|
- $this->assertEquals( 1, count( $object->get()->getAddresses() ) ); |
|
59
|
+ $this->assertEquals(['test'], $result); |
|
60
|
+ $this->assertEquals(1, count($object->get()->getAddresses())); |
61
|
61
|
|
62
|
|
- $addr = $object->get()->getAddress( \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT ); |
63
|
|
- $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Base\Address\Iface', $addr ); |
|
62
|
+ $addr = $object->get()->getAddress(\Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT); |
|
63
|
+ $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Base\Address\Iface', $addr); |
64
|
64
|
|
65
|
65
|
$object->clear(); |
66
|
66
|
} |
|
@@ -68,54 +68,54 @@ discard block |
|
|
block discarded – undo |
68
|
68
|
|
69
|
69
|
public function testCopyAddressesException() |
70
|
70
|
{ |
71
|
|
- $manager = \Aimeos\MShop\Factory::createManager( \TestHelperFrontend::getContext(), 'order/base' ); |
|
71
|
+ $manager = \Aimeos\MShop\Factory::createManager(\TestHelperFrontend::getContext(), 'order/base'); |
72
|
72
|
$ordBaseItem = $manager->createItem(); |
73
|
73
|
|
74
|
|
- $address = $this->getAddress( 'Example company' ); |
75
|
|
- $ordBaseItem->setAddress( $address, \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT ); |
|
74
|
+ $address = $this->getAddress('Example company'); |
|
75
|
+ $ordBaseItem->setAddress($address, \Aimeos\MShop\Order\Item\Base\Address\Base::TYPE_PAYMENT); |
76
|
76
|
|
77
|
77
|
|
78
|
|
- $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Standard' ) |
79
|
|
- ->setConstructorArgs( [$this->context] ) |
80
|
|
- ->setMethods( ['setAddress'] ) |
|
78
|
+ $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Basket\Standard') |
|
79
|
+ ->setConstructorArgs([$this->context]) |
|
80
|
+ ->setMethods(['setAddress']) |
81
|
81
|
->getMock(); |
82
|
82
|
|
83
|
|
- $object->expects( $this->once() )->method( 'setAddress' )->will( $this->throwException( new \Exception() ) ); |
|
83
|
+ $object->expects($this->once())->method('setAddress')->will($this->throwException(new \Exception())); |
84
|
84
|
|
85
|
|
- $result = $this->access( 'copyAddresses' )->invokeArgs( $object, [$ordBaseItem, [], 'unittest|en|EUR'] ); |
|
85
|
+ $result = $this->access('copyAddresses')->invokeArgs($object, [$ordBaseItem, [], 'unittest|en|EUR']); |
86
|
86
|
|
87
|
|
- $this->assertEquals( 1, count( $result ) ); |
88
|
|
- $this->assertArrayHasKey( 'address', $result ); |
|
87
|
+ $this->assertEquals(1, count($result)); |
|
88
|
+ $this->assertArrayHasKey('address', $result); |
89
|
89
|
} |
90
|
90
|
|
91
|
91
|
|
92
|
92
|
public function testCopyCoupon() |
93
|
93
|
{ |
94
|
|
- $manager = \Aimeos\MShop\Factory::createManager( \TestHelperFrontend::getContext(), 'order/base' ); |
|
94
|
+ $manager = \Aimeos\MShop\Factory::createManager(\TestHelperFrontend::getContext(), 'order/base'); |
95
|
95
|
$ordBaseItem = $manager->createItem(); |
96
|
96
|
|
97
|
|
- $product = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'CNC', ['price'] ); |
98
|
|
- $ordProdManager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base/product' ); |
99
|
|
- $ordProdItem = $ordProdManager->createItem()->copyFrom( $product ); |
|
97
|
+ $product = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC', ['price']); |
|
98
|
+ $ordProdManager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base/product'); |
|
99
|
+ $ordProdItem = $ordProdManager->createItem()->copyFrom($product); |
100
|
100
|
|
101
|
|
- $priceItems = $product->getRefItems( 'price' ); |
102
|
|
- $ordProdItem->setPrice( reset( $priceItems ) ); |
|
101
|
+ $priceItems = $product->getRefItems('price'); |
|
102
|
+ $ordProdItem->setPrice(reset($priceItems)); |
103
|
103
|
|
104
|
|
- $ordBaseItem->addProduct( $ordProdItem ); |
105
|
|
- $ordBaseItem->addCoupon( 'OPQR', [] ); |
|
104
|
+ $ordBaseItem->addProduct($ordProdItem); |
|
105
|
+ $ordBaseItem->addCoupon('OPQR', []); |
106
|
106
|
|
107
|
107
|
|
108
|
|
- $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Standard' ) |
109
|
|
- ->setConstructorArgs( [$this->context] ) |
|
108
|
+ $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Basket\Standard') |
|
109
|
+ ->setConstructorArgs([$this->context]) |
110
|
110
|
->setMethods() |
111
|
111
|
->getMock(); |
112
|
112
|
|
113
|
|
- $object->addProduct( $product->getId() ); |
|
113
|
+ $object->addProduct($product->getId()); |
114
|
114
|
|
115
|
|
- $result = $this->access( 'copyCoupons' )->invokeArgs( $object, [$ordBaseItem, ['test'], 'unittest|en|EUR'] ); |
|
115
|
+ $result = $this->access('copyCoupons')->invokeArgs($object, [$ordBaseItem, ['test'], 'unittest|en|EUR']); |
116
|
116
|
|
117
|
117
|
|
118
|
|
- $this->assertEquals( ['test'], $result ); |
|
118
|
+ $this->assertEquals(['test'], $result); |
119
|
119
|
|
120
|
120
|
$object->clear(); |
121
|
121
|
} |
|
@@ -123,48 +123,48 @@ discard block |
|
|
block discarded – undo |
123
|
123
|
|
124
|
124
|
public function testCopyCouponException() |
125
|
125
|
{ |
126
|
|
- $manager = \Aimeos\MShop\Factory::createManager( \TestHelperFrontend::getContext(), 'order/base' ); |
|
126
|
+ $manager = \Aimeos\MShop\Factory::createManager(\TestHelperFrontend::getContext(), 'order/base'); |
127
|
127
|
$ordBaseItem = $manager->createItem(); |
128
|
128
|
|
129
|
|
- $ordBaseItem->addCoupon( '90AB', [] ); |
|
129
|
+ $ordBaseItem->addCoupon('90AB', []); |
130
|
130
|
|
131
|
131
|
|
132
|
|
- $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Standard' ) |
133
|
|
- ->setConstructorArgs( [$this->context] ) |
134
|
|
- ->setMethods( ['addCoupon'] ) |
|
132
|
+ $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Basket\Standard') |
|
133
|
+ ->setConstructorArgs([$this->context]) |
|
134
|
+ ->setMethods(['addCoupon']) |
135
|
135
|
->getMock(); |
136
|
136
|
|
137
|
|
- $object->expects( $this->once() )->method( 'addCoupon' )->will( $this->throwException( new \Exception() ) ); |
|
137
|
+ $object->expects($this->once())->method('addCoupon')->will($this->throwException(new \Exception())); |
138
|
138
|
|
139
|
|
- $result = $this->access( 'copyCoupons' )->invokeArgs( $object, [$ordBaseItem, [], 'unittest|en|EUR'] ); |
|
139
|
+ $result = $this->access('copyCoupons')->invokeArgs($object, [$ordBaseItem, [], 'unittest|en|EUR']); |
140
|
140
|
|
141
|
|
- $this->assertEquals( 1, count( $result ) ); |
142
|
|
- $this->assertArrayHasKey( 'coupon', $result ); |
|
141
|
+ $this->assertEquals(1, count($result)); |
|
142
|
+ $this->assertArrayHasKey('coupon', $result); |
143
|
143
|
} |
144
|
144
|
|
145
|
145
|
|
146
|
146
|
public function testCopyProduct() |
147
|
147
|
{ |
148
|
|
- $manager = \Aimeos\MShop\Factory::createManager( \TestHelperFrontend::getContext(), 'order/base' ); |
|
148
|
+ $manager = \Aimeos\MShop\Factory::createManager(\TestHelperFrontend::getContext(), 'order/base'); |
149
|
149
|
$ordBaseItem = $manager->createItem(); |
150
|
150
|
|
151
|
|
- $product = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'CNC' ); |
152
|
|
- $ordProdManager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base/product' ); |
153
|
|
- $ordProdItem = $ordProdManager->createItem()->copyFrom( $product ); |
154
|
|
- $ordBaseItem->addProduct( $ordProdItem ); |
|
151
|
+ $product = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC'); |
|
152
|
+ $ordProdManager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base/product'); |
|
153
|
+ $ordProdItem = $ordProdManager->createItem()->copyFrom($product); |
|
154
|
+ $ordBaseItem->addProduct($ordProdItem); |
155
|
155
|
|
156
|
156
|
|
157
|
|
- $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Standard' ) |
158
|
|
- ->setConstructorArgs( [$this->context] ) |
|
157
|
+ $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Basket\Standard') |
|
158
|
+ ->setConstructorArgs([$this->context]) |
159
|
159
|
->setMethods() |
160
|
160
|
->getMock(); |
161
|
161
|
|
162
|
|
- $result = $this->access( 'copyProducts' )->invokeArgs( $object, [$ordBaseItem, ['test'], 'unittest|en|EUR'] ); |
|
162
|
+ $result = $this->access('copyProducts')->invokeArgs($object, [$ordBaseItem, ['test'], 'unittest|en|EUR']); |
163
|
163
|
|
164
|
164
|
|
165
|
|
- $this->assertEquals( ['test'], $result ); |
166
|
|
- $this->assertEquals( 1, count( $object->get()->getProducts() ) ); |
167
|
|
- $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Base\Product\Iface', $object->get()->getProduct( 0 ) ); |
|
165
|
+ $this->assertEquals(['test'], $result); |
|
166
|
+ $this->assertEquals(1, count($object->get()->getProducts())); |
|
167
|
+ $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Base\Product\Iface', $object->get()->getProduct(0)); |
168
|
168
|
|
169
|
169
|
$object->clear(); |
170
|
170
|
} |
|
@@ -172,56 +172,56 @@ discard block |
|
|
block discarded – undo |
172
|
172
|
|
173
|
173
|
public function testCopyProductException() |
174
|
174
|
{ |
175
|
|
- $manager = \Aimeos\MShop\Factory::createManager( \TestHelperFrontend::getContext(), 'order/base' ); |
|
175
|
+ $manager = \Aimeos\MShop\Factory::createManager(\TestHelperFrontend::getContext(), 'order/base'); |
176
|
176
|
$ordBaseItem = $manager->createItem(); |
177
|
177
|
|
178
|
|
- $product = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'CNC' ); |
179
|
|
- $ordProdManager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base/product' ); |
180
|
|
- $ordProdItem = $ordProdManager->createItem()->copyFrom( $product ); |
181
|
|
- $ordBaseItem->addProduct( $ordProdItem ); |
|
178
|
+ $product = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC'); |
|
179
|
+ $ordProdManager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base/product'); |
|
180
|
+ $ordProdItem = $ordProdManager->createItem()->copyFrom($product); |
|
181
|
+ $ordBaseItem->addProduct($ordProdItem); |
182
|
182
|
|
183
|
183
|
|
184
|
|
- $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Standard' ) |
185
|
|
- ->setConstructorArgs( [$this->context] ) |
186
|
|
- ->setMethods( ['addProduct'] ) |
|
184
|
+ $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Basket\Standard') |
|
185
|
+ ->setConstructorArgs([$this->context]) |
|
186
|
+ ->setMethods(['addProduct']) |
187
|
187
|
->getMock(); |
188
|
188
|
|
189
|
|
- $object->expects( $this->once() )->method( 'addProduct' )->will( $this->throwException( new \Exception() ) ); |
|
189
|
+ $object->expects($this->once())->method('addProduct')->will($this->throwException(new \Exception())); |
190
|
190
|
|
191
|
|
- $result = $this->access( 'copyProducts' )->invokeArgs( $object, [$ordBaseItem, [], 'unittest|en|EUR'] ); |
|
191
|
+ $result = $this->access('copyProducts')->invokeArgs($object, [$ordBaseItem, [], 'unittest|en|EUR']); |
192
|
192
|
|
193
|
|
- $this->assertEquals( 1, count( $result ) ); |
194
|
|
- $this->assertArrayHasKey( 'product', $result ); |
|
193
|
+ $this->assertEquals(1, count($result)); |
|
194
|
+ $this->assertArrayHasKey('product', $result); |
195
|
195
|
} |
196
|
196
|
|
197
|
197
|
|
198
|
198
|
public function testCopyServices() |
199
|
199
|
{ |
200
|
|
- $manager = \Aimeos\MShop\Factory::createManager( \TestHelperFrontend::getContext(), 'order/base' ); |
|
200
|
+ $manager = \Aimeos\MShop\Factory::createManager(\TestHelperFrontend::getContext(), 'order/base'); |
201
|
201
|
$ordBaseItem = $manager->createItem(); |
202
|
202
|
|
203
|
|
- $serviceManager = \Aimeos\MShop\Factory::createManager( $this->context, 'service' ); |
204
|
|
- $ordServManager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base/service' ); |
|
203
|
+ $serviceManager = \Aimeos\MShop\Factory::createManager($this->context, 'service'); |
|
204
|
+ $ordServManager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base/service'); |
205
|
205
|
|
206
|
|
- $serviceItem = $serviceManager->findItem( 'unitcode', [], 'service', 'delivery' ); |
207
|
|
- $ordServItem = $ordServManager->createItem()->copyFrom( $serviceItem ); |
|
206
|
+ $serviceItem = $serviceManager->findItem('unitcode', [], 'service', 'delivery'); |
|
207
|
+ $ordServItem = $ordServManager->createItem()->copyFrom($serviceItem); |
208
|
208
|
|
209
|
|
- $ordBaseItem->setService( $ordServItem, \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_DELIVERY ); |
|
209
|
+ $ordBaseItem->setService($ordServItem, \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_DELIVERY); |
210
|
210
|
|
211
|
211
|
|
212
|
|
- $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Standard' ) |
213
|
|
- ->setConstructorArgs( [$this->context] ) |
|
212
|
+ $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Basket\Standard') |
|
213
|
+ ->setConstructorArgs([$this->context]) |
214
|
214
|
->setMethods() |
215
|
215
|
->getMock(); |
216
|
216
|
|
217
|
|
- $result = $this->access( 'copyServices' )->invokeArgs( $object, [$ordBaseItem, ['test'], 'unittest|en|EUR'] ); |
|
217
|
+ $result = $this->access('copyServices')->invokeArgs($object, [$ordBaseItem, ['test'], 'unittest|en|EUR']); |
218
|
218
|
|
219
|
219
|
|
220
|
|
- $this->assertEquals( ['test'], $result ); |
221
|
|
- $this->assertEquals( 1, count( $object->get()->getServices() ) ); |
|
220
|
+ $this->assertEquals(['test'], $result); |
|
221
|
+ $this->assertEquals(1, count($object->get()->getServices())); |
222
|
222
|
|
223
|
|
- $service = $object->get()->getService( \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_DELIVERY ); |
224
|
|
- $this->assertInstanceOf( '\Aimeos\MShop\Order\Item\Base\Service\Iface', $service ); |
|
223
|
+ $service = $object->get()->getService(\Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_DELIVERY); |
|
224
|
+ $this->assertInstanceOf('\Aimeos\MShop\Order\Item\Base\Service\Iface', $service); |
225
|
225
|
|
226
|
226
|
$object->clear(); |
227
|
227
|
} |
|
@@ -229,58 +229,58 @@ discard block |
|
|
block discarded – undo |
229
|
229
|
|
230
|
230
|
public function testCopyServicesException() |
231
|
231
|
{ |
232
|
|
- $manager = \Aimeos\MShop\Factory::createManager( \TestHelperFrontend::getContext(), 'order/base' ); |
|
232
|
+ $manager = \Aimeos\MShop\Factory::createManager(\TestHelperFrontend::getContext(), 'order/base'); |
233
|
233
|
$ordBaseItem = $manager->createItem(); |
234
|
234
|
|
235
|
|
- $serviceManager = \Aimeos\MShop\Factory::createManager( $this->context, 'service' ); |
236
|
|
- $ordServManager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base/service' ); |
|
235
|
+ $serviceManager = \Aimeos\MShop\Factory::createManager($this->context, 'service'); |
|
236
|
+ $ordServManager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base/service'); |
237
|
237
|
|
238
|
|
- $serviceItem = $serviceManager->findItem( 'unitcode', [], 'service', 'delivery' ); |
239
|
|
- $ordServItem = $ordServManager->createItem()->copyFrom( $serviceItem ); |
|
238
|
+ $serviceItem = $serviceManager->findItem('unitcode', [], 'service', 'delivery'); |
|
239
|
+ $ordServItem = $ordServManager->createItem()->copyFrom($serviceItem); |
240
|
240
|
|
241
|
|
- $ordBaseItem->setService( $ordServItem, \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_DELIVERY ); |
|
241
|
+ $ordBaseItem->setService($ordServItem, \Aimeos\MShop\Order\Item\Base\Service\Base::TYPE_DELIVERY); |
242
|
242
|
|
243
|
243
|
|
244
|
|
- $object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Basket\Standard' ) |
245
|
|
- ->setConstructorArgs( [$this->context] ) |
246
|
|
- ->setMethods( ['setService'] ) |
|
244
|
+ $object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Basket\Standard') |
|
245
|
+ ->setConstructorArgs([$this->context]) |
|
246
|
+ ->setMethods(['setService']) |
247
|
247
|
->getMock(); |
248
|
248
|
|
249
|
|
- $object->expects( $this->once() )->method( 'setService' )->will( $this->throwException( new \Exception() ) ); |
|
249
|
+ $object->expects($this->once())->method('setService')->will($this->throwException(new \Exception())); |
250
|
250
|
|
251
|
|
- $result = $this->access( 'copyServices' )->invokeArgs( $object, [$ordBaseItem, [], 'unittest|en|EUR'] ); |
|
251
|
+ $result = $this->access('copyServices')->invokeArgs($object, [$ordBaseItem, [], 'unittest|en|EUR']); |
252
|
252
|
|
253
|
|
- $this->assertEquals( 0, count( $result ) ); |
|
253
|
+ $this->assertEquals(0, count($result)); |
254
|
254
|
} |
255
|
255
|
|
256
|
256
|
|
257
|
257
|
/** |
258
|
258
|
* @param string $company |
259
|
259
|
*/ |
260
|
|
- protected function getAddress( $company ) |
|
260
|
+ protected function getAddress($company) |
261
|
261
|
{ |
262
|
|
- $manager = \Aimeos\MShop\Factory::createManager( \TestHelperFrontend::getContext(), 'customer/address' ); |
|
262
|
+ $manager = \Aimeos\MShop\Factory::createManager(\TestHelperFrontend::getContext(), 'customer/address'); |
263
|
263
|
|
264
|
264
|
$search = $manager->createSearch(); |
265
|
|
- $search->setConditions( $search->compare( '==', 'customer.address.company', $company ) ); |
266
|
|
- $items = $manager->searchItems( $search ); |
|
265
|
+ $search->setConditions($search->compare('==', 'customer.address.company', $company)); |
|
266
|
+ $items = $manager->searchItems($search); |
267
|
267
|
|
268
|
|
- if( ( $item = reset( $items ) ) === false ) { |
269
|
|
- throw new \RuntimeException( sprintf( 'No address item with company "%1$s" found', $company ) ); |
|
268
|
+ if (($item = reset($items)) === false) { |
|
269
|
+ throw new \RuntimeException(sprintf('No address item with company "%1$s" found', $company)); |
270
|
270
|
} |
271
|
271
|
|
272
|
|
- $ordAddrManager = \Aimeos\MShop\Factory::createManager( \TestHelperFrontend::getContext(), 'order/base/address' ); |
273
|
|
- $ordAddrItem = $ordAddrManager->createItem()->copyFrom( $item ); |
|
272
|
+ $ordAddrManager = \Aimeos\MShop\Factory::createManager(\TestHelperFrontend::getContext(), 'order/base/address'); |
|
273
|
+ $ordAddrItem = $ordAddrManager->createItem()->copyFrom($item); |
274
|
274
|
|
275
|
275
|
return $ordAddrItem; |
276
|
276
|
} |
277
|
277
|
|
278
|
278
|
|
279
|
|
- protected function access( $name ) |
|
279
|
+ protected function access($name) |
280
|
280
|
{ |
281
|
|
- $class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Basket\Base' ); |
282
|
|
- $method = $class->getMethod( $name ); |
283
|
|
- $method->setAccessible( true ); |
|
281
|
+ $class = new \ReflectionClass('\Aimeos\Controller\Frontend\Basket\Base'); |
|
282
|
+ $method = $class->getMethod($name); |
|
283
|
+ $method->setAccessible(true); |
284
|
284
|
|
285
|
285
|
return $method; |
286
|
286
|
} |