Completed
Push — master ( 521882...b49ab8 )
by Aimeos
04:07
created
admin/jqadm/tests/Admin/JQAdm/Order/FactoryTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,42 +17,42 @@
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->context = \TestHelperJqadm::getContext();
20
-		$this->context->setView( \TestHelperJqadm::getView() );
20
+		$this->context->setView(\TestHelperJqadm::getView());
21 21
 	}
22 22
 
23 23
 
24 24
 	public function testCreateClient()
25 25
 	{
26
-		$client = \Aimeos\Admin\JQAdm\Order\Factory::create( $this->context );
27
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
26
+		$client = \Aimeos\Admin\JQAdm\Order\Factory::create($this->context);
27
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testCreateClientName()
32 32
 	{
33
-		$client = \Aimeos\Admin\JQAdm\Order\Factory::create( $this->context, 'Standard' );
34
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
33
+		$client = \Aimeos\Admin\JQAdm\Order\Factory::create($this->context, 'Standard');
34
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCreateClientNameEmpty()
39 39
 	{
40
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
41
-		\Aimeos\Admin\JQAdm\Order\Factory::create( $this->context, '' );
40
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
41
+		\Aimeos\Admin\JQAdm\Order\Factory::create($this->context, '');
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCreateClientNameInvalid()
46 46
 	{
47
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
48
-		\Aimeos\Admin\JQAdm\Order\Factory::create( $this->context, '%order' );
47
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
48
+		\Aimeos\Admin\JQAdm\Order\Factory::create($this->context, '%order');
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testCreateClientNameNotFound()
53 53
 	{
54
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
55
-		\Aimeos\Admin\JQAdm\Order\Factory::create( $this->context, 'test' );
54
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
55
+		\Aimeos\Admin\JQAdm\Order\Factory::create($this->context, 'test');
56 56
 	}
57 57
 
58 58
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/FactoryTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,42 +17,42 @@
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->context = \TestHelperJqadm::getContext();
20
-		$this->context->setView( \TestHelperJqadm::getView() );
20
+		$this->context->setView(\TestHelperJqadm::getView());
21 21
 	}
22 22
 
23 23
 
24 24
 	public function testCreateClient()
25 25
 	{
26
-		$client = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context );
27
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
26
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context);
27
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testCreateClientName()
32 32
 	{
33
-		$client = \Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'Standard' );
34
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
33
+		$client = \Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'Standard');
34
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCreateClientNameEmpty()
39 39
 	{
40
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
41
-		\Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, '' );
40
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
41
+		\Aimeos\Admin\JQAdm\Product\Factory::create($this->context, '');
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCreateClientNameInvalid()
46 46
 	{
47
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
48
-		\Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, '%product' );
47
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
48
+		\Aimeos\Admin\JQAdm\Product\Factory::create($this->context, '%product');
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testCreateClientNameNotFound()
53 53
 	{
54
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
55
-		\Aimeos\Admin\JQAdm\Product\Factory::create( $this->context, 'test' );
54
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
55
+		\Aimeos\Admin\JQAdm\Product\Factory::create($this->context, 'test');
56 56
 	}
57 57
 
58 58
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Image/StandardTest.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -21,70 +21,70 @@  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\Media\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\Media\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-media', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-media', $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', ['media'] );
53
+		$this->view->item = $manager->findItem('CNC', ['media']);
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( '"media.preview":"prod_114x95\/194_prod_114x95.jpg"', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('"media.preview":"prod_114x95\/194_prod_114x95.jpg"', $result);
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testDelete()
62 62
 	{
63
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
63
+		$manager = \Aimeos\MShop::create($this->context, 'product');
64 64
 
65 65
 		$this->view->item = $manager->createItem();
66 66
 		$result = $this->object->delete();
67 67
 
68
-		$this->assertNull( $this->view->get( 'errors' ) );
69
-		$this->assertNull( $result );
68
+		$this->assertNull($this->view->get('errors'));
69
+		$this->assertNull($result);
70 70
 	}
71 71
 
72 72
 
73 73
 	public function testGet()
74 74
 	{
75
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
75
+		$manager = \Aimeos\MShop::create($this->context, 'product');
76 76
 
77
-		$this->view->item = $manager->findItem( 'CNC', ['media'] );
77
+		$this->view->item = $manager->findItem('CNC', ['media']);
78 78
 		$result = $this->object->get();
79 79
 
80
-		$this->assertNull( $this->view->get( 'errors' ) );
81
-		$this->assertContains( '"media.preview":"prod_114x95\/194_prod_114x95.jpg"', $result );
80
+		$this->assertNull($this->view->get('errors'));
81
+		$this->assertContains('"media.preview":"prod_114x95\/194_prod_114x95.jpg"', $result);
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testSave()
86 86
 	{
87
-		$manager = \Aimeos\MShop::create( $this->context, 'product' );
87
+		$manager = \Aimeos\MShop::create($this->context, 'product');
88 88
 		$this->view->item = $manager->createItem();
89 89
 
90 90
 		$param = array(
@@ -98,108 +98,108 @@  discard block
 block discarded – undo
98 98
 			]],
99 99
 		);
100 100
 
101
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
102
-		$this->view->addHelper( 'param', $helper );
101
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
102
+		$this->view->addHelper('param', $helper);
103 103
 
104
-		$file = $this->getMockBuilder( \Psr\Http\Message\UploadedFileInterface::class )->getMock();
105
-		$request = $this->getMockBuilder( \Psr\Http\Message\ServerRequestInterface::class )->getMock();
106
-		$request->expects( $this->any() )->method( 'getUploadedFiles' )
107
-			->will( $this->returnValue( ['media' => [0 => ['file' => $file] ] ] ) );
104
+		$file = $this->getMockBuilder(\Psr\Http\Message\UploadedFileInterface::class)->getMock();
105
+		$request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock();
106
+		$request->expects($this->any())->method('getUploadedFiles')
107
+			->will($this->returnValue(['media' => [0 => ['file' => $file]]]));
108 108
 
109
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
110
-		$this->view ->addHelper( 'request', $helper );
109
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
110
+		$this->view ->addHelper('request', $helper);
111 111
 
112 112
 
113 113
 		$name = 'AdminJQAdmProductMediaSave';
114
-		$this->context->getConfig()->set( 'controller/common/media/name', $name );
114
+		$this->context->getConfig()->set('controller/common/media/name', $name);
115 115
 
116
-		$cntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Media\\Standard' )
117
-			->setConstructorArgs( array( $this->context ) )
118
-			->setMethods( array( 'add' ) )
116
+		$cntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Media\\Standard')
117
+			->setConstructorArgs(array($this->context))
118
+			->setMethods(array('add'))
119 119
 			->getMock();
120 120
 
121
-		\Aimeos\Controller\Common\Media\Factory::injectController( '\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub );
121
+		\Aimeos\Controller\Common\Media\Factory::injectController('\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub);
122 122
 
123
-		$cntlStub->expects( $this->once() )->method( 'add' );
123
+		$cntlStub->expects($this->once())->method('add');
124 124
 
125 125
 
126 126
 		$result = $this->object->save();
127 127
 
128 128
 
129
-		$this->assertNull( $this->view->get( 'errors' ) );
130
-		$this->assertNull( $result );
131
-		$this->assertEquals( 1, count( $this->view->item->getListItems() ) );
129
+		$this->assertNull($this->view->get('errors'));
130
+		$this->assertNull($result);
131
+		$this->assertEquals(1, count($this->view->item->getListItems()));
132 132
 
133
-		foreach( $this->view->item->getListItems( 'media' ) as $listItem )
133
+		foreach ($this->view->item->getListItems('media') as $listItem)
134 134
 		{
135
-			$this->assertEquals( 'media', $listItem->getDomain() );
135
+			$this->assertEquals('media', $listItem->getDomain());
136 136
 
137 137
 			$refItem = $listItem->getRefItem();
138
-			$this->assertEquals( 'de', $refItem->getLanguageId() );
139
-			$this->assertEquals( 'test', $refItem->getLabel() );
138
+			$this->assertEquals('de', $refItem->getLanguageId());
139
+			$this->assertEquals('test', $refItem->getLabel());
140 140
 		}
141 141
 
142 142
 
143
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['site' => 'unittest', 'media' => []] );
144
-		$this->view->addHelper( 'param', $helper );
143
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['site' => 'unittest', 'media' => []]);
144
+		$this->view->addHelper('param', $helper);
145 145
 
146 146
 		$result = $this->object->save();
147 147
 
148
-		$this->assertNull( $this->view->get( 'errors' ) );
149
-		$this->assertNull( $result );
150
-		$this->assertEquals( 0, count( $this->view->item->getListItems() ) );
148
+		$this->assertNull($this->view->get('errors'));
149
+		$this->assertNull($result);
150
+		$this->assertEquals(0, count($this->view->item->getListItems()));
151 151
 	}
152 152
 
153 153
 
154 154
 	public function testSaveException()
155 155
 	{
156
-		$object = $this->getClientMock( 'fromArray' );
156
+		$object = $this->getClientMock('fromArray');
157 157
 
158
-		$object->expects( $this->once() )->method( 'fromArray' )
159
-			->will( $this->throwException( new \RuntimeException() ) );
158
+		$object->expects($this->once())->method('fromArray')
159
+			->will($this->throwException(new \RuntimeException()));
160 160
 
161
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
161
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
162 162
 		$object->save();
163 163
 	}
164 164
 
165 165
 
166 166
 	public function testSaveMShopException()
167 167
 	{
168
-		$object = $this->getClientMock( 'fromArray' );
168
+		$object = $this->getClientMock('fromArray');
169 169
 
170
-		$object->expects( $this->once() )->method( 'fromArray' )
171
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
170
+		$object->expects($this->once())->method('fromArray')
171
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
172 172
 
173
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
173
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
174 174
 		$object->save();
175 175
 	}
176 176
 
177 177
 
178 178
 	public function testSearch()
179 179
 	{
180
-		$this->assertNull( $this->object->search() );
180
+		$this->assertNull($this->object->search());
181 181
 	}
182 182
 
183 183
 
184 184
 	public function testGetSubClient()
185 185
 	{
186
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
187
-		$this->object->getSubClient( 'unknown' );
186
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
187
+		$this->object->getSubClient('unknown');
188 188
 	}
189 189
 
190 190
 
191
-	public function getClientMock( $method )
191
+	public function getClientMock($method)
192 192
 	{
193
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Media\Standard::class )
194
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
195
-			->setMethods( [$method] )
193
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Media\Standard::class)
194
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
195
+			->setMethods([$method])
196 196
 			->getMock();
197 197
 
198 198
 		$view = \TestHelperJqadm::getView();
199
-		$view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
199
+		$view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
200 200
 
201
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
202
-		$object->setView( $view );
201
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
202
+		$object->setView($view);
203 203
 
204 204
 		return $object;
205 205
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Product/Image/Property/StandardTest.php 1 patch
Spacing   +42 added lines, -42 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\Media\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\Media\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( 'Media properties', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Media 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', ['media'] );
53
+		$this->view->item = $manager->findItem('CNC', ['media']);
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'item-media-property', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('item-media-property', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,32 +62,32 @@  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', ['media'] );
74
+		$this->view->item = $manager->findItem('CNC', ['media']);
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'item-media-property', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('item-media-property', $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', ['media'] );
87
-		$item->setCode( 'jqadm-test-media-property' );
88
-		$item->setId( null );
86
+		$item = $manager->findItem('CNC', ['media']);
87
+		$item->setCode('jqadm-test-media-property');
88
+		$item->setId(null);
89 89
 
90
-		$this->view->item = $manager->saveItem( $item );
90
+		$this->view->item = $manager->saveItem($item);
91 91
 
92 92
 		$param = array(
93 93
 			'site' => 'unittest',
@@ -103,53 +103,53 @@  discard block
 block discarded – undo
103 103
 			),
104 104
 		);
105 105
 
106
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
107
-		$this->view->addHelper( 'param', $helper );
106
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
107
+		$this->view->addHelper('param', $helper);
108 108
 
109 109
 
110 110
 		$result = $this->object->save();
111 111
 
112 112
 
113
-		$manager->deleteItem( $this->view->item->getId() );
113
+		$manager->deleteItem($this->view->item->getId());
114 114
 
115
-		$this->assertNull( $this->view->get( 'errors' ) );
116
-		$this->assertNull( $result );
115
+		$this->assertNull($this->view->get('errors'));
116
+		$this->assertNull($result);
117 117
 
118
-		$mediaItems = $this->view->item->getRefItems( 'media' );
119
-		$this->assertEquals( 2, count( $mediaItems ) );
120
-		$this->assertEquals( 1, count( reset( $mediaItems )->getPropertyItems() ) );
118
+		$mediaItems = $this->view->item->getRefItems('media');
119
+		$this->assertEquals(2, count($mediaItems));
120
+		$this->assertEquals(1, count(reset($mediaItems)->getPropertyItems()));
121 121
 	}
122 122
 
123 123
 
124 124
 	public function testSaveException()
125 125
 	{
126
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Product\Media\Property\Standard::class )
127
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
128
-			->setMethods( array( 'fromArray' ) )
126
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Product\Media\Property\Standard::class)
127
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
128
+			->setMethods(array('fromArray'))
129 129
 			->getMock();
130 130
 
131
-		$object->expects( $this->once() )->method( 'fromArray' )
132
-			->will( $this->throwException( new \RuntimeException() ) );
131
+		$object->expects($this->once())->method('fromArray')
132
+			->will($this->throwException(new \RuntimeException()));
133 133
 
134 134
 		$this->view = \TestHelperJqadm::getView();
135
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'product' )->createItem();
135
+		$this->view->item = \Aimeos\MShop::create($this->context, 'product')->createItem();
136 136
 
137
-		$object->setView( $this->view );
137
+		$object->setView($this->view);
138 138
 
139
-		$this->setExpectedException( \RuntimeException::class );
139
+		$this->setExpectedException(\RuntimeException::class);
140 140
 		$object->save();
141 141
 	}
142 142
 
143 143
 
144 144
 	public function testSearch()
145 145
 	{
146
-		$this->assertNull( $this->object->search() );
146
+		$this->assertNull($this->object->search());
147 147
 	}
148 148
 
149 149
 
150 150
 	public function testGetSubClient()
151 151
 	{
152
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
153
-		$this->object->getSubClient( 'unknown' );
152
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
153
+		$this->object->getSubClient('unknown');
154 154
 	}
155 155
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Attribute/FactoryTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -17,42 +17,42 @@
 block discarded – undo
17 17
 	protected function setUp()
18 18
 	{
19 19
 		$this->context = \TestHelperJqadm::getContext();
20
-		$this->context->setView( \TestHelperJqadm::getView() );
20
+		$this->context->setView(\TestHelperJqadm::getView());
21 21
 	}
22 22
 
23 23
 
24 24
 	public function testCreateClient()
25 25
 	{
26
-		$client = \Aimeos\Admin\JQAdm\Attribute\Factory::create( $this->context );
27
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
26
+		$client = \Aimeos\Admin\JQAdm\Attribute\Factory::create($this->context);
27
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
28 28
 	}
29 29
 
30 30
 
31 31
 	public function testCreateClientName()
32 32
 	{
33
-		$client = \Aimeos\Admin\JQAdm\Attribute\Factory::create( $this->context, 'Standard' );
34
-		$this->assertInstanceOf( '\\Aimeos\\Admin\\JQAdm\\Iface', $client );
33
+		$client = \Aimeos\Admin\JQAdm\Attribute\Factory::create($this->context, 'Standard');
34
+		$this->assertInstanceOf('\\Aimeos\\Admin\\JQAdm\\Iface', $client);
35 35
 	}
36 36
 
37 37
 
38 38
 	public function testCreateClientNameEmpty()
39 39
 	{
40
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
41
-		\Aimeos\Admin\JQAdm\Attribute\Factory::create( $this->context, '' );
40
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
41
+		\Aimeos\Admin\JQAdm\Attribute\Factory::create($this->context, '');
42 42
 	}
43 43
 
44 44
 
45 45
 	public function testCreateClientNameInvalid()
46 46
 	{
47
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
48
-		\Aimeos\Admin\JQAdm\Attribute\Factory::create( $this->context, '%attribute' );
47
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
48
+		\Aimeos\Admin\JQAdm\Attribute\Factory::create($this->context, '%attribute');
49 49
 	}
50 50
 
51 51
 
52 52
 	public function testCreateClientNameNotFound()
53 53
 	{
54
-		$this->setExpectedException( '\\Aimeos\\Admin\\JQAdm\\Exception' );
55
-		\Aimeos\Admin\JQAdm\Attribute\Factory::create( $this->context, 'test' );
54
+		$this->setExpectedException('\\Aimeos\\Admin\\JQAdm\\Exception');
55
+		\Aimeos\Admin\JQAdm\Attribute\Factory::create($this->context, 'test');
56 56
 	}
57 57
 
58 58
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Attribute/Text/StandardTest.php 1 patch
Spacing   +49 added lines, -49 removed lines patch added patch discarded remove patch
@@ -21,75 +21,75 @@  discard block
 block discarded – undo
21 21
 		$this->view = \TestHelperJqadm::getView();
22 22
 		$this->context = \TestHelperJqadm::getContext();
23 23
 
24
-		$langManager = \Aimeos\MShop::create( $this->context, 'locale/language' );
24
+		$langManager = \Aimeos\MShop::create($this->context, 'locale/language');
25 25
 
26
-		$this->view->pageLanguages = $langManager->searchItems( $langManager->createSearch() );
27
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem();
26
+		$this->view->pageLanguages = $langManager->searchItems($langManager->createSearch());
27
+		$this->view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem();
28 28
 
29
-		$this->object = new \Aimeos\Admin\JQAdm\Attribute\Text\Standard( $this->context );
30
-		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page( $this->object, $this->context );
31
-		$this->object->setAimeos( \TestHelperJqadm::getAimeos() );
32
-		$this->object->setView( $this->view );
29
+		$this->object = new \Aimeos\Admin\JQAdm\Attribute\Text\Standard($this->context);
30
+		$this->object = new \Aimeos\Admin\JQAdm\Common\Decorator\Page($this->object, $this->context);
31
+		$this->object->setAimeos(\TestHelperJqadm::getAimeos());
32
+		$this->object->setView($this->view);
33 33
 	}
34 34
 
35 35
 
36 36
 	protected function tearDown()
37 37
 	{
38
-		unset( $this->object, $this->view, $this->context );
38
+		unset($this->object, $this->view, $this->context);
39 39
 	}
40 40
 
41 41
 
42 42
 	public function testCreate()
43 43
 	{
44
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
44
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
45 45
 
46 46
 		$this->view->item = $manager->createItem();
47 47
 		$result = $this->object->create();
48 48
 
49
-		$this->assertContains( 'item-text', $result );
50
-		$this->assertNull( $this->view->get( 'errors' ) );
49
+		$this->assertContains('item-text', $result);
50
+		$this->assertNull($this->view->get('errors'));
51 51
 	}
52 52
 
53 53
 
54 54
 	public function testCopy()
55 55
 	{
56
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
56
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
57 57
 
58
-		$this->view->item = $manager->findItem( 'white', ['text'], 'product', 'color' );
58
+		$this->view->item = $manager->findItem('white', ['text'], 'product', 'color');
59 59
 		$result = $this->object->copy();
60 60
 
61
-		$this->assertNull( $this->view->get( 'errors' ) );
62
-		$this->assertContains( '"text.type":"name"', $result );
61
+		$this->assertNull($this->view->get('errors'));
62
+		$this->assertContains('"text.type":"name"', $result);
63 63
 	}
64 64
 
65 65
 
66 66
 	public function testDelete()
67 67
 	{
68
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
68
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
69 69
 
70 70
 		$this->view->item = $manager->createItem();
71 71
 		$result = $this->object->delete();
72 72
 
73
-		$this->assertNull( $this->view->get( 'errors' ) );
74
-		$this->assertNull( $result );
73
+		$this->assertNull($this->view->get('errors'));
74
+		$this->assertNull($result);
75 75
 	}
76 76
 
77 77
 
78 78
 	public function testGet()
79 79
 	{
80
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
80
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
81 81
 
82
-		$this->view->item = $manager->findItem( 'white', ['text'], 'product', 'color' );
82
+		$this->view->item = $manager->findItem('white', ['text'], 'product', 'color');
83 83
 		$result = $this->object->get();
84 84
 
85
-		$this->assertNull( $this->view->get( 'errors' ) );
86
-		$this->assertContains( '"text.type":"name"', $result );
85
+		$this->assertNull($this->view->get('errors'));
86
+		$this->assertContains('"text.type":"name"', $result);
87 87
 	}
88 88
 
89 89
 
90 90
 	public function testSave()
91 91
 	{
92
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
92
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
93 93
 		$item = $manager->createItem();
94 94
 
95 95
 		$param = array(
@@ -119,75 +119,75 @@  discard block
 block discarded – undo
119 119
 			),
120 120
 		);
121 121
 
122
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
123
-		$this->view->addHelper( 'param', $helper );
122
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
123
+		$this->view->addHelper('param', $helper);
124 124
 		$this->view->item = $item;
125 125
 
126 126
 		$result = $this->object->save();
127 127
 
128
-		$this->assertNull( $this->view->get( 'errors' ) );
129
-		$this->assertNull( $result );
130
-		$this->assertEquals( 3, count( $this->view->item->getListItems() ) );
128
+		$this->assertNull($this->view->get('errors'));
129
+		$this->assertNull($result);
130
+		$this->assertEquals(3, count($this->view->item->getListItems()));
131 131
 
132
-		foreach( $this->view->item->getListItems( 'text' ) as $listItem )
132
+		foreach ($this->view->item->getListItems('text') as $listItem)
133 133
 		{
134
-			$this->assertEquals( 'text', $listItem->getDomain() );
134
+			$this->assertEquals('text', $listItem->getDomain());
135 135
 
136 136
 			$refItem = $listItem->getRefItem();
137
-			$this->assertEquals( 'de', $refItem->getLanguageId() );
137
+			$this->assertEquals('de', $refItem->getLanguageId());
138 138
 		}
139 139
 	}
140 140
 
141 141
 
142 142
 	public function testSaveException()
143 143
 	{
144
-		$object = $this->getClientMock( 'fromArray' );
144
+		$object = $this->getClientMock('fromArray');
145 145
 
146
-		$object->expects( $this->once() )->method( 'fromArray' )
147
-			->will( $this->throwException( new \RuntimeException() ) );
146
+		$object->expects($this->once())->method('fromArray')
147
+			->will($this->throwException(new \RuntimeException()));
148 148
 
149
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
149
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
150 150
 		$object->save();
151 151
 	}
152 152
 
153 153
 
154 154
 	public function testSaveMShopException()
155 155
 	{
156
-		$object = $this->getClientMock( 'fromArray' );
156
+		$object = $this->getClientMock('fromArray');
157 157
 
158
-		$object->expects( $this->once() )->method( 'fromArray' )
159
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
158
+		$object->expects($this->once())->method('fromArray')
159
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
160 160
 
161
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
161
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
162 162
 		$object->save();
163 163
 	}
164 164
 
165 165
 
166 166
 	public function testSearch()
167 167
 	{
168
-		$this->assertNull( $this->object->search() );
168
+		$this->assertNull($this->object->search());
169 169
 	}
170 170
 
171 171
 
172 172
 	public function testGetSubClient()
173 173
 	{
174
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
175
-		$this->object->getSubClient( 'unknown' );
174
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
175
+		$this->object->getSubClient('unknown');
176 176
 	}
177 177
 
178 178
 
179
-	public function getClientMock( $method )
179
+	public function getClientMock($method)
180 180
 	{
181
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Attribute\Media\Standard::class )
182
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
183
-			->setMethods( [$method] )
181
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Media\Standard::class)
182
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
183
+			->setMethods([$method])
184 184
 			->getMock();
185 185
 
186 186
 		$view = \TestHelperJqadm::getView();
187
-		$view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem();
187
+		$view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem();
188 188
 
189
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
190
-		$object->setView( $view );
189
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
190
+		$object->setView($view);
191 191
 
192 192
 		return $object;
193 193
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Attribute/Image/StandardTest.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -21,70 +21,70 @@  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\Attribute\Media\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\Attribute\Media\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, 'attribute' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'item-media', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-media', $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, 'attribute' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
52 52
 
53
-		$this->view->item = $manager->findItem( 'xs', ['media'], 'product', 'size' );
53
+		$this->view->item = $manager->findItem('xs', ['media'], 'product', 'size');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( '"media.preview":"prod_97x93\/199_prod_97x93.jpg"', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('"media.preview":"prod_97x93\/199_prod_97x93.jpg"', $result);
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testDelete()
62 62
 	{
63
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
63
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
64 64
 
65 65
 		$this->view->item = $manager->createItem();
66 66
 		$result = $this->object->delete();
67 67
 
68
-		$this->assertNull( $this->view->get( 'errors' ) );
69
-		$this->assertNull( $result );
68
+		$this->assertNull($this->view->get('errors'));
69
+		$this->assertNull($result);
70 70
 	}
71 71
 
72 72
 
73 73
 	public function testGet()
74 74
 	{
75
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
75
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
76 76
 
77
-		$this->view->item = $manager->findItem( 'xs', ['media'], 'product', 'size' );
77
+		$this->view->item = $manager->findItem('xs', ['media'], 'product', 'size');
78 78
 		$result = $this->object->get();
79 79
 
80
-		$this->assertNull( $this->view->get( 'errors' ) );
81
-		$this->assertContains( '"media.preview":"prod_97x93\/199_prod_97x93.jpg"', $result );
80
+		$this->assertNull($this->view->get('errors'));
81
+		$this->assertContains('"media.preview":"prod_97x93\/199_prod_97x93.jpg"', $result);
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testSave()
86 86
 	{
87
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
87
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
88 88
 		$this->view->item = $manager->createItem();
89 89
 
90 90
 
@@ -99,108 +99,108 @@  discard block
 block discarded – undo
99 99
 			]],
100 100
 		);
101 101
 
102
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
103
-		$this->view->addHelper( 'param', $helper );
102
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
103
+		$this->view->addHelper('param', $helper);
104 104
 
105
-		$file = $this->getMockBuilder( \Psr\Http\Message\UploadedFileInterface::class )->getMock();
106
-		$request = $this->getMockBuilder( \Psr\Http\Message\ServerRequestInterface::class )->getMock();
107
-		$request->expects( $this->any() )->method( 'getUploadedFiles' )
108
-			->will( $this->returnValue( ['media' => [0 => ['file' => $file] ] ] ) );
105
+		$file = $this->getMockBuilder(\Psr\Http\Message\UploadedFileInterface::class)->getMock();
106
+		$request = $this->getMockBuilder(\Psr\Http\Message\ServerRequestInterface::class)->getMock();
107
+		$request->expects($this->any())->method('getUploadedFiles')
108
+			->will($this->returnValue(['media' => [0 => ['file' => $file]]]));
109 109
 
110
-		$helper = new \Aimeos\MW\View\Helper\Request\Standard( $this->view, $request, '127.0.0.1', 'test' );
111
-		$this->view ->addHelper( 'request', $helper );
110
+		$helper = new \Aimeos\MW\View\Helper\Request\Standard($this->view, $request, '127.0.0.1', 'test');
111
+		$this->view ->addHelper('request', $helper);
112 112
 
113 113
 
114 114
 		$name = 'AdminJQAdmAttributeMediaSave';
115
-		$this->context->getConfig()->set( 'controller/common/media/name', $name );
115
+		$this->context->getConfig()->set('controller/common/media/name', $name);
116 116
 
117
-		$cntlStub = $this->getMockBuilder( '\\Aimeos\\Controller\\Common\\Media\\Standard' )
118
-			->setConstructorArgs( array( $this->context ) )
119
-			->setMethods( array( 'add' ) )
117
+		$cntlStub = $this->getMockBuilder('\\Aimeos\\Controller\\Common\\Media\\Standard')
118
+			->setConstructorArgs(array($this->context))
119
+			->setMethods(array('add'))
120 120
 			->getMock();
121 121
 
122
-		\Aimeos\Controller\Common\Media\Factory::injectController( '\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub );
122
+		\Aimeos\Controller\Common\Media\Factory::injectController('\\Aimeos\\Controller\\Common\\Media\\' . $name, $cntlStub);
123 123
 
124
-		$cntlStub->expects( $this->once() )->method( 'add' );
124
+		$cntlStub->expects($this->once())->method('add');
125 125
 
126 126
 
127 127
 		$result = $this->object->save();
128 128
 
129 129
 
130
-		$this->assertNull( $this->view->get( 'errors' ) );
131
-		$this->assertNull( $result );
132
-		$this->assertEquals( 1, count( $this->view->item->getListItems() ) );
130
+		$this->assertNull($this->view->get('errors'));
131
+		$this->assertNull($result);
132
+		$this->assertEquals(1, count($this->view->item->getListItems()));
133 133
 
134
-		foreach( $this->view->item->getListItems( 'media' ) as $listItem )
134
+		foreach ($this->view->item->getListItems('media') as $listItem)
135 135
 		{
136
-			$this->assertEquals( 'media', $listItem->getDomain() );
136
+			$this->assertEquals('media', $listItem->getDomain());
137 137
 
138 138
 			$refItem = $listItem->getRefItem();
139
-			$this->assertEquals( 'de', $refItem->getLanguageId() );
140
-			$this->assertEquals( 'test', $refItem->getLabel() );
139
+			$this->assertEquals('de', $refItem->getLanguageId());
140
+			$this->assertEquals('test', $refItem->getLabel());
141 141
 		}
142 142
 
143 143
 
144
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, ['site' => 'unittest', 'media' => []] );
145
-		$this->view->addHelper( 'param', $helper );
144
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, ['site' => 'unittest', 'media' => []]);
145
+		$this->view->addHelper('param', $helper);
146 146
 
147 147
 		$result = $this->object->save();
148 148
 
149
-		$this->assertNull( $this->view->get( 'errors' ) );
150
-		$this->assertNull( $result );
151
-		$this->assertEquals( 0, count( $this->view->item->getListItems() ) );
149
+		$this->assertNull($this->view->get('errors'));
150
+		$this->assertNull($result);
151
+		$this->assertEquals(0, count($this->view->item->getListItems()));
152 152
 	}
153 153
 
154 154
 
155 155
 	public function testSaveException()
156 156
 	{
157
-		$object = $this->getClientMock( 'fromArray' );
157
+		$object = $this->getClientMock('fromArray');
158 158
 
159
-		$object->expects( $this->once() )->method( 'fromArray' )
160
-			->will( $this->throwException( new \RuntimeException() ) );
159
+		$object->expects($this->once())->method('fromArray')
160
+			->will($this->throwException(new \RuntimeException()));
161 161
 
162
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
162
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
163 163
 		$object->save();
164 164
 	}
165 165
 
166 166
 
167 167
 	public function testSaveMShopException()
168 168
 	{
169
-		$object = $this->getClientMock( 'fromArray' );
169
+		$object = $this->getClientMock('fromArray');
170 170
 
171
-		$object->expects( $this->once() )->method( 'fromArray' )
172
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
171
+		$object->expects($this->once())->method('fromArray')
172
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
173 173
 
174
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
174
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
175 175
 		$object->save();
176 176
 	}
177 177
 
178 178
 
179 179
 	public function testSearch()
180 180
 	{
181
-		$this->assertNull( $this->object->search() );
181
+		$this->assertNull($this->object->search());
182 182
 	}
183 183
 
184 184
 
185 185
 	public function testGetSubClient()
186 186
 	{
187
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
188
-		$this->object->getSubClient( 'unknown' );
187
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
188
+		$this->object->getSubClient('unknown');
189 189
 	}
190 190
 
191 191
 
192
-	public function getClientMock( $method )
192
+	public function getClientMock($method)
193 193
 	{
194
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Attribute\Media\Standard::class )
195
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
196
-			->setMethods( [$method] )
194
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Media\Standard::class)
195
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
196
+			->setMethods([$method])
197 197
 			->getMock();
198 198
 
199 199
 		$view = \TestHelperJqadm::getView();
200
-		$view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem();
200
+		$view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem();
201 201
 
202
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
203
-		$object->setView( $view );
202
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
203
+		$object->setView($view);
204 204
 
205 205
 		return $object;
206 206
 	}
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Attribute/Image/Property/StandardTest.php 1 patch
Spacing   +43 added lines, -43 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\Attribute\Media\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\Attribute\Media\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, 'attribute' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'Media properties', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('Media 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, 'attribute' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
52 52
 
53
-		$this->view->item = $manager->findItem( 'xs', ['media'], 'product', 'size' );
53
+		$this->view->item = $manager->findItem('xs', ['media'], 'product', 'size');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( 'item-media-property', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('item-media-property', $result);
58 58
 	}
59 59
 
60 60
 
@@ -62,33 +62,33 @@  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, 'attribute' );
72
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
73 73
 
74
-		$this->view->item = $manager->findItem( 'xs', ['media'], 'product', 'size' );
74
+		$this->view->item = $manager->findItem('xs', ['media'], 'product', 'size');
75 75
 		$result = $this->object->get();
76 76
 
77
-		$this->assertNull( $this->view->get( 'errors' ) );
78
-		$this->assertContains( 'item-media-property', $result );
77
+		$this->assertNull($this->view->get('errors'));
78
+		$this->assertContains('item-media-property', $result);
79 79
 	}
80 80
 
81 81
 
82 82
 	public function testSave()
83 83
 	{
84
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
85
-		$typeManager = \Aimeos\MShop::create( $this->context, 'media/property/type' );
84
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
85
+		$typeManager = \Aimeos\MShop::create($this->context, 'media/property/type');
86 86
 
87
-		$item = $manager->findItem( 'xs', ['media'], 'product', 'size' );
88
-		$item->setCode( 'jqadm-test-media-property' );
89
-		$item->setId( null );
87
+		$item = $manager->findItem('xs', ['media'], 'product', 'size');
88
+		$item->setCode('jqadm-test-media-property');
89
+		$item->setId(null);
90 90
 
91
-		$this->view->item = $manager->saveItem( $item );
91
+		$this->view->item = $manager->saveItem($item);
92 92
 
93 93
 		$param = array(
94 94
 			'site' => 'unittest',
@@ -104,53 +104,53 @@  discard block
 block discarded – undo
104 104
 			),
105 105
 		);
106 106
 
107
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
108
-		$this->view->addHelper( 'param', $helper );
107
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
108
+		$this->view->addHelper('param', $helper);
109 109
 
110 110
 
111 111
 		$result = $this->object->save();
112 112
 
113 113
 
114
-		$manager->deleteItem( $this->view->item->getId() );
114
+		$manager->deleteItem($this->view->item->getId());
115 115
 
116
-		$this->assertNull( $this->view->get( 'errors' ) );
117
-		$this->assertNull( $result );
116
+		$this->assertNull($this->view->get('errors'));
117
+		$this->assertNull($result);
118 118
 
119
-		$mediaItems = $this->view->item->getRefItems( 'media' );
120
-		$this->assertEquals( 1, count( $mediaItems ) );
121
-		$this->assertEquals( 1, count( reset( $mediaItems )->getPropertyItems() ) );
119
+		$mediaItems = $this->view->item->getRefItems('media');
120
+		$this->assertEquals(1, count($mediaItems));
121
+		$this->assertEquals(1, count(reset($mediaItems)->getPropertyItems()));
122 122
 	}
123 123
 
124 124
 
125 125
 	public function testSaveException()
126 126
 	{
127
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Attribute\Media\Property\Standard::class )
128
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
129
-			->setMethods( array( 'fromArray' ) )
127
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Media\Property\Standard::class)
128
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
129
+			->setMethods(array('fromArray'))
130 130
 			->getMock();
131 131
 
132
-		$object->expects( $this->once() )->method( 'fromArray' )
133
-			->will( $this->throwException( new \RuntimeException() ) );
132
+		$object->expects($this->once())->method('fromArray')
133
+			->will($this->throwException(new \RuntimeException()));
134 134
 
135 135
 		$this->view = \TestHelperJqadm::getView();
136
-		$this->view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem();
136
+		$this->view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem();
137 137
 
138
-		$object->setView( $this->view );
138
+		$object->setView($this->view);
139 139
 
140
-		$this->setExpectedException( \RuntimeException::class );
140
+		$this->setExpectedException(\RuntimeException::class);
141 141
 		$object->save();
142 142
 	}
143 143
 
144 144
 
145 145
 	public function testSearch()
146 146
 	{
147
-		$this->assertNull( $this->object->search() );
147
+		$this->assertNull($this->object->search());
148 148
 	}
149 149
 
150 150
 
151 151
 	public function testGetSubClient()
152 152
 	{
153
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
154
-		$this->object->getSubClient( 'unknown' );
153
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
154
+		$this->object->getSubClient('unknown');
155 155
 	}
156 156
 }
Please login to merge, or discard this patch.
admin/jqadm/tests/Admin/JQAdm/Attribute/Price/StandardTest.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -21,70 +21,70 @@  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\Attribute\Price\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\Attribute\Price\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, 'attribute' );
39
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
40 40
 
41 41
 		$this->view->item = $manager->createItem();
42 42
 		$result = $this->object->create();
43 43
 
44
-		$this->assertContains( 'item-price', $result );
45
-		$this->assertNull( $this->view->get( 'errors' ) );
44
+		$this->assertContains('item-price', $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, 'attribute' );
51
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
52 52
 
53
-		$this->view->item = $manager->findItem( 'xs', ['price'], 'product', 'size' );
53
+		$this->view->item = $manager->findItem('xs', ['price'], 'product', 'size');
54 54
 		$result = $this->object->copy();
55 55
 
56
-		$this->assertNull( $this->view->get( 'errors' ) );
57
-		$this->assertContains( '"price.type":"default"', $result );
56
+		$this->assertNull($this->view->get('errors'));
57
+		$this->assertContains('"price.type":"default"', $result);
58 58
 	}
59 59
 
60 60
 
61 61
 	public function testDelete()
62 62
 	{
63
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
63
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
64 64
 
65 65
 		$this->view->item = $manager->createItem();
66 66
 		$result = $this->object->delete();
67 67
 
68
-		$this->assertNull( $this->view->get( 'errors' ) );
69
-		$this->assertNull( $result );
68
+		$this->assertNull($this->view->get('errors'));
69
+		$this->assertNull($result);
70 70
 	}
71 71
 
72 72
 
73 73
 	public function testGet()
74 74
 	{
75
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
75
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
76 76
 
77
-		$this->view->item = $manager->findItem( 'xs', ['price'], 'product', 'size' );
77
+		$this->view->item = $manager->findItem('xs', ['price'], 'product', 'size');
78 78
 		$result = $this->object->get();
79 79
 
80
-		$this->assertNull( $this->view->get( 'errors' ) );
81
-		$this->assertContains( '"price.type":"default"', $result );
80
+		$this->assertNull($this->view->get('errors'));
81
+		$this->assertContains('"price.type":"default"', $result);
82 82
 	}
83 83
 
84 84
 
85 85
 	public function testSave()
86 86
 	{
87
-		$manager = \Aimeos\MShop::create( $this->context, 'attribute' );
87
+		$manager = \Aimeos\MShop::create($this->context, 'attribute');
88 88
 		$item = $manager->createItem();
89 89
 
90 90
 		$param = array(
@@ -102,80 +102,80 @@  discard block
 block discarded – undo
102 102
 			]],
103 103
 		);
104 104
 
105
-		$helper = new \Aimeos\MW\View\Helper\Param\Standard( $this->view, $param );
106
-		$this->view->addHelper( 'param', $helper );
105
+		$helper = new \Aimeos\MW\View\Helper\Param\Standard($this->view, $param);
106
+		$this->view->addHelper('param', $helper);
107 107
 		$this->view->item = $item;
108 108
 
109 109
 		$result = $this->object->save();
110 110
 
111
-		$this->assertNull( $this->view->get( 'errors' ) );
112
-		$this->assertNull( $result );
113
-		$this->assertEquals( 1, count( $item->getListItems() ) );
111
+		$this->assertNull($this->view->get('errors'));
112
+		$this->assertNull($result);
113
+		$this->assertEquals(1, count($item->getListItems()));
114 114
 
115
-		foreach( $item->getListItems( 'price' ) as $listItem )
115
+		foreach ($item->getListItems('price') as $listItem)
116 116
 		{
117
-			$this->assertEquals( 'price', $listItem->getDomain() );
117
+			$this->assertEquals('price', $listItem->getDomain());
118 118
 
119 119
 			$refItem = $listItem->getRefItem();
120
-			$this->assertEquals( 'EUR', $refItem->getCurrencyId() );
121
-			$this->assertEquals( '2', $refItem->getQuantity() );
122
-			$this->assertEquals( '10.00', $refItem->getValue() );
123
-			$this->assertEquals( '1.00', $refItem->getCosts() );
124
-			$this->assertEquals( '5.00', $refItem->getRebate() );
125
-			$this->assertEquals( '20.00', $refItem->getTaxRate() );
120
+			$this->assertEquals('EUR', $refItem->getCurrencyId());
121
+			$this->assertEquals('2', $refItem->getQuantity());
122
+			$this->assertEquals('10.00', $refItem->getValue());
123
+			$this->assertEquals('1.00', $refItem->getCosts());
124
+			$this->assertEquals('5.00', $refItem->getRebate());
125
+			$this->assertEquals('20.00', $refItem->getTaxRate());
126 126
 		}
127 127
 	}
128 128
 
129 129
 
130 130
 	public function testSaveException()
131 131
 	{
132
-		$object = $this->getClientMock( 'fromArray' );
132
+		$object = $this->getClientMock('fromArray');
133 133
 
134
-		$object->expects( $this->once() )->method( 'fromArray' )
135
-			->will( $this->throwException( new \RuntimeException() ) );
134
+		$object->expects($this->once())->method('fromArray')
135
+			->will($this->throwException(new \RuntimeException()));
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 testSaveMShopException()
143 143
 	{
144
-		$object = $this->getClientMock( 'fromArray' );
144
+		$object = $this->getClientMock('fromArray');
145 145
 
146
-		$object->expects( $this->once() )->method( 'fromArray' )
147
-			->will( $this->throwException( new \Aimeos\MShop\Exception() ) );
146
+		$object->expects($this->once())->method('fromArray')
147
+			->will($this->throwException(new \Aimeos\MShop\Exception()));
148 148
 
149
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
149
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
150 150
 		$object->save();
151 151
 	}
152 152
 
153 153
 
154 154
 	public function testSearch()
155 155
 	{
156
-		$this->assertNull( $this->object->search() );
156
+		$this->assertNull($this->object->search());
157 157
 	}
158 158
 
159 159
 
160 160
 	public function testGetSubClient()
161 161
 	{
162
-		$this->setExpectedException( \Aimeos\Admin\JQAdm\Exception::class );
163
-		$this->object->getSubClient( 'unknown' );
162
+		$this->setExpectedException(\Aimeos\Admin\JQAdm\Exception::class);
163
+		$this->object->getSubClient('unknown');
164 164
 	}
165 165
 
166 166
 
167
-	public function getClientMock( $method )
167
+	public function getClientMock($method)
168 168
 	{
169
-		$object = $this->getMockBuilder( \Aimeos\Admin\JQAdm\Attribute\Media\Standard::class )
170
-			->setConstructorArgs( array( $this->context, \TestHelperJqadm::getTemplatePaths() ) )
171
-			->setMethods( [$method] )
169
+		$object = $this->getMockBuilder(\Aimeos\Admin\JQAdm\Attribute\Media\Standard::class)
170
+			->setConstructorArgs(array($this->context, \TestHelperJqadm::getTemplatePaths()))
171
+			->setMethods([$method])
172 172
 			->getMock();
173 173
 
174 174
 		$view = \TestHelperJqadm::getView();
175
-		$view->item = \Aimeos\MShop::create( $this->context, 'attribute' )->createItem();
175
+		$view->item = \Aimeos\MShop::create($this->context, 'attribute')->createItem();
176 176
 
177
-		$object->setAimeos( \TestHelperJqadm::getAimeos() );
178
-		$object->setView( $view );
177
+		$object->setAimeos(\TestHelperJqadm::getAimeos());
178
+		$object->setView($view);
179 179
 
180 180
 		return $object;
181 181
 	}
Please login to merge, or discard this patch.