Completed
Push — master ( 0b1729...545b8f )
by Aimeos
01:57
created
Controller/Common/Subscription/Process/Processor/Cgroup/StandardTest.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@  discard block
 block discarded – undo
12 12
 {
13 13
 	protected function setUp()
14 14
 	{
15
-		\Aimeos\MShop::cache( true );
15
+		\Aimeos\MShop::cache(true);
16 16
 	}
17 17
 
18 18
 
19 19
 	protected function tearDown()
20 20
 	{
21
-		\Aimeos\MShop::cache( false );
21
+		\Aimeos\MShop::cache(false);
22 22
 	}
23 23
 
24 24
 
@@ -26,29 +26,29 @@  discard block
 block discarded – undo
26 26
 	{
27 27
 		$context = \TestHelperCntl::getContext();
28 28
 
29
-		$context->getConfig()->set( 'controller/common/subscription/process/processor/cgroup/groupids', ['1', '2'] );
29
+		$context->getConfig()->set('controller/common/subscription/process/processor/cgroup/groupids', ['1', '2']);
30 30
 
31
-		$fcn = function( $subject ){
31
+		$fcn = function($subject) {
32 32
 			return $subject->getGroups() === ['1', '2'];
33 33
 		};
34 34
 
35
-		$customerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
36
-			->setConstructorArgs( [$context] )
37
-			->setMethods( ['getItem', 'saveItem'] )
35
+		$customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard')
36
+			->setConstructorArgs([$context])
37
+			->setMethods(['getItem', 'saveItem'])
38 38
 			->getMock();
39 39
 
40
-		\Aimeos\MShop::inject( $context, 'customer', $customerStub );
40
+		\Aimeos\MShop::inject($context, 'customer', $customerStub);
41 41
 
42 42
 		$customerItem = $customerStub->createItem();
43 43
 
44
-		$customerStub->expects( $this->once() )->method( 'getItem' )
45
-			->will( $this->returnValue( $customerItem ) );
44
+		$customerStub->expects($this->once())->method('getItem')
45
+			->will($this->returnValue($customerItem));
46 46
 
47
-		$customerStub->expects( $this->once() )->method( 'saveItem' )
48
-			->with( $this->callback( $fcn ) );
47
+		$customerStub->expects($this->once())->method('saveItem')
48
+			->with($this->callback($fcn));
49 49
 
50
-		$object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard( $context );
51
-		$object->begin( $this->getSubscription( $context ) );
50
+		$object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard($context);
51
+		$object->begin($this->getSubscription($context));
52 52
 	}
53 53
 
54 54
 
@@ -56,45 +56,45 @@  discard block
 block discarded – undo
56 56
 	{
57 57
 		$context = \TestHelperCntl::getContext();
58 58
 
59
-		$context->getConfig()->set( 'controller/common/subscription/process/processor/cgroup/groupids', ['1', '2'] );
59
+		$context->getConfig()->set('controller/common/subscription/process/processor/cgroup/groupids', ['1', '2']);
60 60
 
61
-		$fcn = function( $subject ){
61
+		$fcn = function($subject) {
62 62
 			return $subject->getGroups() === [];
63 63
 		};
64 64
 
65
-		$customerStub = $this->getMockBuilder( '\\Aimeos\\MShop\\Customer\\Manager\\Standard' )
66
-			->setConstructorArgs( [$context] )
67
-			->setMethods( ['getItem', 'saveItem'] )
65
+		$customerStub = $this->getMockBuilder('\\Aimeos\\MShop\\Customer\\Manager\\Standard')
66
+			->setConstructorArgs([$context])
67
+			->setMethods(['getItem', 'saveItem'])
68 68
 			->getMock();
69 69
 
70
-		\Aimeos\MShop::inject( $context, 'customer', $customerStub );
70
+		\Aimeos\MShop::inject($context, 'customer', $customerStub);
71 71
 
72
-		$customerItem = $customerStub->createItem()->setGroups( ['1', '2'] );
72
+		$customerItem = $customerStub->createItem()->setGroups(['1', '2']);
73 73
 
74
-		$customerStub->expects( $this->once() )->method( 'getItem' )
75
-			->will( $this->returnValue( $customerItem ) );
74
+		$customerStub->expects($this->once())->method('getItem')
75
+			->will($this->returnValue($customerItem));
76 76
 
77
-		$customerStub->expects( $this->once() )->method( 'saveItem' )
78
-			->with( $this->callback( $fcn ) );
77
+		$customerStub->expects($this->once())->method('saveItem')
78
+			->with($this->callback($fcn));
79 79
 
80
-		$object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard( $context );
81
-		$object->end( $this->getSubscription( $context ) );
80
+		$object = new \Aimeos\Controller\Common\Subscription\Process\Processor\Cgroup\Standard($context);
81
+		$object->end($this->getSubscription($context));
82 82
 	}
83 83
 
84 84
 
85
-	protected function getSubscription( $context )
85
+	protected function getSubscription($context)
86 86
 	{
87
-		$manager = \Aimeos\MShop::create( $context, 'subscription' );
87
+		$manager = \Aimeos\MShop::create($context, 'subscription');
88 88
 
89 89
 		$search = $manager->createSearch();
90
-		$search->setConditions( $search->compare( '==', 'subscription.dateend', '2010-01-01' ) );
90
+		$search->setConditions($search->compare('==', 'subscription.dateend', '2010-01-01'));
91 91
 
92
-		$items = $manager->searchItems( $search );
92
+		$items = $manager->searchItems($search);
93 93
 
94
-		if( ( $item = reset( $items ) ) !== false ) {
94
+		if (($item = reset($items)) !== false) {
95 95
 			return $item;
96 96
 		}
97 97
 
98
-		throw new \Exception( 'No subscription item found' );
98
+		throw new \Exception('No subscription item found');
99 99
 	}
100 100
 }
Please login to merge, or discard this patch.
tests/Controller/Common/Order/Export/Csv/Processor/Invoice/StandardTest.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -34,50 +34,50 @@
 block discarded – undo
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::create( $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::create($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::create( $context, 'order' );
70
+		$manager = \Aimeos\MShop::create($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
 }
Please login to merge, or discard this patch.
tests/Controller/Common/Order/Export/Csv/Processor/Product/StandardTest.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -35,51 +35,51 @@
 block discarded – undo
35 35
 		);
36 36
 
37 37
 
38
-		$object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Product\Standard( $context, $mapping );
39
-
40
-		$invoice = $this->getInvoice( $context );
41
-		$order = \Aimeos\MShop::create( $context, 'order/base' )->load( $invoice->getBaseId() );
42
-
43
-		$data = $object->process( $invoice, $order );
44
-
45
-
46
-		$this->assertEquals( 4, count( $data ) );
47
-
48
-		$this->assertEquals( 18, count( $data[0] ) );
49
-		$this->assertEquals( 'default', $data[0][0] );
50
-		$this->assertEquals( 'unit_type1', $data[0][1] );
51
-		$this->assertEquals( 'unitsupplier', $data[0][2] );
52
-		$this->assertEquals( 'CNE', $data[0][3] );
53
-		$this->assertGreaterThan( 0, $data[0][4] );
54
-		$this->assertEquals( '9', $data[0][5] );
55
-		$this->assertEquals( 'Cafe Noire Expresso', $data[0][6] );
56
-		$this->assertEquals( 'somewhere/thump1.jpg', $data[0][7] );
57
-		$this->assertEquals( '4.50', $data[0][8] );
58
-		$this->assertEquals( '0.00', $data[0][9] );
59
-		$this->assertEquals( '0.00', $data[0][10] );
60
-		$this->assertEquals( '0.0000', $data[0][11] );
61
-		$this->assertEquals( '1', $data[0][12] );
62
-		$this->assertEquals( '1', $data[0][13] );
63
-		$this->assertEquals( "default\ndefault\nconfig", $data[0][14] );
64
-		$this->assertEquals( "width\nlength\ninterval", $data[0][15] );
65
-		$this->assertEquals( "33\n36\nP0Y1M0W0D", $data[0][16] );
66
-		$this->assertEquals( "33\n36\nP0Y1M0W0D", $data[0][17] );
38
+		$object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Product\Standard($context, $mapping);
39
+
40
+		$invoice = $this->getInvoice($context);
41
+		$order = \Aimeos\MShop::create($context, 'order/base')->load($invoice->getBaseId());
42
+
43
+		$data = $object->process($invoice, $order);
44
+
45
+
46
+		$this->assertEquals(4, count($data));
47
+
48
+		$this->assertEquals(18, count($data[0]));
49
+		$this->assertEquals('default', $data[0][0]);
50
+		$this->assertEquals('unit_type1', $data[0][1]);
51
+		$this->assertEquals('unitsupplier', $data[0][2]);
52
+		$this->assertEquals('CNE', $data[0][3]);
53
+		$this->assertGreaterThan(0, $data[0][4]);
54
+		$this->assertEquals('9', $data[0][5]);
55
+		$this->assertEquals('Cafe Noire Expresso', $data[0][6]);
56
+		$this->assertEquals('somewhere/thump1.jpg', $data[0][7]);
57
+		$this->assertEquals('4.50', $data[0][8]);
58
+		$this->assertEquals('0.00', $data[0][9]);
59
+		$this->assertEquals('0.00', $data[0][10]);
60
+		$this->assertEquals('0.0000', $data[0][11]);
61
+		$this->assertEquals('1', $data[0][12]);
62
+		$this->assertEquals('1', $data[0][13]);
63
+		$this->assertEquals("default\ndefault\nconfig", $data[0][14]);
64
+		$this->assertEquals("width\nlength\ninterval", $data[0][15]);
65
+		$this->assertEquals("33\n36\nP0Y1M0W0D", $data[0][16]);
66
+		$this->assertEquals("33\n36\nP0Y1M0W0D", $data[0][17]);
67 67
 	}
68 68
 
69 69
 
70
-	protected function getInvoice( $context )
70
+	protected function getInvoice($context)
71 71
 	{
72
-		$manager = \Aimeos\MShop::create( $context, 'order' );
72
+		$manager = \Aimeos\MShop::create($context, 'order');
73 73
 
74 74
 		$search = $manager->createSearch();
75
-		$search->setConditions( $search->compare( '==', 'order.datepayment', '2008-02-15 12:34:56' ) );
75
+		$search->setConditions($search->compare('==', 'order.datepayment', '2008-02-15 12:34:56'));
76 76
 
77
-		$items = $manager->searchItems( $search );
77
+		$items = $manager->searchItems($search);
78 78
 
79
-		if( ( $item = reset( $items ) ) !== false ) {
79
+		if (($item = reset($items)) !== false) {
80 80
 			return $item;
81 81
 		}
82 82
 
83
-		throw new \Exception( 'No order item found' );
83
+		throw new \Exception('No order item found');
84 84
 	}
85 85
 }
Please login to merge, or discard this patch.
tests/Controller/Common/Order/Export/Csv/Processor/Service/StandardTest.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -29,59 +29,59 @@
 block discarded – undo
29 29
 		);
30 30
 
31 31
 
32
-		$object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Service\Standard( $context, $mapping );
33
-
34
-		$invoice = $this->getInvoice( $context );
35
-		$order = \Aimeos\MShop::create( $context, 'order/base' )->load( $invoice->getBaseId() );
36
-
37
-		$data = $object->process( $invoice, $order );
38
-
39
-
40
-		$this->assertEquals( 2, count( $data ) );
41
-
42
-		$this->assertEquals( 12, count( $data[0] ) );
43
-		$this->assertEquals( 'payment', $data[0][0] );
44
-		$this->assertEquals( 'OGONE', $data[0][1] );
45
-		$this->assertEquals( 'ogone', $data[0][2] );
46
-		$this->assertEquals( 'somewhere/thump1.jpg', $data[0][3] );
47
-		$this->assertEquals( '0.00', $data[0][4] );
48
-		$this->assertEquals( '0.00', $data[0][5] );
49
-		$this->assertEquals( '0.00', $data[0][6] );
50
-		$this->assertEquals( '0.0000', $data[0][7] );
51
-		$this->assertEquals( "payment\npayment\npayment\npayment\npayment\npayment\npayment\npayment\npayment", $data[0][8] );
52
-		$this->assertEquals( "ACOWNER\nACSTRING\nNAME\nOgone-alias-name\nOgone-alias-value\nREFID\nTXDATE\nX-ACCOUNT\nX-STATUS", $data[0][9] );
53
-		$this->assertEquals( "account owner\naccount number\npayment method\nogone alias name\nogone alias value\nreference id\ntransaction date\ntransaction account\ntransaction status", $data[0][10] );
54
-		$this->assertEquals( "test user\n9876543\nCreditCard\naliasName\naliasValue\n12345678\n2009-08-18\nKraft02\n9", $data[0][11] );
55
-
56
-		$this->assertEquals( 12, count( $data[1] ) );
57
-		$this->assertEquals( 'delivery', $data[1][0] );
58
-		$this->assertEquals( '73', $data[1][1] );
59
-		$this->assertEquals( 'solucia', $data[1][2] );
60
-		$this->assertEquals( 'somewhere/thump1.jpg', $data[1][3] );
61
-		$this->assertEquals( '0.00', $data[1][4] );
62
-		$this->assertEquals( '5.00', $data[1][5] );
63
-		$this->assertEquals( '0.00', $data[1][6] );
64
-		$this->assertEquals( '0.0000', $data[1][7] );
65
-		$this->assertEquals( '', $data[1][8] );
66
-		$this->assertEquals( '', $data[1][9] );
67
-		$this->assertEquals( '', $data[1][10] );
68
-		$this->assertEquals( '', $data[1][11] );
32
+		$object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Service\Standard($context, $mapping);
33
+
34
+		$invoice = $this->getInvoice($context);
35
+		$order = \Aimeos\MShop::create($context, 'order/base')->load($invoice->getBaseId());
36
+
37
+		$data = $object->process($invoice, $order);
38
+
39
+
40
+		$this->assertEquals(2, count($data));
41
+
42
+		$this->assertEquals(12, count($data[0]));
43
+		$this->assertEquals('payment', $data[0][0]);
44
+		$this->assertEquals('OGONE', $data[0][1]);
45
+		$this->assertEquals('ogone', $data[0][2]);
46
+		$this->assertEquals('somewhere/thump1.jpg', $data[0][3]);
47
+		$this->assertEquals('0.00', $data[0][4]);
48
+		$this->assertEquals('0.00', $data[0][5]);
49
+		$this->assertEquals('0.00', $data[0][6]);
50
+		$this->assertEquals('0.0000', $data[0][7]);
51
+		$this->assertEquals("payment\npayment\npayment\npayment\npayment\npayment\npayment\npayment\npayment", $data[0][8]);
52
+		$this->assertEquals("ACOWNER\nACSTRING\nNAME\nOgone-alias-name\nOgone-alias-value\nREFID\nTXDATE\nX-ACCOUNT\nX-STATUS", $data[0][9]);
53
+		$this->assertEquals("account owner\naccount number\npayment method\nogone alias name\nogone alias value\nreference id\ntransaction date\ntransaction account\ntransaction status", $data[0][10]);
54
+		$this->assertEquals("test user\n9876543\nCreditCard\naliasName\naliasValue\n12345678\n2009-08-18\nKraft02\n9", $data[0][11]);
55
+
56
+		$this->assertEquals(12, count($data[1]));
57
+		$this->assertEquals('delivery', $data[1][0]);
58
+		$this->assertEquals('73', $data[1][1]);
59
+		$this->assertEquals('solucia', $data[1][2]);
60
+		$this->assertEquals('somewhere/thump1.jpg', $data[1][3]);
61
+		$this->assertEquals('0.00', $data[1][4]);
62
+		$this->assertEquals('5.00', $data[1][5]);
63
+		$this->assertEquals('0.00', $data[1][6]);
64
+		$this->assertEquals('0.0000', $data[1][7]);
65
+		$this->assertEquals('', $data[1][8]);
66
+		$this->assertEquals('', $data[1][9]);
67
+		$this->assertEquals('', $data[1][10]);
68
+		$this->assertEquals('', $data[1][11]);
69 69
 	}
70 70
 
71 71
 
72
-	protected function getInvoice( $context )
72
+	protected function getInvoice($context)
73 73
 	{
74
-		$manager = \Aimeos\MShop::create( $context, 'order' );
74
+		$manager = \Aimeos\MShop::create($context, 'order');
75 75
 
76 76
 		$search = $manager->createSearch();
77
-		$search->setConditions( $search->compare( '==', 'order.datepayment', '2008-02-15 12:34:56' ) );
77
+		$search->setConditions($search->compare('==', 'order.datepayment', '2008-02-15 12:34:56'));
78 78
 
79
-		$items = $manager->searchItems( $search );
79
+		$items = $manager->searchItems($search);
80 80
 
81
-		if( ( $item = reset( $items ) ) !== false ) {
81
+		if (($item = reset($items)) !== false) {
82 82
 			return $item;
83 83
 		}
84 84
 
85
-		throw new \Exception( 'No order item found' );
85
+		throw new \Exception('No order item found');
86 86
 	}
87 87
 }
Please login to merge, or discard this patch.
tests/Controller/Common/Order/Export/Csv/Processor/Coupon/StandardTest.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -18,37 +18,37 @@
 block discarded – undo
18 18
 		);
19 19
 
20 20
 
21
-		$object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Coupon\Standard( $context, $mapping );
21
+		$object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Coupon\Standard($context, $mapping);
22 22
 
23
-		$invoice = $this->getInvoice( $context );
24
-		$order = \Aimeos\MShop::create( $context, 'order/base' )->load( $invoice->getBaseId() );
23
+		$invoice = $this->getInvoice($context);
24
+		$order = \Aimeos\MShop::create($context, 'order/base')->load($invoice->getBaseId());
25 25
 
26
-		$data = $object->process( $invoice, $order );
26
+		$data = $object->process($invoice, $order);
27 27
 
28 28
 
29
-		$this->assertEquals( 2, count( $data ) );
29
+		$this->assertEquals(2, count($data));
30 30
 
31
-		$this->assertEquals( 1, count( $data[0] ) );
32
-		$this->assertEquals( '5678', $data[0][0] );
31
+		$this->assertEquals(1, count($data[0]));
32
+		$this->assertEquals('5678', $data[0][0]);
33 33
 
34
-		$this->assertEquals( 1, count( $data[1] ) );
35
-		$this->assertEquals( 'OPQR', $data[1][0] );
34
+		$this->assertEquals(1, count($data[1]));
35
+		$this->assertEquals('OPQR', $data[1][0]);
36 36
 	}
37 37
 
38 38
 
39
-	protected function getInvoice( $context )
39
+	protected function getInvoice($context)
40 40
 	{
41
-		$manager = \Aimeos\MShop::create( $context, 'order' );
41
+		$manager = \Aimeos\MShop::create($context, 'order');
42 42
 
43 43
 		$search = $manager->createSearch();
44
-		$search->setConditions( $search->compare( '==', 'order.datepayment', '2008-02-15 12:34:56' ) );
44
+		$search->setConditions($search->compare('==', 'order.datepayment', '2008-02-15 12:34:56'));
45 45
 
46
-		$items = $manager->searchItems( $search );
46
+		$items = $manager->searchItems($search);
47 47
 
48
-		if( ( $item = reset( $items ) ) !== false ) {
48
+		if (($item = reset($items)) !== false) {
49 49
 			return $item;
50 50
 		}
51 51
 
52
-		throw new \Exception( 'No order item found' );
52
+		throw new \Exception('No order item found');
53 53
 	}
54 54
 }
Please login to merge, or discard this patch.
tests/Controller/Common/Order/Export/Csv/Processor/Address/StandardTest.php 1 patch
Spacing   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -38,77 +38,77 @@
 block discarded – undo
38 38
 		);
39 39
 
40 40
 
41
-		$object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Address\Standard( $context, $mapping );
42
-
43
-		$invoice = $this->getInvoice( $context );
44
-		$order = \Aimeos\MShop::create( $context, 'order/base' )->load( $invoice->getBaseId() );
45
-
46
-		$data = $object->process( $invoice, $order );
47
-
48
-
49
-		$this->assertEquals( 2, count( $data ) );
50
-
51
-		$this->assertEquals( 21, count( $data[0] ) );
52
-		$this->assertEquals( 'payment', $data[0][0] );
53
-		$this->assertEquals( 'mr', $data[0][1] );
54
-		$this->assertEquals( '', $data[0][2] );
55
-		$this->assertEquals( '', $data[0][3] );
56
-		$this->assertEquals( '', $data[0][4] );
57
-		$this->assertEquals( 'Our', $data[0][5] );
58
-		$this->assertEquals( 'Unittest', $data[0][6] );
59
-		$this->assertEquals( 'Durchschnitt', $data[0][7] );
60
-		$this->assertEquals( '1', $data[0][8] );
61
-		$this->assertEquals( '', $data[0][9] );
62
-		$this->assertEquals( '20146', $data[0][10] );
63
-		$this->assertEquals( 'Hamburg', $data[0][11] );
64
-		$this->assertEquals( 'Hamburg', $data[0][12] );
65
-		$this->assertEquals( 'DE', $data[0][13] );
66
-		$this->assertEquals( 'de', $data[0][14] );
67
-		$this->assertEquals( '055544332211', $data[0][15] );
68
-		$this->assertEquals( '055544332213', $data[0][16] );
69
-		$this->assertEquals( '[email protected]', $data[0][17] );
70
-		$this->assertEquals( 'www.metaways.net', $data[0][18] );
71
-		$this->assertEquals( '11.000000', $data[0][19] );
72
-		$this->assertEquals( '52.000000', $data[0][20] );
73
-
74
-		$this->assertEquals( 21, count( $data[1] ) );
75
-		$this->assertEquals( 'delivery', $data[1][0] );
76
-		$this->assertEquals( 'mr', $data[1][1] );
77
-		$this->assertEquals( 'Example company', $data[1][2] );
78
-		$this->assertEquals( 'DE999999999', $data[1][3] );
79
-		$this->assertEquals( 'Dr.', $data[1][4] );
80
-		$this->assertEquals( 'Our', $data[1][5] );
81
-		$this->assertEquals( 'Unittest', $data[1][6] );
82
-		$this->assertEquals( 'Pickhuben', $data[1][7] );
83
-		$this->assertEquals( '2-4', $data[1][8] );
84
-		$this->assertEquals( '', $data[1][9] );
85
-		$this->assertEquals( '20457', $data[1][10] );
86
-		$this->assertEquals( 'Hamburg', $data[1][11] );
87
-		$this->assertEquals( 'Hamburg', $data[1][12] );
88
-		$this->assertEquals( 'DE', $data[1][13] );
89
-		$this->assertEquals( 'de', $data[1][14] );
90
-		$this->assertEquals( '055544332211', $data[1][15] );
91
-		$this->assertEquals( '055544332212', $data[1][16] );
92
-		$this->assertEquals( '[email protected]', $data[1][17] );
93
-		$this->assertEquals( 'www.example.com', $data[1][18] );
94
-		$this->assertEquals( '10.000000', $data[1][19] );
95
-		$this->assertEquals( '50.000000', $data[1][20] );
41
+		$object = new \Aimeos\Controller\Common\Order\Export\Csv\Processor\Address\Standard($context, $mapping);
42
+
43
+		$invoice = $this->getInvoice($context);
44
+		$order = \Aimeos\MShop::create($context, 'order/base')->load($invoice->getBaseId());
45
+
46
+		$data = $object->process($invoice, $order);
47
+
48
+
49
+		$this->assertEquals(2, count($data));
50
+
51
+		$this->assertEquals(21, count($data[0]));
52
+		$this->assertEquals('payment', $data[0][0]);
53
+		$this->assertEquals('mr', $data[0][1]);
54
+		$this->assertEquals('', $data[0][2]);
55
+		$this->assertEquals('', $data[0][3]);
56
+		$this->assertEquals('', $data[0][4]);
57
+		$this->assertEquals('Our', $data[0][5]);
58
+		$this->assertEquals('Unittest', $data[0][6]);
59
+		$this->assertEquals('Durchschnitt', $data[0][7]);
60
+		$this->assertEquals('1', $data[0][8]);
61
+		$this->assertEquals('', $data[0][9]);
62
+		$this->assertEquals('20146', $data[0][10]);
63
+		$this->assertEquals('Hamburg', $data[0][11]);
64
+		$this->assertEquals('Hamburg', $data[0][12]);
65
+		$this->assertEquals('DE', $data[0][13]);
66
+		$this->assertEquals('de', $data[0][14]);
67
+		$this->assertEquals('055544332211', $data[0][15]);
68
+		$this->assertEquals('055544332213', $data[0][16]);
69
+		$this->assertEquals('[email protected]', $data[0][17]);
70
+		$this->assertEquals('www.metaways.net', $data[0][18]);
71
+		$this->assertEquals('11.000000', $data[0][19]);
72
+		$this->assertEquals('52.000000', $data[0][20]);
73
+
74
+		$this->assertEquals(21, count($data[1]));
75
+		$this->assertEquals('delivery', $data[1][0]);
76
+		$this->assertEquals('mr', $data[1][1]);
77
+		$this->assertEquals('Example company', $data[1][2]);
78
+		$this->assertEquals('DE999999999', $data[1][3]);
79
+		$this->assertEquals('Dr.', $data[1][4]);
80
+		$this->assertEquals('Our', $data[1][5]);
81
+		$this->assertEquals('Unittest', $data[1][6]);
82
+		$this->assertEquals('Pickhuben', $data[1][7]);
83
+		$this->assertEquals('2-4', $data[1][8]);
84
+		$this->assertEquals('', $data[1][9]);
85
+		$this->assertEquals('20457', $data[1][10]);
86
+		$this->assertEquals('Hamburg', $data[1][11]);
87
+		$this->assertEquals('Hamburg', $data[1][12]);
88
+		$this->assertEquals('DE', $data[1][13]);
89
+		$this->assertEquals('de', $data[1][14]);
90
+		$this->assertEquals('055544332211', $data[1][15]);
91
+		$this->assertEquals('055544332212', $data[1][16]);
92
+		$this->assertEquals('[email protected]', $data[1][17]);
93
+		$this->assertEquals('www.example.com', $data[1][18]);
94
+		$this->assertEquals('10.000000', $data[1][19]);
95
+		$this->assertEquals('50.000000', $data[1][20]);
96 96
 	}
97 97
 
98 98
 
99
-	protected function getInvoice( $context )
99
+	protected function getInvoice($context)
100 100
 	{
101
-		$manager = \Aimeos\MShop::create( $context, 'order' );
101
+		$manager = \Aimeos\MShop::create($context, 'order');
102 102
 
103 103
 		$search = $manager->createSearch();
104
-		$search->setConditions( $search->compare( '==', 'order.datepayment', '2008-02-15 12:34:56' ) );
104
+		$search->setConditions($search->compare('==', 'order.datepayment', '2008-02-15 12:34:56'));
105 105
 
106
-		$items = $manager->searchItems( $search );
106
+		$items = $manager->searchItems($search);
107 107
 
108
-		if( ( $item = reset( $items ) ) !== false ) {
108
+		if (($item = reset($items)) !== false) {
109 109
 			return $item;
110 110
 		}
111 111
 
112
-		throw new \Exception( 'No order item found' );
112
+		throw new \Exception('No order item found');
113 113
 	}
114 114
 }
Please login to merge, or discard this patch.
tests/Controller/Common/Coupon/Import/Csv/Processor/Code/StandardTest.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop::cache( true );
20
+		\Aimeos\MShop::cache(true);
21 21
 
22 22
 		$this->context = \TestHelperCntl::getContext();
23
-		$this->endpoint = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Done( $this->context, [] );
23
+		$this->endpoint = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Done($this->context, []);
24 24
 	}
25 25
 
26 26
 
27 27
 	protected function tearDown()
28 28
 	{
29
-		\Aimeos\MShop::cache( false );
29
+		\Aimeos\MShop::cache(false);
30 30
 		\Aimeos\MShop::clear();
31 31
 	}
32 32
 
@@ -47,24 +47,24 @@  discard block
 block discarded – undo
47 47
 			3 => '',
48 48
 		);
49 49
 
50
-		$manager = \Aimeos\MShop::create( $this->context, 'coupon' );
51
-		$codeManager = \Aimeos\MShop::create( $this->context, 'coupon/code' );
50
+		$manager = \Aimeos\MShop::create($this->context, 'coupon');
51
+		$codeManager = \Aimeos\MShop::create($this->context, 'coupon/code');
52 52
 
53
-		$coupon = $manager->saveItem( $manager->createItem()->setProvider( 'test' ) );
53
+		$coupon = $manager->saveItem($manager->createItem()->setProvider('test'));
54 54
 		$couponCode = $codeManager->createItem();
55
-		$couponCode->setParentId( $coupon->getId() );
55
+		$couponCode->setParentId($coupon->getId());
56 56
 
57
-		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard( $this->context, $mapping, $this->endpoint );
58
-		$object->process( $couponCode, $data );
57
+		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard($this->context, $mapping, $this->endpoint);
58
+		$object->process($couponCode, $data);
59 59
 
60
-		$codeManager->deleteItem( $couponCode->getId() );
61
-		$manager->deleteItem( $coupon->getId() );
60
+		$codeManager->deleteItem($couponCode->getId());
61
+		$manager->deleteItem($coupon->getId());
62 62
 
63 63
 
64
-		$this->assertEquals( 10, $couponCode->getCount() );
65
-		$this->assertEquals( 'jobimporttest', $couponCode->getCode() );
66
-		$this->assertEquals( '2000-01-01 00:00:00', $couponCode->getDateStart() );
67
-		$this->assertEquals( null, $couponCode->getDateEnd() );
64
+		$this->assertEquals(10, $couponCode->getCount());
65
+		$this->assertEquals('jobimporttest', $couponCode->getCode());
66
+		$this->assertEquals('2000-01-01 00:00:00', $couponCode->getDateStart());
67
+		$this->assertEquals(null, $couponCode->getDateEnd());
68 68
 	}
69 69
 
70 70
 
@@ -86,23 +86,23 @@  discard block
 block discarded – undo
86 86
 		);
87 87
 
88 88
 
89
-		$manager = \Aimeos\MShop::create( $this->context, 'coupon' );
90
-		$codeManager = \Aimeos\MShop::create( $this->context, 'coupon/code' );
89
+		$manager = \Aimeos\MShop::create($this->context, 'coupon');
90
+		$codeManager = \Aimeos\MShop::create($this->context, 'coupon/code');
91 91
 
92
-		$coupon = $manager->saveItem( $manager->createItem()->setProvider( 'test' ) );
92
+		$coupon = $manager->saveItem($manager->createItem()->setProvider('test'));
93 93
 		$couponCode = $codeManager->createItem();
94
-		$couponCode->setParentId( $coupon->getId() );
94
+		$couponCode->setParentId($coupon->getId());
95 95
 
96
-		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard( $this->context, $mapping, $this->endpoint );
97
-		$object->process( $couponCode, $data );
98
-		$object->process( $couponCode, $dataUpdate );
96
+		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard($this->context, $mapping, $this->endpoint);
97
+		$object->process($couponCode, $data);
98
+		$object->process($couponCode, $dataUpdate);
99 99
 
100
-		$codeManager->deleteItem( $couponCode->getId() );
101
-		$manager->deleteItem( $coupon->getId() );
100
+		$codeManager->deleteItem($couponCode->getId());
101
+		$manager->deleteItem($coupon->getId());
102 102
 
103 103
 
104
-		$this->assertEquals( 5, $couponCode->getCount() );
105
-		$this->assertEquals( 'jobimporttest', $couponCode->getCode() );
104
+		$this->assertEquals(5, $couponCode->getCount());
105
+		$this->assertEquals('jobimporttest', $couponCode->getCode());
106 106
 	}
107 107
 
108 108
 
@@ -119,20 +119,20 @@  discard block
 block discarded – undo
119 119
 		);
120 120
 
121 121
 
122
-		$manager = \Aimeos\MShop::create( $this->context, 'coupon' );
123
-		$codeManager = \Aimeos\MShop::create( $this->context, 'coupon/code' );
122
+		$manager = \Aimeos\MShop::create($this->context, 'coupon');
123
+		$codeManager = \Aimeos\MShop::create($this->context, 'coupon/code');
124 124
 
125
-		$coupon = $manager->saveItem( $manager->createItem()->setProvider( 'test' ) );
125
+		$coupon = $manager->saveItem($manager->createItem()->setProvider('test'));
126 126
 		$couponCode = $codeManager->createItem();
127
-		$couponCode->setParentId( $coupon->getId() );
127
+		$couponCode->setParentId($coupon->getId());
128 128
 
129
-		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard( $this->context, $mapping, $this->endpoint );
130
-		$object->process( $couponCode, $data );
129
+		$object = new \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Code\Standard($this->context, $mapping, $this->endpoint);
130
+		$object->process($couponCode, $data);
131 131
 
132
-		$codeManager->deleteItem( $couponCode->getId() );
133
-		$manager->deleteItem( $coupon->getId() );
132
+		$codeManager->deleteItem($couponCode->getId());
133
+		$manager->deleteItem($coupon->getId());
134 134
 
135 135
 
136
-		$this->assertEquals( 0, $couponCode->getCount() );
136
+		$this->assertEquals(0, $couponCode->getCount());
137 137
 	}
138 138
 }
139 139
\ No newline at end of file
Please login to merge, or discard this patch.
tests/Controller/Common/Catalog/Import/Csv/Processor/Media/StandardTest.php 1 patch
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop::cache( true );
20
+		\Aimeos\MShop::cache(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::cache( false );
29
+		\Aimeos\MShop::cache(false);
30 30
 		\Aimeos\MShop::clear();
31 31
 	}
32 32
 
@@ -51,32 +51,32 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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::create( $this->context );
264
+		$manager = \Aimeos\MShop\Catalog\Manager\Factory::create($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
 	}
Please login to merge, or discard this patch.
tests/Controller/Common/Catalog/Import/Csv/Processor/Text/StandardTest.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -17,16 +17,16 @@  discard block
 block discarded – undo
17 17
 
18 18
 	protected function setUp()
19 19
 	{
20
-		\Aimeos\MShop::cache( true );
20
+		\Aimeos\MShop::cache(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::cache( false );
29
+		\Aimeos\MShop::cache(false);
30 30
 		\Aimeos\MShop::clear();
31 31
 	}
32 32
 
@@ -49,31 +49,31 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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::create( $this->context );
256
+		$manager = \Aimeos\MShop\Catalog\Manager\Factory::create($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
 	}
Please login to merge, or discard this patch.