Completed
Push — master ( 521882...b49ab8 )
by Aimeos
04:07
created
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.
jqadm/tests/Admin/JQAdm/Product/Characteristic/Attribute/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\Attribute\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\Attribute\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( 'Attributes', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('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( 'CNC', array( 'attribute' ) );
53
+		$this->view->item = $manager->findItem('CNC', array('attribute'));
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'xs', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('xs', $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', array( 'attribute' ) );
74
+		$this->view->item = $manager->findItem('CNC', array('attribute'));
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'xs', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('xs', $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
 				'attribute' => 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.
jqadm/tests/Admin/JQAdm/Product/Characteristic/Property/StandardTest.php 1 patch
Spacing   +38 added lines, -38 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\Property\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\Property\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( 'Properties', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Properties', $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( 'Properties', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('Properties', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,26 +62,26 @@  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( 'Properties', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('Properties', $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(
@@ -97,50 +97,50 @@  discard block
 block discarded – undo
97 97
 			),
98 98
 		);
99 99
 
100
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
101
-		$this->view->addHelper( 'param', $helper );
100
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
101
+		$this->view->addHelper('param', $helper);
102 102
 
103 103
 		$result = $this->object->save();
104 104
 
105
-		$items = $this->view->item->getPropertyItems( null, false );
105
+		$items = $this->view->item->getPropertyItems(null, false);
106 106
 
107
-		$this->assertNull( $this->view->get( 'errors' ) );
108
-		$this->assertNull( $result );
109
-		$this->assertEquals( 1, count( $items ) );
110
-		$this->assertEquals( null, reset( $items )->getLanguageId() );
111
-		$this->assertEquals( '#100000', reset( $items )->getValue() );
107
+		$this->assertNull($this->view->get('errors'));
108
+		$this->assertNull($result);
109
+		$this->assertEquals(1, count($items));
110
+		$this->assertEquals(null, reset($items)->getLanguageId());
111
+		$this->assertEquals('#100000', reset($items)->getValue());
112 112
 	}
113 113
 
114 114
 
115 115
 	public function testSaveException()
116 116
 	{
117
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard::class )
118
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
119
-			->setMethods( array( 'fromArray' ) )
117
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Characteristic\Property\Standard::class)
118
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
119
+			->setMethods(array('fromArray'))
120 120
 			->getMock();
121 121
 
122
-		$object->expects( $this->once() )->method( 'fromArray' )
123
-			->will( $this->throwException( new \RuntimeException() ) );
122
+		$object->expects($this->once())->method('fromArray')
123
+			->will($this->throwException(new \RuntimeException()));
124 124
 
125 125
 		$this->view = \TestHelperJqadm::getView();
126
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
126
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
127 127
 
128
-		$object->setView( $this->view );
128
+		$object->setView($this->view);
129 129
 
130
-		$this->setExpectedException( \RuntimeException::class );
130
+		$this->setExpectedException(\RuntimeException::class);
131 131
 		$object->save();
132 132
 	}
133 133
 
134 134
 
135 135
 	public function testSearch()
136 136
 	{
137
-		$this->assertNull( $this->object->search() );
137
+		$this->assertNull($this->object->search());
138 138
 	}
139 139
 
140 140
 
141 141
 	public function testGetSubClient()
142 142
 	{
143
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
144
-		$this->object->getSubClient( 'unknown' );
143
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
144
+		$this->object->getSubClient('unknown');
145 145
 	}
146 146
 }
Please login to merge, or discard this patch.
jqadm/tests/Admin/JQAdm/Product/Characteristic/Variant/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\Variant\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\Variant\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( 'Variant attributes', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Variant 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:TESTSUB04', ['attribute'] );
53
+		$this->view->item = $manager->findItem('U:TESTSUB04', ['attribute']);
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( '30', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('30', $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:TESTSUB04', ['attribute'] );
74
+		$this->view->item = $manager->findItem('U:TESTSUB04', ['attribute']);
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( '30', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('30', $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
 				'variant' => 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/Stock/StandardTest.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -21,138 +21,138 @@
 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\Stock\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\Stock\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-stock', $result );
44
+		$this->assertNull($this->view->get('errors'));
45
+		$this->assertContains('item-stock', $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( '"stock.stocklevel":[1200]', $result );
58
-		$this->assertContains( '"stock.dateback":["2015-05-01T00:00:00"]', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('"stock.stocklevel":[1200]', $result);
58
+		$this->assertContains('"stock.dateback":["2015-05-01T00:00:00"]', $result);
59 59
 	}
60 60
 
61 61
 
62 62
 	public function testGet()
63 63
 	{
64
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
64
+		$manager = \Aimeos\MShop::create($this->context, 'product');
65 65
 
66
-		$this->view->item = $manager->findItem( 'CNC' );
66
+		$this->view->item = $manager->findItem('CNC');
67 67
 		$result = $this->object->get();
68 68
 
69
-		$this->assertNull( $this->view->get( 'errors' ) );
70
-		$this->assertContains( '"stock.stocklevel":[1200]', $result );
71
-		$this->assertContains( '"stock.dateback":["2015-05-01T00:00:00"]', $result );
69
+		$this->assertNull($this->view->get('errors'));
70
+		$this->assertContains('"stock.stocklevel":[1200]', $result);
71
+		$this->assertContains('"stock.dateback":["2015-05-01T00:00:00"]', $result);
72 72
 	}
73 73
 
74 74
 
75 75
 	public function testSave()
76 76
 	{
77
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
78
-		$stockManager = \Aimeos\MShop::create( $this->context, 'stock' );
77
+		$manager = \Aimeos\MShop::create($this->context, 'product');
78
+		$stockManager = \Aimeos\MShop::create($this->context, 'stock');
79 79
 
80
-		$item = $manager->findItem( 'CNC' );
81
-		$item->setCode( 'jqadm-test-stock' );
82
-		$item->setId( null );
80
+		$item = $manager->findItem('CNC');
81
+		$item->setCode('jqadm-test-stock');
82
+		$item->setId(null);
83 83
 
84
-		$item = $manager->saveItem( $item );
84
+		$item = $manager->saveItem($item);
85 85
 
86 86
 
87 87
 		$param = array(
88 88
 			'site' => 'unittest',
89 89
 			'stock' => array(
90
-				'stock.id' => array( '' ),
91
-				'stock.type' => array( 'default' ),
92
-				'stock.dateback' => array( '2000-01-01 00:00:00' ),
93
-				'stock.stocklevel' => array( '-1' ),
90
+				'stock.id' => array(''),
91
+				'stock.type' => array('default'),
92
+				'stock.dateback' => array('2000-01-01 00:00:00'),
93
+				'stock.stocklevel' => array('-1'),
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
 		$this->view->item = $item;
100 100
 
101 101
 		$result = $this->object->save();
102 102
 
103 103
 		$search = $stockManager->createSearch();
104
-		$search->setConditions( $search->compare( '==', 'stock.productcode', 'jqadm-test-stock' ) );
105
-		$stockManager->deleteItems( array_keys( $stockManager->searchItems( $search ) ) );
106
-		$manager->deleteItem( $item->getId() );
104
+		$search->setConditions($search->compare('==', 'stock.productcode', 'jqadm-test-stock'));
105
+		$stockManager->deleteItems(array_keys($stockManager->searchItems($search)));
106
+		$manager->deleteItem($item->getId());
107 107
 
108
-		$this->assertNull( $this->view->get( 'errors' ) );
109
-		$this->assertNull( $result );
108
+		$this->assertNull($this->view->get('errors'));
109
+		$this->assertNull($result);
110 110
 	}
111 111
 
112 112
 
113 113
 	public function testSaveException()
114 114
 	{
115
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Stock\Standard::class )
116
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
117
-			->setMethods( array( 'fromArray' ) )
115
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Stock\Standard::class)
116
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
117
+			->setMethods(array('fromArray'))
118 118
 			->getMock();
119 119
 
120
-		$object->expects( $this->once() )->method( 'fromArray' )
121
-			->will( $this->throwException( new \RuntimeException() ) );
120
+		$object->expects($this->once())->method('fromArray')
121
+			->will($this->throwException(new \RuntimeException()));
122 122
 
123 123
 		$this->view = \TestHelperJqadm::getView();
124
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
124
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
125 125
 
126
-		$object->setView( $this->view );
126
+		$object->setView($this->view);
127 127
 
128
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
128
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
129 129
 		$object->save();
130 130
 	}
131 131
 
132 132
 
133 133
 	public function testSaveMShopException()
134 134
 	{
135
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Stock\Standard::class )
136
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
137
-			->setMethods( array( 'fromArray' ) )
135
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Stock\Standard::class)
136
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
137
+			->setMethods(array('fromArray'))
138 138
 			->getMock();
139 139
 
140
-		$object->expects( $this->once() )->method( 'fromArray' )
141
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
140
+		$object->expects($this->once())->method('fromArray')
141
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
142 142
 
143 143
 		$this->view = \TestHelperJqadm::getView();
144
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
144
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
145 145
 
146
-		$object->setView( $this->view );
146
+		$object->setView($this->view);
147 147
 
148
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
148
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
149 149
 		$object->save();
150 150
 	}
151 151
 
152 152
 
153 153
 	public function testGetSubClient()
154 154
 	{
155
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
156
-		$this->object->getSubClient( 'unknown' );
155
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
156
+		$this->object->getSubClient('unknown');
157 157
 	}
158 158
 }
Please login to merge, or discard this patch.