@@ -34,50 +34,50 @@ |
||
34 | 34 | ); |
35 | 35 | |
36 | 36 | |
37 | - $object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Invoice\Standard( $context, $mapping ); |
|
38 | - |
|
39 | - $invoice = $this->getInvoice( $context ); |
|
40 | - $order = \Aimeos\MShop\Factory::createManager( $context, 'order/base' )->load( $invoice->getBaseId() ); |
|
41 | - |
|
42 | - $data = $object->process( $invoice, $order ); |
|
43 | - |
|
44 | - |
|
45 | - $this->assertEquals( 1, count( $data ) ); |
|
46 | - |
|
47 | - $this->assertEquals( 17, count( $data[0] ) ); |
|
48 | - $this->assertEquals( 'web', $data[0][0] ); |
|
49 | - $this->assertEquals( '2008-02-15 12:34:56', $data[0][1] ); |
|
50 | - $this->assertEquals( '6', $data[0][2] ); |
|
51 | - $this->assertEquals( '', $data[0][3] ); |
|
52 | - $this->assertEquals( '4', $data[0][4] ); |
|
53 | - $this->assertEquals( '', $data[0][5] ); |
|
54 | - $this->assertGreaterThan( 0, $data[0][6] ); |
|
55 | - $this->assertEquals( 'unittest', $data[0][7] ); |
|
56 | - $this->assertEquals( 'de', $data[0][8] ); |
|
57 | - $this->assertEquals( 'EUR', $data[0][9] ); |
|
58 | - $this->assertEquals( '53.50', $data[0][10] ); |
|
59 | - $this->assertEquals( '1.50', $data[0][11] ); |
|
60 | - $this->assertEquals( '14.50', $data[0][12] ); |
|
61 | - $this->assertEquals( '0.0000', $data[0][13] ); |
|
62 | - $this->assertEquals( '1', $data[0][14] ); |
|
63 | - $this->assertEquals( '1', $data[0][15] ); |
|
64 | - $this->assertEquals( 'This is a comment if an order. It can be added by the user.', $data[0][16] ); |
|
37 | + $object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Invoice\Standard($context, $mapping); |
|
38 | + |
|
39 | + $invoice = $this->getInvoice($context); |
|
40 | + $order = \Aimeos\MShop\Factory::createManager($context, 'order/base')->load($invoice->getBaseId()); |
|
41 | + |
|
42 | + $data = $object->process($invoice, $order); |
|
43 | + |
|
44 | + |
|
45 | + $this->assertEquals(1, count($data)); |
|
46 | + |
|
47 | + $this->assertEquals(17, count($data[0])); |
|
48 | + $this->assertEquals('web', $data[0][0]); |
|
49 | + $this->assertEquals('2008-02-15 12:34:56', $data[0][1]); |
|
50 | + $this->assertEquals('6', $data[0][2]); |
|
51 | + $this->assertEquals('', $data[0][3]); |
|
52 | + $this->assertEquals('4', $data[0][4]); |
|
53 | + $this->assertEquals('', $data[0][5]); |
|
54 | + $this->assertGreaterThan(0, $data[0][6]); |
|
55 | + $this->assertEquals('unittest', $data[0][7]); |
|
56 | + $this->assertEquals('de', $data[0][8]); |
|
57 | + $this->assertEquals('EUR', $data[0][9]); |
|
58 | + $this->assertEquals('53.50', $data[0][10]); |
|
59 | + $this->assertEquals('1.50', $data[0][11]); |
|
60 | + $this->assertEquals('14.50', $data[0][12]); |
|
61 | + $this->assertEquals('0.0000', $data[0][13]); |
|
62 | + $this->assertEquals('1', $data[0][14]); |
|
63 | + $this->assertEquals('1', $data[0][15]); |
|
64 | + $this->assertEquals('This is a comment if an order. It can be added by the user.', $data[0][16]); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | |
68 | - protected function getInvoice( $context ) |
|
68 | + protected function getInvoice($context) |
|
69 | 69 | { |
70 | - $manager = \Aimeos\MShop\Factory::createManager( $context, 'order' ); |
|
70 | + $manager = \Aimeos\MShop\Factory::createManager($context, 'order'); |
|
71 | 71 | |
72 | 72 | $search = $manager->createSearch(); |
73 | - $search->setConditions( $search->compare( '==', 'order.datepayment', '2008-02-15 12:34:56' ) ); |
|
73 | + $search->setConditions($search->compare('==', 'order.datepayment', '2008-02-15 12:34:56')); |
|
74 | 74 | |
75 | - $items = $manager->searchItems( $search ); |
|
75 | + $items = $manager->searchItems($search); |
|
76 | 76 | |
77 | - if( ( $item = reset( $items ) ) !== false ) { |
|
77 | + if (($item = reset($items)) !== false) { |
|
78 | 78 | return $item; |
79 | 79 | } |
80 | 80 | |
81 | - throw new \Exception( 'No order item found' ); |
|
81 | + throw new \Exception('No order item found'); |
|
82 | 82 | } |
83 | 83 | } |
@@ -7,19 +7,19 @@ |
||
7 | 7 | |
8 | 8 | $enc = $this->encoder(); |
9 | 9 | |
10 | -$detailTarget = $this->config( 'client/html/catalog/detail/url/target' ); |
|
11 | -$detailCntl = $this->config( 'client/html/catalog/detail/url/controller', 'catalog' ); |
|
12 | -$detailAction = $this->config( 'client/html/catalog/detail/url/action', 'detail' ); |
|
13 | -$detailConfig = $this->config( 'client/html/catalog/detail/url/config', [] ); |
|
10 | +$detailTarget = $this->config('client/html/catalog/detail/url/target'); |
|
11 | +$detailCntl = $this->config('client/html/catalog/detail/url/controller', 'catalog'); |
|
12 | +$detailAction = $this->config('client/html/catalog/detail/url/action', 'detail'); |
|
13 | +$detailConfig = $this->config('client/html/catalog/detail/url/config', []); |
|
14 | 14 | |
15 | -$freq = $enc->xml( $this->get( 'siteFreq', 'daily' ) ); |
|
15 | +$freq = $enc->xml($this->get('siteFreq', 'daily')); |
|
16 | 16 | |
17 | 17 | ?> |
18 | -<?php foreach( $this->get( 'siteItems', [] ) as $id => $item ) : ?> |
|
18 | +<?php foreach ($this->get('siteItems', []) as $id => $item) : ?> |
|
19 | 19 | <?php |
20 | - $date = str_replace( ' ', 'T', $item->getTimeModified() ) . date( 'P' ); |
|
21 | - $params = array( 'd_name' => $item->getName( 'url' ), 'd_prodid' => $id ); |
|
22 | - $url = $this->url( $detailTarget, $detailCntl, $detailAction, $params, [], $detailConfig ); |
|
20 | + $date = str_replace(' ', 'T', $item->getTimeModified()) . date('P'); |
|
21 | + $params = array('d_name' => $item->getName('url'), 'd_prodid' => $id); |
|
22 | + $url = $this->url($detailTarget, $detailCntl, $detailAction, $params, [], $detailConfig); |
|
23 | 23 | ?> |
24 | - <url><loc><?php echo $enc->xml( $url ); ?></loc><lastmod><?php echo $date; ?></lastmod><changefreq><?php echo $freq; ?></changefreq></url> |
|
24 | + <url><loc><?php echo $enc->xml($url); ?></loc><lastmod><?php echo $date; ?></lastmod><changefreq><?php echo $freq; ?></changefreq></url> |
|
25 | 25 | <?php endforeach; ?> |
@@ -6,16 +6,16 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | $enc = $this->encoder(); |
9 | -$date = date( 'c' ); |
|
9 | +$date = date('c'); |
|
10 | 10 | |
11 | 11 | ?> |
12 | 12 | <?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?> |
13 | 13 | |
14 | 14 | |
15 | 15 | <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> |
16 | -<?php foreach( $this->get( 'siteFiles', [] ) as $name ) : ?> |
|
16 | +<?php foreach ($this->get('siteFiles', []) as $name) : ?> |
|
17 | 17 | <sitemap> |
18 | - <loc><?php echo $enc->xml( basename( $name ) ); ?></loc> |
|
18 | + <loc><?php echo $enc->xml(basename($name)); ?></loc> |
|
19 | 19 | <lastmod><?php echo $date; ?></lastmod> |
20 | 20 | </sitemap> |
21 | 21 | <?php endforeach; ?> |
@@ -21,62 +21,62 @@ discard block |
||
21 | 21 | $this->aimeos = \TestHelperJobs::getAimeos(); |
22 | 22 | $this->context = \TestHelperJobs::getContext(); |
23 | 23 | |
24 | - $this->object = new \Aimeos\Controller\Jobs\Subscription\Process\Renew\Standard( $this->context, $this->aimeos ); |
|
24 | + $this->object = new \Aimeos\Controller\Jobs\Subscription\Process\Renew\Standard($this->context, $this->aimeos); |
|
25 | 25 | |
26 | - \Aimeos\MShop\Factory::setCache( true ); |
|
26 | + \Aimeos\MShop\Factory::setCache(true); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | |
30 | 30 | protected function tearDown() |
31 | 31 | { |
32 | - \Aimeos\MShop\Factory::setCache( false ); |
|
32 | + \Aimeos\MShop\Factory::setCache(false); |
|
33 | 33 | \Aimeos\MShop\Factory::clear(); |
34 | 34 | |
35 | - unset( $this->object, $this->context, $this->aimeos ); |
|
35 | + unset($this->object, $this->context, $this->aimeos); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
39 | 39 | public function testGetName() |
40 | 40 | { |
41 | - $this->assertEquals( 'Subscription process renew', $this->object->getName() ); |
|
41 | + $this->assertEquals('Subscription process renew', $this->object->getName()); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function testGetDescription() |
46 | 46 | { |
47 | - $this->assertEquals( 'Renews subscriptions at next date', $this->object->getDescription() ); |
|
47 | + $this->assertEquals('Renews subscriptions at next date', $this->object->getDescription()); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
51 | 51 | public function testRun() |
52 | 52 | { |
53 | - $this->context->getConfig()->set( 'controller/common/subscription/process/processors', ['cgroup'] ); |
|
53 | + $this->context->getConfig()->set('controller/common/subscription/process/processors', ['cgroup']); |
|
54 | 54 | $item = $this->getSubscription(); |
55 | 55 | |
56 | - $object = $this->getMockBuilder( '\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\Renew\\Standard' ) |
|
57 | - ->setConstructorArgs( [$this->context, $this->aimeos] ) |
|
58 | - ->setMethods( ['createOrderBase', 'createOrderInvoice', 'createPayment'] ) |
|
56 | + $object = $this->getMockBuilder('\\Aimeos\\Controller\\Jobs\\Subscription\\Process\\Renew\\Standard') |
|
57 | + ->setConstructorArgs([$this->context, $this->aimeos]) |
|
58 | + ->setMethods(['createOrderBase', 'createOrderInvoice', 'createPayment']) |
|
59 | 59 | ->getMock(); |
60 | 60 | |
61 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Subscription\\Manager\\Standard' ) |
|
62 | - ->setConstructorArgs( [$this->context] ) |
|
63 | - ->setMethods( ['searchItems', 'saveItem'] ) |
|
61 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Subscription\\Manager\\Standard') |
|
62 | + ->setConstructorArgs([$this->context]) |
|
63 | + ->setMethods(['searchItems', 'saveItem']) |
|
64 | 64 | ->getMock(); |
65 | 65 | |
66 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'subscription', $managerStub ); |
|
66 | + \Aimeos\MShop\Factory::injectManager($this->context, 'subscription', $managerStub); |
|
67 | 67 | |
68 | - $object->expects( $this->once() )->method( 'createOrderBase' ) |
|
69 | - ->will( $this->returnValue( $this->getOrderBaseItem( $item->getOrderBaseId() ) ) ); |
|
68 | + $object->expects($this->once())->method('createOrderBase') |
|
69 | + ->will($this->returnValue($this->getOrderBaseItem($item->getOrderBaseId()))); |
|
70 | 70 | |
71 | - $object->expects( $this->once() )->method( 'createOrderInvoice' ) |
|
72 | - ->will( $this->returnValue( $this->getOrderItem() ) ); |
|
71 | + $object->expects($this->once())->method('createOrderInvoice') |
|
72 | + ->will($this->returnValue($this->getOrderItem())); |
|
73 | 73 | |
74 | - $object->expects( $this->once() )->method( 'createPayment' ); |
|
74 | + $object->expects($this->once())->method('createPayment'); |
|
75 | 75 | |
76 | - $managerStub->expects( $this->once() )->method( 'searchItems' ) |
|
77 | - ->will( $this->returnValue( [$item] ) ); |
|
76 | + $managerStub->expects($this->once())->method('searchItems') |
|
77 | + ->will($this->returnValue([$item])); |
|
78 | 78 | |
79 | - $managerStub->expects( $this->once() )->method( 'saveItem' ); |
|
79 | + $managerStub->expects($this->once())->method('saveItem'); |
|
80 | 80 | |
81 | 81 | $object->run(); |
82 | 82 | } |
@@ -84,19 +84,19 @@ discard block |
||
84 | 84 | |
85 | 85 | public function testRunException() |
86 | 86 | { |
87 | - $this->context->getConfig()->set( 'controller/common/subscription/process/processors', ['cgroup'] ); |
|
87 | + $this->context->getConfig()->set('controller/common/subscription/process/processors', ['cgroup']); |
|
88 | 88 | |
89 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Subscription\\Manager\\Standard' ) |
|
90 | - ->setConstructorArgs( [$this->context] ) |
|
91 | - ->setMethods( ['searchItems', 'saveItem'] ) |
|
89 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Subscription\\Manager\\Standard') |
|
90 | + ->setConstructorArgs([$this->context]) |
|
91 | + ->setMethods(['searchItems', 'saveItem']) |
|
92 | 92 | ->getMock(); |
93 | 93 | |
94 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'subscription', $managerStub ); |
|
94 | + \Aimeos\MShop\Factory::injectManager($this->context, 'subscription', $managerStub); |
|
95 | 95 | |
96 | - $managerStub->expects( $this->once() )->method( 'searchItems' ) |
|
97 | - ->will( $this->returnValue( [$managerStub->createItem()] ) ); |
|
96 | + $managerStub->expects($this->once())->method('searchItems') |
|
97 | + ->will($this->returnValue([$managerStub->createItem()])); |
|
98 | 98 | |
99 | - $managerStub->expects( $this->never() )->method( 'saveItem' ); |
|
99 | + $managerStub->expects($this->never())->method('saveItem'); |
|
100 | 100 | |
101 | 101 | $this->object->run(); |
102 | 102 | } |
@@ -104,79 +104,79 @@ discard block |
||
104 | 104 | |
105 | 105 | public function testAddBasketAddresses() |
106 | 106 | { |
107 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
108 | - $address = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base/address' )->createItem(); |
|
107 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
108 | + $address = \Aimeos\MShop\Factory::createManager($this->context, 'order/base/address')->createItem(); |
|
109 | 109 | |
110 | 110 | $addresses = ['payment' => $address]; |
111 | - $basket = $this->access( 'addBasketAddresses' )->invokeArgs( $this->object, [$this->context, $basket, $addresses] ); |
|
111 | + $basket = $this->access('addBasketAddresses')->invokeArgs($this->object, [$this->context, $basket, $addresses]); |
|
112 | 112 | |
113 | - $this->assertEquals( 1, count( $basket->getAddresses() ) ); |
|
114 | - $this->assertInstanceOf( \Aimeos\MShop\Order\Item\Base\Address\Iface::class, $basket->getAddress( 'payment' ) ); |
|
113 | + $this->assertEquals(1, count($basket->getAddresses())); |
|
114 | + $this->assertInstanceOf(\Aimeos\MShop\Order\Item\Base\Address\Iface::class, $basket->getAddress('payment')); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
118 | 118 | public function testAddBasketCoupons() |
119 | 119 | { |
120 | - $this->context->getConfig()->set( 'controller/jobs/subcription/process/renew/standard/use-coupons', true ); |
|
120 | + $this->context->getConfig()->set('controller/jobs/subcription/process/renew/standard/use-coupons', true); |
|
121 | 121 | |
122 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
123 | - $product = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'CNC', ['price'] ); |
|
124 | - $orderProduct = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base/product' )->createItem(); |
|
122 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
123 | + $product = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC', ['price']); |
|
124 | + $orderProduct = \Aimeos\MShop\Factory::createManager($this->context, 'order/base/product')->createItem(); |
|
125 | 125 | |
126 | - $price = $product->getRefItems( 'price', 'default', 'default' ); |
|
127 | - $basket->addProduct( $orderProduct->copyFrom( $product )->setPrice( reset( $price ) ) ); |
|
126 | + $price = $product->getRefItems('price', 'default', 'default'); |
|
127 | + $basket->addProduct($orderProduct->copyFrom($product)->setPrice(reset($price))); |
|
128 | 128 | |
129 | - $this->assertEquals( '600.00', $basket->getPrice()->getValue() ); |
|
130 | - $this->assertEquals( '30.00', $basket->getPrice()->getCosts() ); |
|
131 | - $this->assertEquals( '0.00', $basket->getPrice()->getRebate() ); |
|
129 | + $this->assertEquals('600.00', $basket->getPrice()->getValue()); |
|
130 | + $this->assertEquals('30.00', $basket->getPrice()->getCosts()); |
|
131 | + $this->assertEquals('0.00', $basket->getPrice()->getRebate()); |
|
132 | 132 | |
133 | - $basket = $this->access( 'addBasketCoupons' )->invokeArgs( $this->object, [$this->context, $basket, ['90AB']] ); |
|
133 | + $basket = $this->access('addBasketCoupons')->invokeArgs($this->object, [$this->context, $basket, ['90AB']]); |
|
134 | 134 | |
135 | - $this->assertEquals( 1, count( $basket->getCoupons() ) ); |
|
136 | - $this->assertEquals( 2, count( $basket->getProducts() ) ); |
|
137 | - $this->assertEquals( '537.00', $basket->getPrice()->getValue() ); |
|
138 | - $this->assertEquals( '30.00', $basket->getPrice()->getCosts() ); |
|
139 | - $this->assertEquals( '63.00', $basket->getPrice()->getRebate() ); |
|
135 | + $this->assertEquals(1, count($basket->getCoupons())); |
|
136 | + $this->assertEquals(2, count($basket->getProducts())); |
|
137 | + $this->assertEquals('537.00', $basket->getPrice()->getValue()); |
|
138 | + $this->assertEquals('30.00', $basket->getPrice()->getCosts()); |
|
139 | + $this->assertEquals('63.00', $basket->getPrice()->getRebate()); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | |
143 | 143 | public function testAddBasketProducts() |
144 | 144 | { |
145 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
146 | - $product = \Aimeos\MShop\Factory::createManager( $this->context, 'product' )->findItem( 'CNC' ); |
|
147 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base/product' ); |
|
145 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
146 | + $product = \Aimeos\MShop\Factory::createManager($this->context, 'product')->findItem('CNC'); |
|
147 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base/product'); |
|
148 | 148 | |
149 | 149 | $orderProducts = [ |
150 | - $manager->createItem()->copyFrom( $product )->setId( 1 ), |
|
151 | - $manager->createItem()->copyFrom( $product )->setId( 2 ), |
|
150 | + $manager->createItem()->copyFrom($product)->setId(1), |
|
151 | + $manager->createItem()->copyFrom($product)->setId(2), |
|
152 | 152 | ]; |
153 | 153 | |
154 | - $basket = $this->access( 'addBasketProducts' )->invokeArgs( $this->object, [$this->context, $basket, $orderProducts, 1] ); |
|
154 | + $basket = $this->access('addBasketProducts')->invokeArgs($this->object, [$this->context, $basket, $orderProducts, 1]); |
|
155 | 155 | |
156 | - $this->assertEquals( 1, count( $basket->getProducts() ) ); |
|
157 | - $this->assertNull( $basket->getProduct( 0 )->getId() ); |
|
156 | + $this->assertEquals(1, count($basket->getProducts())); |
|
157 | + $this->assertNull($basket->getProduct(0)->getId()); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
161 | 161 | public function testAddBasketServices() |
162 | 162 | { |
163 | - $basket = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->createItem(); |
|
164 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'order/base/service' ); |
|
163 | + $basket = \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->createItem(); |
|
164 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'order/base/service'); |
|
165 | 165 | |
166 | 166 | $orderServices = [ |
167 | - 'delivery' => [$manager->createItem()->setCode( 'shiptest' )], |
|
168 | - 'payment' => [$manager->createItem()->setCode( 'paytest' )], |
|
167 | + 'delivery' => [$manager->createItem()->setCode('shiptest')], |
|
168 | + 'payment' => [$manager->createItem()->setCode('paytest')], |
|
169 | 169 | ]; |
170 | 170 | |
171 | - $basket = $this->access( 'addBasketServices' )->invokeArgs( $this->object, [$this->context, $basket, $orderServices] ); |
|
171 | + $basket = $this->access('addBasketServices')->invokeArgs($this->object, [$this->context, $basket, $orderServices]); |
|
172 | 172 | |
173 | 173 | $class = \Aimeos\MShop\Order\Item\Base\Service\Iface::class; |
174 | 174 | |
175 | - $this->assertEquals( 2, count( $basket->getServices() ) ); |
|
176 | - $this->assertEquals( 1, count( $basket->getService( 'delivery' ) ) ); |
|
177 | - $this->assertInstanceOf( $class, $basket->getService( 'delivery', 'unitcode' ) ); |
|
178 | - $this->assertEquals( 1, count( $basket->getService( 'payment' ) ) ); |
|
179 | - $this->assertInstanceOf( $class, $basket->getService( 'payment', 'paytest' ) ); |
|
175 | + $this->assertEquals(2, count($basket->getServices())); |
|
176 | + $this->assertEquals(1, count($basket->getService('delivery'))); |
|
177 | + $this->assertInstanceOf($class, $basket->getService('delivery', 'unitcode')); |
|
178 | + $this->assertEquals(1, count($basket->getService('payment'))); |
|
179 | + $this->assertInstanceOf($class, $basket->getService('payment', 'paytest')); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | |
@@ -184,34 +184,34 @@ discard block |
||
184 | 184 | { |
185 | 185 | $item = $this->getSubscription(); |
186 | 186 | |
187 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard' ) |
|
188 | - ->setConstructorArgs( [$this->context] ) |
|
189 | - ->setMethods( ['store'] ) |
|
187 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Base\\Standard') |
|
188 | + ->setConstructorArgs([$this->context]) |
|
189 | + ->setMethods(['store']) |
|
190 | 190 | ->getMock(); |
191 | 191 | |
192 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'order/base', $managerStub ); |
|
192 | + \Aimeos\MShop\Factory::injectManager($this->context, 'order/base', $managerStub); |
|
193 | 193 | |
194 | - $managerStub->expects( $this->once() )->method( 'store' ); |
|
194 | + $managerStub->expects($this->once())->method('store'); |
|
195 | 195 | |
196 | - $this->access( 'createOrderBase' )->invokeArgs( $this->object, [$this->context, $item] ); |
|
196 | + $this->access('createOrderBase')->invokeArgs($this->object, [$this->context, $item]); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | |
200 | 200 | public function testCreateOrderInvoice() |
201 | 201 | { |
202 | 202 | $item = $this->getSubscription(); |
203 | - $baseItem = $this->getOrderBaseItem( $item->getOrderBaseId() ); |
|
203 | + $baseItem = $this->getOrderBaseItem($item->getOrderBaseId()); |
|
204 | 204 | |
205 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
206 | - ->setConstructorArgs( [$this->context] ) |
|
207 | - ->setMethods( ['saveItem'] ) |
|
205 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
206 | + ->setConstructorArgs([$this->context]) |
|
207 | + ->setMethods(['saveItem']) |
|
208 | 208 | ->getMock(); |
209 | 209 | |
210 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'order', $managerStub ); |
|
210 | + \Aimeos\MShop\Factory::injectManager($this->context, 'order', $managerStub); |
|
211 | 211 | |
212 | - $managerStub->expects( $this->once() )->method( 'saveItem' ); |
|
212 | + $managerStub->expects($this->once())->method('saveItem'); |
|
213 | 213 | |
214 | - $this->access( 'createOrderInvoice' )->invokeArgs( $this->object, [$this->context, $baseItem] ); |
|
214 | + $this->access('createOrderInvoice')->invokeArgs($this->object, [$this->context, $baseItem]); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | |
@@ -219,55 +219,55 @@ discard block |
||
219 | 219 | { |
220 | 220 | $item = $this->getSubscription(); |
221 | 221 | $invoice = $this->getOrderItem(); |
222 | - $baseItem = $this->getOrderBaseItem( $item->getOrderBaseId() ); |
|
222 | + $baseItem = $this->getOrderBaseItem($item->getOrderBaseId()); |
|
223 | 223 | |
224 | - $managerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Order\\Manager\\Standard' ) |
|
225 | - ->setConstructorArgs( [$this->context] ) |
|
226 | - ->setMethods( ['saveItem'] ) |
|
224 | + $managerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Order\\Manager\\Standard') |
|
225 | + ->setConstructorArgs([$this->context]) |
|
226 | + ->setMethods(['saveItem']) |
|
227 | 227 | ->getMock(); |
228 | 228 | |
229 | - \Aimeos\MShop\Factory::injectManager( $this->context, 'order', $managerStub ); |
|
229 | + \Aimeos\MShop\Factory::injectManager($this->context, 'order', $managerStub); |
|
230 | 230 | |
231 | - $managerStub->expects( $this->once() )->method( 'saveItem' ); |
|
231 | + $managerStub->expects($this->once())->method('saveItem'); |
|
232 | 232 | |
233 | - $this->access( 'createPayment' )->invokeArgs( $this->object, [$this->context, $baseItem, $invoice] ); |
|
233 | + $this->access('createPayment')->invokeArgs($this->object, [$this->context, $baseItem, $invoice]); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | |
237 | 237 | protected function getOrderItem() |
238 | 238 | { |
239 | - return \Aimeos\MShop\Factory::createManager( $this->context, 'order' )->createItem(); |
|
239 | + return \Aimeos\MShop\Factory::createManager($this->context, 'order')->createItem(); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | |
243 | - protected function getOrderBaseItem( $baseId ) |
|
243 | + protected function getOrderBaseItem($baseId) |
|
244 | 244 | { |
245 | - return \Aimeos\MShop\Factory::createManager( $this->context, 'order/base' )->getItem( $baseId, ['order/base/service'] ); |
|
245 | + return \Aimeos\MShop\Factory::createManager($this->context, 'order/base')->getItem($baseId, ['order/base/service']); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | |
249 | 249 | protected function getSubscription() |
250 | 250 | { |
251 | - $manager = \Aimeos\MShop\Factory::createManager( $this->context, 'subscription' ); |
|
251 | + $manager = \Aimeos\MShop\Factory::createManager($this->context, 'subscription'); |
|
252 | 252 | |
253 | 253 | $search = $manager->createSearch(); |
254 | - $search->setConditions( $search->compare( '==', 'subscription.dateend', '2010-01-01' ) ); |
|
254 | + $search->setConditions($search->compare('==', 'subscription.dateend', '2010-01-01')); |
|
255 | 255 | |
256 | - $items = $manager->searchItems( $search ); |
|
256 | + $items = $manager->searchItems($search); |
|
257 | 257 | |
258 | - if( ( $item = reset( $items ) ) !== false ) { |
|
258 | + if (($item = reset($items)) !== false) { |
|
259 | 259 | return $item; |
260 | 260 | } |
261 | 261 | |
262 | - throw new \Exception( 'No subscription item found' ); |
|
262 | + throw new \Exception('No subscription item found'); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | |
266 | - protected function access( $name ) |
|
266 | + protected function access($name) |
|
267 | 267 | { |
268 | - $class = new \ReflectionClass( \Aimeos\Controller\Jobs\Subscription\Process\Renew\Standard::class ); |
|
269 | - $method = $class->getMethod( $name ); |
|
270 | - $method->setAccessible( true ); |
|
268 | + $class = new \ReflectionClass(\Aimeos\Controller\Jobs\Subscription\Process\Renew\Standard::class); |
|
269 | + $method = $class->getMethod($name); |
|
270 | + $method->setAccessible(true); |
|
271 | 271 | |
272 | 272 | return $method; |
273 | 273 | } |
@@ -16,62 +16,62 @@ discard block |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - \Aimeos\MShop\Factory::setCache( true ); |
|
19 | + \Aimeos\MShop\Factory::setCache(true); |
|
20 | 20 | |
21 | 21 | $context = \TestHelperCntl::getContext(); |
22 | 22 | $aimeos = \TestHelperCntl::getAimeos(); |
23 | 23 | |
24 | - $this->object = new TestAbstract( $context, $aimeos ); |
|
24 | + $this->object = new TestAbstract($context, $aimeos); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | protected function tearDown() |
29 | 29 | { |
30 | - \Aimeos\MShop\Factory::setCache( false ); |
|
30 | + \Aimeos\MShop\Factory::setCache(false); |
|
31 | 31 | \Aimeos\MShop\Factory::clear(); |
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | 35 | public function testGetCacheInvalidType() |
36 | 36 | { |
37 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
38 | - $this->object->getCachePublic( '$' ); |
|
37 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
38 | + $this->object->getCachePublic('$'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | 42 | public function testGetCacheInvalidClass() |
43 | 43 | { |
44 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
45 | - $this->object->getCachePublic( 'unknown' ); |
|
44 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
45 | + $this->object->getCachePublic('unknown'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | |
49 | 49 | public function testGetProcessors() |
50 | 50 | { |
51 | - $processor = $this->object->getProcessorsPublic( array( 'media' => [] ) ); |
|
51 | + $processor = $this->object->getProcessorsPublic(array('media' => [])); |
|
52 | 52 | |
53 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\Iface', $processor ); |
|
53 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Catalog\\Import\\Csv\\Processor\\Iface', $processor); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | 57 | public function testGetProcessorsInvalidType() |
58 | 58 | { |
59 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
60 | - $this->object->getProcessorsPublic( array( '$' => [] ) ); |
|
59 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
60 | + $this->object->getProcessorsPublic(array('$' => [])); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testGetProcessorsInvalidClass() |
65 | 65 | { |
66 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
67 | - $this->object->getProcessorsPublic( array( 'unknown' => [] ) ); |
|
66 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
67 | + $this->object->getProcessorsPublic(array('unknown' => [])); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
71 | 71 | public function testGetProcessorsInvalidInterface() |
72 | 72 | { |
73 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
74 | - $this->object->getProcessorsPublic( array( 'unknown' => [] ) ); |
|
73 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
74 | + $this->object->getProcessorsPublic(array('unknown' => [])); |
|
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
@@ -79,15 +79,15 @@ discard block |
||
79 | 79 | class TestAbstract |
80 | 80 | extends \Aimeos\Controller\Common\Catalog\Import\Csv\Base |
81 | 81 | { |
82 | - public function getCachePublic( $type, $name = null ) |
|
82 | + public function getCachePublic($type, $name = null) |
|
83 | 83 | { |
84 | - return $this->getCache( $type, $name ); |
|
84 | + return $this->getCache($type, $name); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
88 | - public function getProcessorsPublic( array $mappings ) |
|
88 | + public function getProcessorsPublic(array $mappings) |
|
89 | 89 | { |
90 | - return $this->getProcessors( $mappings ); |
|
90 | + return $this->getProcessors($mappings); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 |
@@ -17,16 +17,16 @@ discard block |
||
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 = \TestHelperCntl::getContext(); |
23 | - $this->endpoint = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Done( $this->context, [] ); |
|
23 | + $this->endpoint = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Done($this->context, []); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | 27 | protected function tearDown() |
28 | 28 | { |
29 | - \Aimeos\MShop\Factory::setCache( false ); |
|
29 | + \Aimeos\MShop\Factory::setCache(false); |
|
30 | 30 | \Aimeos\MShop\Factory::clear(); |
31 | 31 | } |
32 | 32 | |
@@ -51,32 +51,32 @@ discard block |
||
51 | 51 | 5 => 1, |
52 | 52 | ); |
53 | 53 | |
54 | - $catalog = $this->create( 'job_csv_test' ); |
|
54 | + $catalog = $this->create('job_csv_test'); |
|
55 | 55 | |
56 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
57 | - $object->process( $catalog, $data ); |
|
56 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
57 | + $object->process($catalog, $data); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | $listItems = $catalog->getListItems(); |
61 | - $listItem = reset( $listItems ); |
|
61 | + $listItem = reset($listItems); |
|
62 | 62 | |
63 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
64 | - $this->assertEquals( 1, count( $listItems ) ); |
|
63 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
64 | + $this->assertEquals(1, count($listItems)); |
|
65 | 65 | |
66 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
67 | - $this->assertEquals( 0, $listItem->getPosition() ); |
|
68 | - $this->assertEquals( 'media', $listItem->getDomain() ); |
|
69 | - $this->assertEquals( 'default', $listItem->getType() ); |
|
66 | + $this->assertEquals(1, $listItem->getStatus()); |
|
67 | + $this->assertEquals(0, $listItem->getPosition()); |
|
68 | + $this->assertEquals('media', $listItem->getDomain()); |
|
69 | + $this->assertEquals('default', $listItem->getType()); |
|
70 | 70 | |
71 | 71 | $refItem = $listItem->getRefItem(); |
72 | 72 | |
73 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
74 | - $this->assertEquals( 'default', $refItem->getType() ); |
|
75 | - $this->assertEquals( 'test image', $refItem->getLabel() ); |
|
76 | - $this->assertEquals( 'image/jpeg', $refItem->getMimetype() ); |
|
77 | - $this->assertEquals( 'path/to/preview', $refItem->getPreview() ); |
|
78 | - $this->assertEquals( 'path/to/file', $refItem->getUrl() ); |
|
79 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
73 | + $this->assertEquals(1, $refItem->getStatus()); |
|
74 | + $this->assertEquals('default', $refItem->getType()); |
|
75 | + $this->assertEquals('test image', $refItem->getLabel()); |
|
76 | + $this->assertEquals('image/jpeg', $refItem->getMimetype()); |
|
77 | + $this->assertEquals('path/to/preview', $refItem->getPreview()); |
|
78 | + $this->assertEquals('path/to/file', $refItem->getUrl()); |
|
79 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -90,21 +90,21 @@ discard block |
||
90 | 90 | 0 => "path/to/0\npath/to/1\npath/to/2\npath/to/3", |
91 | 91 | ); |
92 | 92 | |
93 | - $catalog = $this->create( 'job_csv_test' ); |
|
93 | + $catalog = $this->create('job_csv_test'); |
|
94 | 94 | |
95 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
96 | - $object->process( $catalog, $data ); |
|
95 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
96 | + $object->process($catalog, $data); |
|
97 | 97 | |
98 | 98 | |
99 | 99 | $pos = 0; |
100 | 100 | $listItems = $catalog->getListItems(); |
101 | - $expected = array( 'path/to/0', 'path/to/1', 'path/to/2', 'path/to/3' ); |
|
101 | + $expected = array('path/to/0', 'path/to/1', 'path/to/2', 'path/to/3'); |
|
102 | 102 | |
103 | - $this->assertEquals( 4, count( $listItems ) ); |
|
103 | + $this->assertEquals(4, count($listItems)); |
|
104 | 104 | |
105 | - foreach( $listItems as $listItem ) |
|
105 | + foreach ($listItems as $listItem) |
|
106 | 106 | { |
107 | - $this->assertEquals( $expected[$pos], $listItem->getRefItem()->getUrl() ); |
|
107 | + $this->assertEquals($expected[$pos], $listItem->getRefItem()->getUrl()); |
|
108 | 108 | $pos++; |
109 | 109 | } |
110 | 110 | } |
@@ -126,20 +126,20 @@ discard block |
||
126 | 126 | 3 => 'path/to/3', |
127 | 127 | ); |
128 | 128 | |
129 | - $catalog = $this->create( 'job_csv_test' ); |
|
129 | + $catalog = $this->create('job_csv_test'); |
|
130 | 130 | |
131 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
132 | - $object->process( $catalog, $data ); |
|
131 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
132 | + $object->process($catalog, $data); |
|
133 | 133 | |
134 | 134 | |
135 | 135 | $pos = 0; |
136 | 136 | $listItems = $catalog->getListItems(); |
137 | 137 | |
138 | - $this->assertEquals( 4, count( $listItems ) ); |
|
138 | + $this->assertEquals(4, count($listItems)); |
|
139 | 139 | |
140 | - foreach( $listItems as $listItem ) |
|
140 | + foreach ($listItems as $listItem) |
|
141 | 141 | { |
142 | - $this->assertEquals( $data[$pos], $listItem->getRefItem()->getUrl() ); |
|
142 | + $this->assertEquals($data[$pos], $listItem->getRefItem()->getUrl()); |
|
143 | 143 | $pos++; |
144 | 144 | } |
145 | 145 | } |
@@ -162,21 +162,21 @@ discard block |
||
162 | 162 | 1 => '', |
163 | 163 | ); |
164 | 164 | |
165 | - $catalog = $this->create( 'job_csv_test' ); |
|
165 | + $catalog = $this->create('job_csv_test'); |
|
166 | 166 | |
167 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
168 | - $object->process( $catalog, $data ); |
|
169 | - $object->process( $catalog, $dataUpdate ); |
|
167 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
168 | + $object->process($catalog, $data); |
|
169 | + $object->process($catalog, $dataUpdate); |
|
170 | 170 | |
171 | 171 | |
172 | 172 | $listItems = $catalog->getListItems(); |
173 | - $listItem = reset( $listItems ); |
|
173 | + $listItem = reset($listItems); |
|
174 | 174 | |
175 | - $this->assertEquals( 1, count( $listItems ) ); |
|
176 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
175 | + $this->assertEquals(1, count($listItems)); |
|
176 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
177 | 177 | |
178 | - $this->assertEquals( 'path/to/new', $listItem->getRefItem()->getUrl() ); |
|
179 | - $this->assertEquals( null, $listItem->getRefItem()->getLanguageId() ); |
|
178 | + $this->assertEquals('path/to/new', $listItem->getRefItem()->getUrl()); |
|
179 | + $this->assertEquals(null, $listItem->getRefItem()->getLanguageId()); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | |
@@ -190,18 +190,18 @@ discard block |
||
190 | 190 | 0 => '/path/to/file', |
191 | 191 | ); |
192 | 192 | |
193 | - $catalog = $this->create( 'job_csv_test' ); |
|
193 | + $catalog = $this->create('job_csv_test'); |
|
194 | 194 | |
195 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
196 | - $object->process( $catalog, $data ); |
|
195 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
196 | + $object->process($catalog, $data); |
|
197 | 197 | |
198 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, [], $this->endpoint ); |
|
199 | - $object->process( $catalog, [] ); |
|
198 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, [], $this->endpoint); |
|
199 | + $object->process($catalog, []); |
|
200 | 200 | |
201 | 201 | |
202 | 202 | $listItems = $catalog->getListItems(); |
203 | 203 | |
204 | - $this->assertEquals( 0, count( $listItems ) ); |
|
204 | + $this->assertEquals(0, count($listItems)); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | |
@@ -217,15 +217,15 @@ discard block |
||
217 | 217 | 1 => '', |
218 | 218 | ); |
219 | 219 | |
220 | - $catalog = $this->create( 'job_csv_test' ); |
|
220 | + $catalog = $this->create('job_csv_test'); |
|
221 | 221 | |
222 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
223 | - $object->process( $catalog, $data ); |
|
222 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
223 | + $object->process($catalog, $data); |
|
224 | 224 | |
225 | 225 | |
226 | 226 | $listItems = $catalog->getListItems(); |
227 | 227 | |
228 | - $this->assertEquals( 1, count( $listItems ) ); |
|
228 | + $this->assertEquals(1, count($listItems)); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | |
@@ -245,26 +245,26 @@ discard block |
||
245 | 245 | 3 => 'default', |
246 | 246 | ); |
247 | 247 | |
248 | - $this->context->getConfig()->set( 'controller/common/catalog/import/csv/processor/media/listtypes', array( 'default' ) ); |
|
248 | + $this->context->getConfig()->set('controller/common/catalog/import/csv/processor/media/listtypes', array('default')); |
|
249 | 249 | |
250 | - $catalog = $this->create( 'job_csv_test' ); |
|
250 | + $catalog = $this->create('job_csv_test'); |
|
251 | 251 | |
252 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
252 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
253 | 253 | |
254 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
255 | - $object->process( $catalog, $data ); |
|
254 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
255 | + $object->process($catalog, $data); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | |
259 | 259 | /** |
260 | 260 | * @param string $code |
261 | 261 | */ |
262 | - protected function create( $code ) |
|
262 | + protected function create($code) |
|
263 | 263 | { |
264 | - $manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context ); |
|
264 | + $manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager($this->context); |
|
265 | 265 | |
266 | 266 | $item = $manager->createItem(); |
267 | - $item->setCode( $code ); |
|
267 | + $item->setCode($code); |
|
268 | 268 | |
269 | 269 | return $item; |
270 | 270 | } |
@@ -17,16 +17,16 @@ discard block |
||
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 = \TestHelperCntl::getContext(); |
23 | - $this->endpoint = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Done( $this->context, [] ); |
|
23 | + $this->endpoint = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Done($this->context, []); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | 27 | protected function tearDown() |
28 | 28 | { |
29 | - \Aimeos\MShop\Factory::setCache( false ); |
|
29 | + \Aimeos\MShop\Factory::setCache(false); |
|
30 | 30 | \Aimeos\MShop\Factory::clear(); |
31 | 31 | } |
32 | 32 | |
@@ -49,31 +49,31 @@ discard block |
||
49 | 49 | 4 => 1, |
50 | 50 | ); |
51 | 51 | |
52 | - $catalog = $this->create( 'job_csv_test' ); |
|
52 | + $catalog = $this->create('job_csv_test'); |
|
53 | 53 | |
54 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
55 | - $object->process( $catalog, $data ); |
|
54 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
55 | + $object->process($catalog, $data); |
|
56 | 56 | |
57 | 57 | |
58 | 58 | $listItems = $catalog->getListItems(); |
59 | - $listItem = reset( $listItems ); |
|
59 | + $listItem = reset($listItems); |
|
60 | 60 | |
61 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
62 | - $this->assertEquals( 1, count( $listItems ) ); |
|
61 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
62 | + $this->assertEquals(1, count($listItems)); |
|
63 | 63 | |
64 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
65 | - $this->assertEquals( 0, $listItem->getPosition() ); |
|
66 | - $this->assertEquals( 'text', $listItem->getDomain() ); |
|
67 | - $this->assertEquals( 'default', $listItem->getType() ); |
|
64 | + $this->assertEquals(1, $listItem->getStatus()); |
|
65 | + $this->assertEquals(0, $listItem->getPosition()); |
|
66 | + $this->assertEquals('text', $listItem->getDomain()); |
|
67 | + $this->assertEquals('default', $listItem->getType()); |
|
68 | 68 | |
69 | 69 | $refItem = $listItem->getRefItem(); |
70 | 70 | |
71 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
72 | - $this->assertEquals( 'name', $refItem->getType() ); |
|
73 | - $this->assertEquals( 'test text', $refItem->getLabel() ); |
|
74 | - $this->assertEquals( 'Job CSV test', $refItem->getContent() ); |
|
75 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
76 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
71 | + $this->assertEquals(1, $refItem->getStatus()); |
|
72 | + $this->assertEquals('name', $refItem->getType()); |
|
73 | + $this->assertEquals('test text', $refItem->getLabel()); |
|
74 | + $this->assertEquals('Job CSV test', $refItem->getContent()); |
|
75 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
76 | + $this->assertEquals(1, $refItem->getStatus()); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | |
@@ -101,27 +101,27 @@ discard block |
||
101 | 101 | 7 => 'Long: Job CSV test 2', |
102 | 102 | ); |
103 | 103 | |
104 | - $catalog = $this->create( 'job_csv_test' ); |
|
104 | + $catalog = $this->create('job_csv_test'); |
|
105 | 105 | |
106 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
107 | - $object->process( $catalog, $data ); |
|
106 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
107 | + $object->process($catalog, $data); |
|
108 | 108 | |
109 | 109 | |
110 | 110 | $pos = 0; |
111 | 111 | $listItems = $catalog->getListItems(); |
112 | 112 | $expected = array( |
113 | - 0 => array( 'name', 'Job CSV test' ), |
|
114 | - 1 => array( 'short', 'Short: Job CSV test' ), |
|
115 | - 2 => array( 'long', 'Long: Job CSV test' ), |
|
116 | - 3 => array( 'long', 'Long: Job CSV test 2' ), |
|
113 | + 0 => array('name', 'Job CSV test'), |
|
114 | + 1 => array('short', 'Short: Job CSV test'), |
|
115 | + 2 => array('long', 'Long: Job CSV test'), |
|
116 | + 3 => array('long', 'Long: Job CSV test 2'), |
|
117 | 117 | ); |
118 | 118 | |
119 | - $this->assertEquals( 4, count( $listItems ) ); |
|
119 | + $this->assertEquals(4, count($listItems)); |
|
120 | 120 | |
121 | - foreach( $listItems as $listItem ) |
|
121 | + foreach ($listItems as $listItem) |
|
122 | 122 | { |
123 | - $this->assertEquals( $expected[$pos][0], $listItem->getRefItem()->getType() ); |
|
124 | - $this->assertEquals( $expected[$pos][1], $listItem->getRefItem()->getContent() ); |
|
123 | + $this->assertEquals($expected[$pos][0], $listItem->getRefItem()->getType()); |
|
124 | + $this->assertEquals($expected[$pos][1], $listItem->getRefItem()->getContent()); |
|
125 | 125 | $pos++; |
126 | 126 | } |
127 | 127 | } |
@@ -144,21 +144,21 @@ discard block |
||
144 | 144 | 1 => 'Short: Job CSV test', |
145 | 145 | ); |
146 | 146 | |
147 | - $catalog = $this->create( 'job_csv_test' ); |
|
147 | + $catalog = $this->create('job_csv_test'); |
|
148 | 148 | |
149 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
150 | - $object->process( $catalog, $data ); |
|
151 | - $object->process( $catalog, $dataUpdate ); |
|
149 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
150 | + $object->process($catalog, $data); |
|
151 | + $object->process($catalog, $dataUpdate); |
|
152 | 152 | |
153 | 153 | |
154 | 154 | $listItems = $catalog->getListItems(); |
155 | - $listItem = reset( $listItems ); |
|
155 | + $listItem = reset($listItems); |
|
156 | 156 | |
157 | - $this->assertEquals( 1, count( $listItems ) ); |
|
158 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
157 | + $this->assertEquals(1, count($listItems)); |
|
158 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
159 | 159 | |
160 | - $this->assertEquals( 'short', $listItem->getRefItem()->getType() ); |
|
161 | - $this->assertEquals( 'Short: Job CSV test', $listItem->getRefItem()->getContent() ); |
|
160 | + $this->assertEquals('short', $listItem->getRefItem()->getType()); |
|
161 | + $this->assertEquals('Short: Job CSV test', $listItem->getRefItem()->getContent()); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | |
@@ -174,18 +174,18 @@ discard block |
||
174 | 174 | 1 => 'Job CSV test', |
175 | 175 | ); |
176 | 176 | |
177 | - $catalog = $this->create( 'job_csv_test' ); |
|
177 | + $catalog = $this->create('job_csv_test'); |
|
178 | 178 | |
179 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
180 | - $object->process( $catalog, $data ); |
|
179 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
180 | + $object->process($catalog, $data); |
|
181 | 181 | |
182 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, [], $this->endpoint ); |
|
183 | - $object->process( $catalog, [] ); |
|
182 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, [], $this->endpoint); |
|
183 | + $object->process($catalog, []); |
|
184 | 184 | |
185 | 185 | |
186 | 186 | $listItems = $catalog->getListItems(); |
187 | 187 | |
188 | - $this->assertEquals( 0, count( $listItems ) ); |
|
188 | + $this->assertEquals(0, count($listItems)); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | |
@@ -205,15 +205,15 @@ discard block |
||
205 | 205 | 3 => '', |
206 | 206 | ); |
207 | 207 | |
208 | - $catalog = $this->create( 'job_csv_test' ); |
|
208 | + $catalog = $this->create('job_csv_test'); |
|
209 | 209 | |
210 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
211 | - $object->process( $catalog, $data ); |
|
210 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
211 | + $object->process($catalog, $data); |
|
212 | 212 | |
213 | 213 | |
214 | 214 | $listItems = $catalog->getListItems(); |
215 | 215 | |
216 | - $this->assertEquals( 1, count( $listItems ) ); |
|
216 | + $this->assertEquals(1, count($listItems)); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -237,26 +237,26 @@ discard block |
||
237 | 237 | 5 => 'default', |
238 | 238 | ); |
239 | 239 | |
240 | - $this->context->getConfig()->set( 'controller/common/catalog/import/csv/processor/text/listtypes', array( 'default' ) ); |
|
240 | + $this->context->getConfig()->set('controller/common/catalog/import/csv/processor/text/listtypes', array('default')); |
|
241 | 241 | |
242 | - $catalog = $this->create( 'job_csv_test' ); |
|
242 | + $catalog = $this->create('job_csv_test'); |
|
243 | 243 | |
244 | - $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard( $this->context, $mapping, $this->endpoint ); |
|
244 | + $object = new \Aimeos\Controller\Common\Catalog\Import\Csv\Processor\Text\Standard($this->context, $mapping, $this->endpoint); |
|
245 | 245 | |
246 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
247 | - $object->process( $catalog, $data ); |
|
246 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
247 | + $object->process($catalog, $data); |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | |
251 | 251 | /** |
252 | 252 | * @param string $code |
253 | 253 | */ |
254 | - protected function create( $code ) |
|
254 | + protected function create($code) |
|
255 | 255 | { |
256 | - $manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager( $this->context ); |
|
256 | + $manager = \Aimeos\MShop\Catalog\Manager\Factory::createManager($this->context); |
|
257 | 257 | |
258 | 258 | $item = $manager->createItem(); |
259 | - $item->setCode( $code ); |
|
259 | + $item->setCode($code); |
|
260 | 260 | |
261 | 261 | return $item; |
262 | 262 | } |
@@ -16,77 +16,77 @@ discard block |
||
16 | 16 | |
17 | 17 | protected function setUp() |
18 | 18 | { |
19 | - \Aimeos\MShop\Factory::setCache( true ); |
|
19 | + \Aimeos\MShop\Factory::setCache(true); |
|
20 | 20 | |
21 | 21 | $context = \TestHelperCntl::getContext(); |
22 | 22 | $aimeos = \TestHelperCntl::getAimeos(); |
23 | 23 | |
24 | - $this->object = new TestAbstract( $context, $aimeos ); |
|
24 | + $this->object = new TestAbstract($context, $aimeos); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | 28 | protected function tearDown() |
29 | 29 | { |
30 | - \Aimeos\MShop\Factory::setCache( false ); |
|
30 | + \Aimeos\MShop\Factory::setCache(false); |
|
31 | 31 | \Aimeos\MShop\Factory::clear(); |
32 | 32 | } |
33 | 33 | |
34 | 34 | |
35 | 35 | public function testGetCache() |
36 | 36 | { |
37 | - $cache = $this->object->getCachePublic( 'attribute' ); |
|
37 | + $cache = $this->object->getCachePublic('attribute'); |
|
38 | 38 | |
39 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Cache\\Iface', $cache ); |
|
39 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Cache\\Iface', $cache); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | 43 | public function testGetCacheInvalidType() |
44 | 44 | { |
45 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
46 | - $this->object->getCachePublic( '$' ); |
|
45 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
46 | + $this->object->getCachePublic('$'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | |
50 | 50 | public function testGetCacheInvalidClass() |
51 | 51 | { |
52 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
53 | - $this->object->getCachePublic( 'unknown' ); |
|
52 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
53 | + $this->object->getCachePublic('unknown'); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | 57 | public function testGetCacheInvalidInterface() |
58 | 58 | { |
59 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
60 | - $this->object->getCachePublic( 'attribute', 'unknown' ); |
|
59 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
60 | + $this->object->getCachePublic('attribute', 'unknown'); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
64 | 64 | public function testGetProcessors() |
65 | 65 | { |
66 | - $processor = $this->object->getProcessorsPublic( array( 'attribute' => [] ) ); |
|
66 | + $processor = $this->object->getProcessorsPublic(array('attribute' => [])); |
|
67 | 67 | |
68 | - $this->assertInstanceOf( '\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Processor\\Iface', $processor ); |
|
68 | + $this->assertInstanceOf('\\Aimeos\\Controller\\Common\\Product\\Import\\Csv\\Processor\\Iface', $processor); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | |
72 | 72 | public function testGetProcessorsInvalidType() |
73 | 73 | { |
74 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
75 | - $this->object->getProcessorsPublic( array( '$' => [] ) ); |
|
74 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
75 | + $this->object->getProcessorsPublic(array('$' => [])); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | |
79 | 79 | public function testGetProcessorsInvalidClass() |
80 | 80 | { |
81 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
82 | - $this->object->getProcessorsPublic( array( 'unknown' => [] ) ); |
|
81 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
82 | + $this->object->getProcessorsPublic(array('unknown' => [])); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | |
86 | 86 | public function testGetProcessorsInvalidInterface() |
87 | 87 | { |
88 | - $this->setExpectedException( '\\Aimeos\\Controller\\Jobs\\Exception' ); |
|
89 | - $this->object->getProcessorsPublic( array( 'unknown' => [] ) ); |
|
88 | + $this->setExpectedException('\\Aimeos\\Controller\\Jobs\\Exception'); |
|
89 | + $this->object->getProcessorsPublic(array('unknown' => [])); |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
@@ -99,15 +99,15 @@ discard block |
||
99 | 99 | return \TestHelperCntl::getContext(); |
100 | 100 | } |
101 | 101 | |
102 | - public function getCachePublic( $type, $name = null ) |
|
102 | + public function getCachePublic($type, $name = null) |
|
103 | 103 | { |
104 | - return $this->getCache( $type, $name ); |
|
104 | + return $this->getCache($type, $name); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | |
108 | - public function getProcessorsPublic( array $mappings ) |
|
108 | + public function getProcessorsPublic(array $mappings) |
|
109 | 109 | { |
110 | - return $this->getProcessors( $mappings ); |
|
110 | + return $this->getProcessors($mappings); |
|
111 | 111 | } |
112 | 112 | } |
113 | 113 |
@@ -17,16 +17,16 @@ discard block |
||
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 = \TestHelperCntl::getContext(); |
23 | - $this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done( $this->context, [] ); |
|
23 | + $this->endpoint = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Done($this->context, []); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
27 | 27 | protected function tearDown() |
28 | 28 | { |
29 | - \Aimeos\MShop\Factory::setCache( false ); |
|
29 | + \Aimeos\MShop\Factory::setCache(false); |
|
30 | 30 | \Aimeos\MShop\Factory::clear(); |
31 | 31 | } |
32 | 32 | |
@@ -51,31 +51,31 @@ discard block |
||
51 | 51 | 5 => 1, |
52 | 52 | ); |
53 | 53 | |
54 | - $product = $this->create( 'job_csv_test' ); |
|
54 | + $product = $this->create('job_csv_test'); |
|
55 | 55 | |
56 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
57 | - $object->process( $product, $data ); |
|
56 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
57 | + $object->process($product, $data); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | $listItems = $product->getListItems(); |
61 | - $listItem = reset( $listItems ); |
|
61 | + $listItem = reset($listItems); |
|
62 | 62 | |
63 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
64 | - $this->assertEquals( 1, count( $listItems ) ); |
|
63 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
64 | + $this->assertEquals(1, count($listItems)); |
|
65 | 65 | |
66 | - $this->assertEquals( 1, $listItem->getStatus() ); |
|
67 | - $this->assertEquals( 0, $listItem->getPosition() ); |
|
68 | - $this->assertEquals( 'default', $listItem->getType() ); |
|
66 | + $this->assertEquals(1, $listItem->getStatus()); |
|
67 | + $this->assertEquals(0, $listItem->getPosition()); |
|
68 | + $this->assertEquals('default', $listItem->getType()); |
|
69 | 69 | |
70 | 70 | $refItem = $listItem->getRefItem(); |
71 | 71 | |
72 | - $this->assertEquals( 1, $refItem->getStatus() ); |
|
73 | - $this->assertEquals( 'default', $refItem->getType() ); |
|
74 | - $this->assertEquals( 'test image', $refItem->getLabel() ); |
|
75 | - $this->assertEquals( 'image/jpeg', $refItem->getMimetype() ); |
|
76 | - $this->assertEquals( 'path/to/preview', $refItem->getPreview() ); |
|
77 | - $this->assertEquals( 'path/to/file', $refItem->getUrl() ); |
|
78 | - $this->assertEquals( 'de', $refItem->getLanguageId() ); |
|
72 | + $this->assertEquals(1, $refItem->getStatus()); |
|
73 | + $this->assertEquals('default', $refItem->getType()); |
|
74 | + $this->assertEquals('test image', $refItem->getLabel()); |
|
75 | + $this->assertEquals('image/jpeg', $refItem->getMimetype()); |
|
76 | + $this->assertEquals('path/to/preview', $refItem->getPreview()); |
|
77 | + $this->assertEquals('path/to/file', $refItem->getUrl()); |
|
78 | + $this->assertEquals('de', $refItem->getLanguageId()); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | |
@@ -89,21 +89,21 @@ discard block |
||
89 | 89 | 0 => "path/to/0\npath/to/1\npath/to/2\npath/to/3", |
90 | 90 | ); |
91 | 91 | |
92 | - $product = $this->create( 'job_csv_test' ); |
|
92 | + $product = $this->create('job_csv_test'); |
|
93 | 93 | |
94 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
95 | - $object->process( $product, $data ); |
|
94 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
95 | + $object->process($product, $data); |
|
96 | 96 | |
97 | 97 | |
98 | 98 | $pos = 0; |
99 | 99 | $listItems = $product->getListItems(); |
100 | - $expected = array( 'path/to/0', 'path/to/1', 'path/to/2', 'path/to/3' ); |
|
100 | + $expected = array('path/to/0', 'path/to/1', 'path/to/2', 'path/to/3'); |
|
101 | 101 | |
102 | - $this->assertEquals( 4, count( $listItems ) ); |
|
102 | + $this->assertEquals(4, count($listItems)); |
|
103 | 103 | |
104 | - foreach( $listItems as $listItem ) |
|
104 | + foreach ($listItems as $listItem) |
|
105 | 105 | { |
106 | - $this->assertEquals( $expected[$pos], $listItem->getRefItem()->getUrl() ); |
|
106 | + $this->assertEquals($expected[$pos], $listItem->getRefItem()->getUrl()); |
|
107 | 107 | $pos++; |
108 | 108 | } |
109 | 109 | } |
@@ -125,20 +125,20 @@ discard block |
||
125 | 125 | 3 => 'path/to/3', |
126 | 126 | ); |
127 | 127 | |
128 | - $product = $this->create( 'job_csv_test' ); |
|
128 | + $product = $this->create('job_csv_test'); |
|
129 | 129 | |
130 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
131 | - $object->process( $product, $data ); |
|
130 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
131 | + $object->process($product, $data); |
|
132 | 132 | |
133 | 133 | |
134 | 134 | $pos = 0; |
135 | 135 | $listItems = $product->getListItems(); |
136 | 136 | |
137 | - $this->assertEquals( 4, count( $listItems ) ); |
|
137 | + $this->assertEquals(4, count($listItems)); |
|
138 | 138 | |
139 | - foreach( $listItems as $listItem ) |
|
139 | + foreach ($listItems as $listItem) |
|
140 | 140 | { |
141 | - $this->assertEquals( $data[$pos], $listItem->getRefItem()->getUrl() ); |
|
141 | + $this->assertEquals($data[$pos], $listItem->getRefItem()->getUrl()); |
|
142 | 142 | $pos++; |
143 | 143 | } |
144 | 144 | } |
@@ -161,21 +161,21 @@ discard block |
||
161 | 161 | 1 => '', |
162 | 162 | ); |
163 | 163 | |
164 | - $product = $this->create( 'job_csv_test' ); |
|
164 | + $product = $this->create('job_csv_test'); |
|
165 | 165 | |
166 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
167 | - $object->process( $product, $data ); |
|
168 | - $object->process( $product, $dataUpdate ); |
|
166 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
167 | + $object->process($product, $data); |
|
168 | + $object->process($product, $dataUpdate); |
|
169 | 169 | |
170 | 170 | |
171 | 171 | $listItems = $product->getListItems(); |
172 | - $listItem = reset( $listItems ); |
|
172 | + $listItem = reset($listItems); |
|
173 | 173 | |
174 | - $this->assertEquals( 1, count( $listItems ) ); |
|
175 | - $this->assertInstanceOf( '\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem ); |
|
174 | + $this->assertEquals(1, count($listItems)); |
|
175 | + $this->assertInstanceOf('\\Aimeos\\MShop\\Common\\Item\\Lists\\Iface', $listItem); |
|
176 | 176 | |
177 | - $this->assertEquals( 'path/to/new', $listItem->getRefItem()->getUrl() ); |
|
178 | - $this->assertEquals( null, $listItem->getRefItem()->getLanguageId() ); |
|
177 | + $this->assertEquals('path/to/new', $listItem->getRefItem()->getUrl()); |
|
178 | + $this->assertEquals(null, $listItem->getRefItem()->getLanguageId()); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | |
@@ -189,18 +189,18 @@ discard block |
||
189 | 189 | 0 => '/path/to/file', |
190 | 190 | ); |
191 | 191 | |
192 | - $product = $this->create( 'job_csv_test' ); |
|
192 | + $product = $this->create('job_csv_test'); |
|
193 | 193 | |
194 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
195 | - $object->process( $product, $data ); |
|
194 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
195 | + $object->process($product, $data); |
|
196 | 196 | |
197 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, [], $this->endpoint ); |
|
198 | - $object->process( $product, [] ); |
|
197 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, [], $this->endpoint); |
|
198 | + $object->process($product, []); |
|
199 | 199 | |
200 | 200 | |
201 | 201 | $listItems = $product->getListItems(); |
202 | 202 | |
203 | - $this->assertEquals( 0, count( $listItems ) ); |
|
203 | + $this->assertEquals(0, count($listItems)); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | |
@@ -216,15 +216,15 @@ discard block |
||
216 | 216 | 1 => '', |
217 | 217 | ); |
218 | 218 | |
219 | - $product = $this->create( 'job_csv_test' ); |
|
219 | + $product = $this->create('job_csv_test'); |
|
220 | 220 | |
221 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
222 | - $object->process( $product, $data ); |
|
221 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
222 | + $object->process($product, $data); |
|
223 | 223 | |
224 | 224 | |
225 | 225 | $listItems = $product->getListItems(); |
226 | 226 | |
227 | - $this->assertEquals( 1, count( $listItems ) ); |
|
227 | + $this->assertEquals(1, count($listItems)); |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | |
@@ -244,23 +244,23 @@ discard block |
||
244 | 244 | 3 => 'default', |
245 | 245 | ); |
246 | 246 | |
247 | - $this->context->getConfig()->set( 'controller/common/product/import/csv/processor/media/listtypes', array( 'default' ) ); |
|
247 | + $this->context->getConfig()->set('controller/common/product/import/csv/processor/media/listtypes', array('default')); |
|
248 | 248 | |
249 | - $product = $this->create( 'job_csv_test' ); |
|
249 | + $product = $this->create('job_csv_test'); |
|
250 | 250 | |
251 | - $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard( $this->context, $mapping, $this->endpoint ); |
|
251 | + $object = new \Aimeos\Controller\Common\Product\Import\Csv\Processor\Media\Standard($this->context, $mapping, $this->endpoint); |
|
252 | 252 | |
253 | - $this->setExpectedException( '\Aimeos\Controller\Common\Exception' ); |
|
254 | - $object->process( $product, $data ); |
|
253 | + $this->setExpectedException('\Aimeos\Controller\Common\Exception'); |
|
254 | + $object->process($product, $data); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | |
258 | 258 | /** |
259 | 259 | * @param string $code |
260 | 260 | */ |
261 | - protected function create( $code ) |
|
261 | + protected function create($code) |
|
262 | 262 | { |
263 | - $manager = \Aimeos\MShop\Product\Manager\Factory::createManager( $this->context ); |
|
264 | - return $manager->createItem()->setCode( $code ); |
|
263 | + $manager = \Aimeos\MShop\Product\Manager\Factory::createManager($this->context); |
|
264 | + return $manager->createItem()->setCode($code); |
|
265 | 265 | } |
266 | 266 | } |
267 | 267 | \ No newline at end of file |