Completed
Push — master ( 0229de...f71bfb )
by Aimeos
04:41
created
admin/jqadm/tests/Admin/JQAdm/Product/Related/StandardTest.php 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Related\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Related\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertNull( $this->view->get( 'errors' ) );
45
-		$this->assertContains( 'item-related', $result );
44
+		$this->assertNull($this->view->get('errors'));
45
+		$this->assertContains('item-related', $result);
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'CNC' );
53
+		$this->view->item = $manager->findItem('CNC');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'item-related', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('item-related', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,91 +62,91 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'CNC' );
74
+		$this->view->item = $manager->findItem('CNC');
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'item-related', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('item-related', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'product');
85 85
 
86
-		$item = $manager->findItem( 'CNC' );
87
-		$item->setCode( 'jqadm-test-related' );
88
-		$item->setId( null );
86
+		$item = $manager->findItem('CNC');
87
+		$item->setCode('jqadm-test-related');
88
+		$item->setId(null);
89 89
 
90
-		$item = $manager->saveItem( $item );
90
+		$item = $manager->saveItem($item);
91 91
 		$this->view->item = $item;
92 92
 
93 93
 		$result = $this->object->save();
94
-		$manager->deleteItem( $item->getId() );
94
+		$manager->deleteItem($item->getId());
95 95
 
96
-		$this->assertNull( $this->view->get( 'errors' ) );
97
-		$this->assertNull( $result );
96
+		$this->assertNull($this->view->get('errors'));
97
+		$this->assertNull($result);
98 98
 	}
99 99
 
100 100
 
101 101
 	public function testSaveException()
102 102
 	{
103
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Related\Standard::class )
104
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
105
-			->setMethods( array( 'getSubClients' ) )
103
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Related\Standard::class)
104
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
105
+			->setMethods(array('getSubClients'))
106 106
 			->getMock();
107 107
 
108
-		$object->expects( $this->once() )->method( 'getSubClients' )
109
-			->will( $this->throwException( new \RuntimeException() ) );
108
+		$object->expects($this->once())->method('getSubClients')
109
+			->will($this->throwException(new \RuntimeException()));
110 110
 
111 111
 		$this->view = \TestHelperJqadm::getView();
112
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
112
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
113 113
 
114
-		$object->setView( $this->view );
114
+		$object->setView($this->view);
115 115
 
116
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
116
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
117 117
 		$object->save();
118 118
 	}
119 119
 
120 120
 
121 121
 	public function testSaveMShopException()
122 122
 	{
123
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Related\Standard::class )
124
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
125
-			->setMethods( array( 'getSubClients' ) )
123
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Related\Standard::class)
124
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
125
+			->setMethods(array('getSubClients'))
126 126
 			->getMock();
127 127
 
128
-		$object->expects( $this->once() )->method( 'getSubClients' )
129
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
128
+		$object->expects($this->once())->method('getSubClients')
129
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
130 130
 
131 131
 		$this->view = \TestHelperJqadm::getView();
132
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
132
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
133 133
 
134
-		$object->setView( $this->view );
134
+		$object->setView($this->view);
135 135
 
136
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
136
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
137 137
 		$object->save();
138 138
 	}
139 139
 
140 140
 
141 141
 	public function testSearch()
142 142
 	{
143
-		$this->assertNull( $this->object->search() );
143
+		$this->assertNull($this->object->search());
144 144
 	}
145 145
 
146 146
 
147 147
 	public function testGetSubClient()
148 148
 	{
149
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
150
-		$this->object->getSubClient( 'unknown' );
149
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
150
+		$this->object->getSubClient('unknown');
151 151
 	}
152 152
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Related/Suggest/StandardTest.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Related\Suggest\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Related\Suggest\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'Suggested', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Suggested', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'CNC' );
53
+		$this->view->item = $manager->findItem('CNC');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'Suggested', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('Suggested', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,61 +62,61 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'CNC' );
74
+		$this->view->item = $manager->findItem('CNC');
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'Suggested', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Suggested', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'product');
85 85
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
88 88
 			'site' => 'unittest',
89 89
 			'related' => array(
90 90
 				'suggest' => array(
91
-					'product.lists.id' => array( '' ),
92
-					'product.lists.refid' => array( '123' ),
91
+					'product.lists.id' => array(''),
92
+					'product.lists.refid' => array('123'),
93 93
 				),
94 94
 			),
95 95
 		);
96 96
 
97
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
98
-		$this->view->addHelper( 'param', $helper );
97
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
98
+		$this->view->addHelper('param', $helper);
99 99
 
100 100
 		$result = $this->object->save();
101 101
 
102
-		$products = $this->view->item->getListItems( 'product' );
102
+		$products = $this->view->item->getListItems('product');
103 103
 
104
-		$this->assertNull( $this->view->get( 'errors' ) );
105
-		$this->assertNull( $result );
106
-		$this->assertEquals( 1, count( $products ) );
107
-		$this->assertEquals( '123', reset( $products )->getRefId() );
104
+		$this->assertNull($this->view->get('errors'));
105
+		$this->assertNull($result);
106
+		$this->assertEquals(1, count($products));
107
+		$this->assertEquals('123', reset($products)->getRefId());
108 108
 	}
109 109
 
110 110
 
111 111
 	public function testSearch()
112 112
 	{
113
-		$this->assertNull( $this->object->search() );
113
+		$this->assertNull($this->object->search());
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testGetSubClient()
118 118
 	{
119
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
120
-		$this->object->getSubClient( 'unknown' );
119
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
120
+		$this->object->getSubClient('unknown');
121 121
 	}
122 122
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Related/Bought/StandardTest.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Related\Bought\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Related\Bought\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'Products bought together', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Products bought together', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'CNC' );
53
+		$this->view->item = $manager->findItem('CNC');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'Products bought together', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('Products bought together', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,61 +62,61 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'CNC' );
74
+		$this->view->item = $manager->findItem('CNC');
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'Products bought together', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Products bought together', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'product');
85 85
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
88 88
 			'site' => 'unittest',
89 89
 			'related' => array(
90 90
 				'bought' => array(
91
-					'product.lists.id' => array( '' ),
92
-					'product.lists.refid' => array( '123' ),
91
+					'product.lists.id' => array(''),
92
+					'product.lists.refid' => array('123'),
93 93
 				),
94 94
 			),
95 95
 		);
96 96
 
97
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
98
-		$this->view->addHelper( 'param', $helper );
97
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
98
+		$this->view->addHelper('param', $helper);
99 99
 
100 100
 		$result = $this->object->save();
101 101
 
102
-		$products = $this->view->item->getListItems( 'product' );
102
+		$products = $this->view->item->getListItems('product');
103 103
 
104
-		$this->assertNull( $this->view->get( 'errors' ) );
105
-		$this->assertNull( $result );
106
-		$this->assertEquals( 1, count( $products ) );
107
-		$this->assertEquals( '123', reset( $products )->getRefId() );
104
+		$this->assertNull($this->view->get('errors'));
105
+		$this->assertNull($result);
106
+		$this->assertEquals(1, count($products));
107
+		$this->assertEquals('123', reset($products)->getRefId());
108 108
 	}
109 109
 
110 110
 
111 111
 	public function testSearch()
112 112
 	{
113
-		$this->assertNull( $this->object->search() );
113
+		$this->assertNull($this->object->search());
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testGetSubClient()
118 118
 	{
119
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
120
-		$this->object->getSubClient( 'unknown' );
119
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
120
+		$this->object->getSubClient('unknown');
121 121
 	}
122 122
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Subscription/StandardTest.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -21,58 +21,58 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Subscription\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Subscription\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'item-subscription', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-subscription', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'CNE' );
53
+		$this->view->item = $manager->findItem('CNE');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( '"attribute.label":"product\/interval\/P1Y0M0W0D"', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('"attribute.label":"product\/interval\/P1Y0M0W0D"', $result);
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testGet()
62 62
 	{
63
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
63
+		$manager = \Aimeos\MShop::create($this->context, 'product');
64 64
 
65
-		$this->view->item = $manager->findItem( 'CNE' );
65
+		$this->view->item = $manager->findItem('CNE');
66 66
 		$result = $this->object->get();
67 67
 
68
-		$this->assertNull( $this->view->get( 'errors' ) );
69
-		$this->assertContains( '"attribute.label":"product\/interval\/P1Y0M0W0D"', $result );
68
+		$this->assertNull($this->view->get('errors'));
69
+		$this->assertContains('"attribute.label":"product\/interval\/P1Y0M0W0D"', $result);
70 70
 	}
71 71
 
72 72
 
73 73
 	public function testSave()
74 74
 	{
75
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
75
+		$manager = \Aimeos\MShop::create($this->context, 'product');
76 76
 		$this->view->item = $manager->createItem();
77 77
 
78 78
 		$param = array(
@@ -87,61 +87,61 @@  discard block
 block discarded – undo
87 87
 			),
88 88
 		);
89 89
 
90
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
91
-		$this->view->addHelper( 'param', $helper );
90
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
91
+		$this->view->addHelper('param', $helper);
92 92
 
93 93
 		$result = $this->object->save();
94 94
 
95
-		$this->assertNull( $this->view->get( 'errors' ) );
96
-		$this->assertNull( $result );
97
-		$this->assertEquals( 1, count( $this->view->item->getListItems( 'attribute' ) ) );
98
-		$this->assertEquals( 1, count( $this->view->item->getRefItems( 'attribute' ) ) );
95
+		$this->assertNull($this->view->get('errors'));
96
+		$this->assertNull($result);
97
+		$this->assertEquals(1, count($this->view->item->getListItems('attribute')));
98
+		$this->assertEquals(1, count($this->view->item->getRefItems('attribute')));
99 99
 	}
100 100
 
101 101
 
102 102
 	public function testSaveException()
103 103
 	{
104
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Subscription\Standard::class )
105
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
106
-			->setMethods( array( 'fromArray' ) )
104
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Subscription\Standard::class)
105
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
106
+			->setMethods(array('fromArray'))
107 107
 			->getMock();
108 108
 
109
-		$object->expects( $this->once() )->method( 'fromArray' )
110
-			->will( $this->throwException( new \RuntimeException() ) );
109
+		$object->expects($this->once())->method('fromArray')
110
+			->will($this->throwException(new \RuntimeException()));
111 111
 
112 112
 		$this->view = \TestHelperJqadm::getView();
113
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
113
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
114 114
 
115
-		$object->setView( $this->view );
115
+		$object->setView($this->view);
116 116
 
117
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
117
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
118 118
 		$object->save();
119 119
 	}
120 120
 
121 121
 
122 122
 	public function testSaveMShopException()
123 123
 	{
124
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Subscription\Standard::class )
125
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
126
-			->setMethods( array( 'fromArray' ) )
124
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Subscription\Standard::class)
125
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
126
+			->setMethods(array('fromArray'))
127 127
 			->getMock();
128 128
 
129
-		$object->expects( $this->once() )->method( 'fromArray' )
130
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
129
+		$object->expects($this->once())->method('fromArray')
130
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
131 131
 
132 132
 		$this->view = \TestHelperJqadm::getView();
133
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
133
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
134 134
 
135
-		$object->setView( $this->view );
135
+		$object->setView($this->view);
136 136
 
137
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
137
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
138 138
 		$object->save();
139 139
 	}
140 140
 
141 141
 
142 142
 	public function testGetSubClient()
143 143
 	{
144
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
145
-		$this->object->getSubClient( 'unknown' );
144
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
145
+		$this->object->getSubClient('unknown');
146 146
 	}
147 147
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Option/StandardTest.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Option\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Option\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertNull( $this->view->get( 'errors' ) );
45
-		$this->assertContains( 'attribute-list', $result );
44
+		$this->assertNull($this->view->get('errors'));
45
+		$this->assertContains('attribute-list', $result);
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'CNC' );
53
+		$this->view->item = $manager->findItem('CNC');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'attribute-list', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('attribute-list', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,106 +62,106 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'CNC' );
74
+		$this->view->item = $manager->findItem('CNC');
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'attribute-list', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('attribute-list', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
85
-		$attrManager = \Aimeos\MShop::create( $this->context, 'attribute' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'product');
85
+		$attrManager = \Aimeos\MShop::create($this->context, 'attribute');
86 86
 
87
-		$item = $manager->findItem( 'CNE' );
88
-		$item->setCode( 'jqadm-test-option' );
89
-		$item->setId( null );
87
+		$item = $manager->findItem('CNE');
88
+		$item->setCode('jqadm-test-option');
89
+		$item->setId(null);
90 90
 
91
-		$item = $manager->saveItem( $item );
91
+		$item = $manager->saveItem($item);
92 92
 
93 93
 
94 94
 		$param = array(
95 95
 			'site' => 'unittest',
96 96
 			'option' => array(
97 97
 				'config' => array(
98
-					'product.lists.id' => array( '' ),
99
-					'product.lists.refid' => array( $attrManager->findItem( 'white', [], 'product', 'color' )->getId() ),
98
+					'product.lists.id' => array(''),
99
+					'product.lists.refid' => array($attrManager->findItem('white', [], 'product', 'color')->getId()),
100 100
 				),
101 101
 			),
102 102
 		);
103 103
 
104
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
105
-		$this->view->addHelper( 'param', $helper );
104
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
105
+		$this->view->addHelper('param', $helper);
106 106
 		$this->view->item = $item;
107 107
 
108 108
 		$result = $this->object->save();
109
-		$manager->deleteItem( $item->getId() );
109
+		$manager->deleteItem($item->getId());
110 110
 
111
-		$this->assertNull( $this->view->get( 'errors' ) );
112
-		$this->assertNull( $result );
111
+		$this->assertNull($this->view->get('errors'));
112
+		$this->assertNull($result);
113 113
 	}
114 114
 
115 115
 
116 116
 	public function testSaveException()
117 117
 	{
118
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Option\Standard::class )
119
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
120
-			->setMethods( array( 'getSubClients' ) )
118
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Option\Standard::class)
119
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
120
+			->setMethods(array('getSubClients'))
121 121
 			->getMock();
122 122
 
123
-		$object->expects( $this->once() )->method( 'getSubClients' )
124
-			->will( $this->throwException( new \RuntimeException() ) );
123
+		$object->expects($this->once())->method('getSubClients')
124
+			->will($this->throwException(new \RuntimeException()));
125 125
 
126 126
 		$this->view = \TestHelperJqadm::getView();
127
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
127
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
128 128
 
129
-		$object->setView( $this->view );
129
+		$object->setView($this->view);
130 130
 
131
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
131
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
132 132
 		$object->save();
133 133
 	}
134 134
 
135 135
 
136 136
 	public function testSaveMShopException()
137 137
 	{
138
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Option\Standard::class )
139
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
140
-			->setMethods( array( 'getSubClients' ) )
138
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Option\Standard::class)
139
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
140
+			->setMethods(array('getSubClients'))
141 141
 			->getMock();
142 142
 
143
-		$object->expects( $this->once() )->method( 'getSubClients' )
144
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
143
+		$object->expects($this->once())->method('getSubClients')
144
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
145 145
 
146 146
 		$this->view = \TestHelperJqadm::getView();
147
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
147
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
148 148
 
149
-		$object->setView( $this->view );
149
+		$object->setView($this->view);
150 150
 
151
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
151
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
152 152
 		$object->save();
153 153
 	}
154 154
 
155 155
 
156 156
 	public function testSearch()
157 157
 	{
158
-		$this->assertNull( $this->object->search() );
158
+		$this->assertNull($this->object->search());
159 159
 	}
160 160
 
161 161
 
162 162
 	public function testGetSubClient()
163 163
 	{
164
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
165
-		$this->object->getSubClient( 'unknown' );
164
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
165
+		$this->object->getSubClient('unknown');
166 166
 	}
167 167
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Option/Custom/StandardTest.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Option\Custom\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Option\Custom\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'Custom', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Custom', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'U:TESTP', array( 'attribute' ) );
53
+		$this->view->item = $manager->findItem('U:TESTP', array('attribute'));
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'date', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('date', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,61 +62,61 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'U:TESTP', array( 'attribute' ) );
74
+		$this->view->item = $manager->findItem('U:TESTP', array('attribute'));
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'date', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('date', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'product');
85 85
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
88 88
 			'site' => 'unittest',
89 89
 			'option' => array(
90 90
 				'custom' => array(
91
-					'product.lists.id' => array( '' ),
92
-					'product.lists.refid' => array( '123' ),
91
+					'product.lists.id' => array(''),
92
+					'product.lists.refid' => array('123'),
93 93
 				),
94 94
 			),
95 95
 		);
96 96
 
97
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
98
-		$this->view->addHelper( 'param', $helper );
97
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
98
+		$this->view->addHelper('param', $helper);
99 99
 
100 100
 		$result = $this->object->save();
101 101
 
102
-		$attributes = $this->view->item->getListItems( 'attribute' );
102
+		$attributes = $this->view->item->getListItems('attribute');
103 103
 
104
-		$this->assertNull( $this->view->get( 'errors' ) );
105
-		$this->assertNull( $result );
106
-		$this->assertEquals( 1, count( $attributes ) );
107
-		$this->assertEquals( '123', reset( $attributes )->getRefId() );
104
+		$this->assertNull($this->view->get('errors'));
105
+		$this->assertNull($result);
106
+		$this->assertEquals(1, count($attributes));
107
+		$this->assertEquals('123', reset($attributes)->getRefId());
108 108
 	}
109 109
 
110 110
 
111 111
 	public function testSearch()
112 112
 	{
113
-		$this->assertNull( $this->object->search() );
113
+		$this->assertNull($this->object->search());
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testGetSubClient()
118 118
 	{
119
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
120
-		$this->object->getSubClient( 'unknown' );
119
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
120
+		$this->object->getSubClient('unknown');
121 121
 	}
122 122
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Option/Config/StandardTest.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Option\Config\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Option\Config\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'Config', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Config', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'CNE', array( 'attribute' ) );
53
+		$this->view->item = $manager->findItem('CNE', array('attribute'));
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'white', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('white', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,61 +62,61 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'CNE', array( 'attribute' ) );
74
+		$this->view->item = $manager->findItem('CNE', array('attribute'));
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'white', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('white', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'product');
85 85
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
88 88
 			'site' => 'unittest',
89 89
 			'option' => array(
90 90
 				'config' => array(
91
-					'product.lists.id' => array( '' ),
92
-					'product.lists.refid' => array( '123' ),
91
+					'product.lists.id' => array(''),
92
+					'product.lists.refid' => array('123'),
93 93
 				),
94 94
 			),
95 95
 		);
96 96
 
97
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
98
-		$this->view->addHelper( 'param', $helper );
97
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
98
+		$this->view->addHelper('param', $helper);
99 99
 
100 100
 		$result = $this->object->save();
101 101
 
102
-		$attributes = $this->view->item->getListItems( 'attribute' );
102
+		$attributes = $this->view->item->getListItems('attribute');
103 103
 
104
-		$this->assertNull( $this->view->get( 'errors' ) );
105
-		$this->assertNull( $result );
106
-		$this->assertEquals( 1, count( $attributes ) );
107
-		$this->assertEquals( '123', reset( $attributes )->getRefId() );
104
+		$this->assertNull($this->view->get('errors'));
105
+		$this->assertNull($result);
106
+		$this->assertEquals(1, count($attributes));
107
+		$this->assertEquals('123', reset($attributes)->getRefId());
108 108
 	}
109 109
 
110 110
 
111 111
 	public function testSearch()
112 112
 	{
113
-		$this->assertNull( $this->object->search() );
113
+		$this->assertNull($this->object->search());
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testGetSubClient()
118 118
 	{
119
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
120
-		$this->object->getSubClient( 'unknown' );
119
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
120
+		$this->object->getSubClient('unknown');
121 121
 	}
122 122
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Characteristic/StandardTest.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertNull( $this->view->get( 'errors' ) );
45
-		$this->assertContains( 'attribute-list', $result );
44
+		$this->assertNull($this->view->get('errors'));
45
+		$this->assertContains('attribute-list', $result);
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'CNC' );
53
+		$this->view->item = $manager->findItem('CNC');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'attribute-list', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('attribute-list', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,106 +62,106 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'CNC' );
74
+		$this->view->item = $manager->findItem('CNC');
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'attribute-list', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('attribute-list', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
85
-		$attrManager = \Aimeos\MShop::create( $this->context, 'attribute' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'product');
85
+		$attrManager = \Aimeos\MShop::create($this->context, 'attribute');
86 86
 
87
-		$item = $manager->findItem( 'CNC' );
88
-		$item->setCode( 'jqadm-test-characteristic' );
89
-		$item->setId( null );
87
+		$item = $manager->findItem('CNC');
88
+		$item->setCode('jqadm-test-characteristic');
89
+		$item->setId(null);
90 90
 
91
-		$item = $manager->saveItem( $item );
91
+		$item = $manager->saveItem($item);
92 92
 
93 93
 
94 94
 		$param = array(
95 95
 			'site' => 'unittest',
96 96
 			'characteristic' => array(
97 97
 				'attribute' => array(
98
-					'product.lists.id' => array( '' ),
99
-					'product.lists.refid' => array( $attrManager->findItem( 'xs', [], 'product', 'size' )->getId() ),
98
+					'product.lists.id' => array(''),
99
+					'product.lists.refid' => array($attrManager->findItem('xs', [], 'product', 'size')->getId()),
100 100
 				),
101 101
 			),
102 102
 		);
103 103
 
104
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
105
-		$this->view->addHelper( 'param', $helper );
104
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
105
+		$this->view->addHelper('param', $helper);
106 106
 		$this->view->item = $item;
107 107
 
108 108
 		$result = $this->object->save();
109
-		$manager->deleteItem( $item->getId() );
109
+		$manager->deleteItem($item->getId());
110 110
 
111
-		$this->assertNull( $this->view->get( 'errors' ) );
112
-		$this->assertNull( $result );
111
+		$this->assertNull($this->view->get('errors'));
112
+		$this->assertNull($result);
113 113
 	}
114 114
 
115 115
 
116 116
 	public function testSaveException()
117 117
 	{
118
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Characteristic\Standard::class )
119
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
120
-			->setMethods( array( 'getSubClients' ) )
118
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Characteristic\Standard::class)
119
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
120
+			->setMethods(array('getSubClients'))
121 121
 			->getMock();
122 122
 
123
-		$object->expects( $this->once() )->method( 'getSubClients' )
124
-			->will( $this->throwException( new \RuntimeException() ) );
123
+		$object->expects($this->once())->method('getSubClients')
124
+			->will($this->throwException(new \RuntimeException()));
125 125
 
126 126
 		$this->view = \TestHelperJqadm::getView();
127
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
127
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
128 128
 
129
-		$object->setView( $this->view );
129
+		$object->setView($this->view);
130 130
 
131
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
131
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
132 132
 		$object->save();
133 133
 	}
134 134
 
135 135
 
136 136
 	public function testSaveMShopException()
137 137
 	{
138
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Characteristic\Standard::class )
139
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
140
-			->setMethods( array( 'getSubClients' ) )
138
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Characteristic\Standard::class)
139
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
140
+			->setMethods(array('getSubClients'))
141 141
 			->getMock();
142 142
 
143
-		$object->expects( $this->once() )->method( 'getSubClients' )
144
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
143
+		$object->expects($this->once())->method('getSubClients')
144
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
145 145
 
146 146
 		$this->view = \TestHelperJqadm::getView();
147
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
147
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
148 148
 
149
-		$object->setView( $this->view );
149
+		$object->setView($this->view);
150 150
 
151
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
151
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
152 152
 		$object->save();
153 153
 	}
154 154
 
155 155
 
156 156
 	public function testSearch()
157 157
 	{
158
-		$this->assertNull( $this->object->search() );
158
+		$this->assertNull($this->object->search());
159 159
 	}
160 160
 
161 161
 
162 162
 	public function testGetSubClient()
163 163
 	{
164
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
165
-		$this->object->getSubClient( 'unknown' );
164
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
165
+		$this->object->getSubClient('unknown');
166 166
 	}
167 167
 }
Please login to merge, or discard this patch.
jqadm/tests/Admin/JQAdm/Product/Characteristic/Hidden/StandardTest.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -21,40 +21,40 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Hidden\Standard( $this->context );
25
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
26
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
27
-		$this->object->setView( $this->view );
24
+		$this->object = new \Aimeos\Admin\JQAdm\Product\Characteristic\Hidden\Standard($this->context);
25
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
26
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
27
+		$this->object->setView($this->view);
28 28
 	}
29 29
 
30 30
 
31 31
 	protected function tearDown()
32 32
 	{
33
-		unset( $this->object, $this->view, $this->context );
33
+		unset($this->object, $this->view, $this->context);
34 34
 	}
35 35
 
36 36
 
37 37
 	public function testCreate()
38 38
 	{
39
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'product');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'Hidden attributes', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Hidden attributes', $result);
45
+		$this->assertNull($this->view->get('errors'));
46 46
 	}
47 47
 
48 48
 
49 49
 	public function testCopy()
50 50
 	{
51
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'product');
52 52
 
53
-		$this->view->item = $manager->findItem( 'U:TESTP', array( 'attribute' ) );
53
+		$this->view->item = $manager->findItem('U:TESTP', array('attribute'));
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( '29', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('29', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,61 +62,61 @@  discard block
 block discarded – undo
62 62
 	{
63 63
 		$result = $this->object->delete();
64 64
 
65
-		$this->assertNull( $this->view->get( 'errors' ) );
66
-		$this->assertNull( $result );
65
+		$this->assertNull($this->view->get('errors'));
66
+		$this->assertNull($result);
67 67
 	}
68 68
 
69 69
 
70 70
 	public function testGet()
71 71
 	{
72
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'product');
73 73
 
74
-		$this->view->item = $manager->findItem( 'U:TESTP', array( 'attribute' ) );
74
+		$this->view->item = $manager->findItem('U:TESTP', array('attribute'));
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( '29', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('29', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'product');
85 85
 		$this->view->item = $manager->createItem();
86 86
 
87 87
 		$param = array(
88 88
 			'site' => 'unittest',
89 89
 			'characteristic' => array(
90 90
 				'hidden' => array(
91
-					'product.lists.id' => array( '' ),
92
-					'product.lists.refid' => array( '123' ),
91
+					'product.lists.id' => array(''),
92
+					'product.lists.refid' => array('123'),
93 93
 				),
94 94
 			),
95 95
 		);
96 96
 
97
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
98
-		$this->view->addHelper( 'param', $helper );
97
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
98
+		$this->view->addHelper('param', $helper);
99 99
 
100 100
 		$result = $this->object->save();
101 101
 
102
-		$attributes = $this->view->item->getListItems( 'attribute' );
102
+		$attributes = $this->view->item->getListItems('attribute');
103 103
 
104
-		$this->assertNull( $this->view->get( 'errors' ) );
105
-		$this->assertNull( $result );
106
-		$this->assertEquals( 1, count( $attributes ) );
107
-		$this->assertEquals( '123', reset( $attributes )->getRefId() );
104
+		$this->assertNull($this->view->get('errors'));
105
+		$this->assertNull($result);
106
+		$this->assertEquals(1, count($attributes));
107
+		$this->assertEquals('123', reset($attributes)->getRefId());
108 108
 	}
109 109
 
110 110
 
111 111
 	public function testSearch()
112 112
 	{
113
-		$this->assertNull( $this->object->search() );
113
+		$this->assertNull($this->object->search());
114 114
 	}
115 115
 
116 116
 
117 117
 	public function testGetSubClient()
118 118
 	{
119
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
120
-		$this->object->getSubClient( 'unknown' );
119
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
120
+		$this->object->getSubClient('unknown');
121 121
 	}
122 122
 }
Please login to merge, or discard this patch.