Completed
Push — master ( 1d5010...eee81b )
by Aimeos
15:07
created
controller/frontend/tests/Controller/Frontend/Attribute/FactoryTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,31 +15,31 @@
 block discarded – undo
15 15
 	{
16 16
 		$target = '\\Aimeos\\Controller\\Frontend\\Attribute\\Iface';
17 17
 
18
-		$controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext() );
19
-		$this->assertInstanceOf( $target, $controller );
18
+		$controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext());
19
+		$this->assertInstanceOf($target, $controller);
20 20
 
21
-		$controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' );
22
-		$this->assertInstanceOf( $target, $controller );
21
+		$controller = \Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'Standard');
22
+		$this->assertInstanceOf($target, $controller);
23 23
 	}
24 24
 
25 25
 
26 26
 	public function testCreateControllerInvalidImplementation()
27 27
 	{
28
-		$this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' );
29
-		\Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' );
28
+		$this->expectException('\\Aimeos\\Controller\\Frontend\\Exception');
29
+		\Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid');
30 30
 	}
31 31
 
32 32
 
33 33
 	public function testCreateControllerInvalidName()
34 34
 	{
35
-		$this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' );
36
-		\Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), '%^' );
35
+		$this->expectException('\\Aimeos\\Controller\\Frontend\\Exception');
36
+		\Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), '%^');
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testCreateControllerNotExisting()
41 41
 	{
42
-		$this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' );
43
-		\Aimeos\Controller\Frontend\Attribute\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' );
42
+		$this->expectException('\\Aimeos\\Controller\\Frontend\\Exception');
43
+		\Aimeos\Controller\Frontend\Attribute\Factory::createController(\TestHelperFrontend::getContext(), 'notexist');
44 44
 	}
45 45
 }
Please login to merge, or discard this patch.
frontend/tests/Controller/Frontend/Catalog/Decorator/BaseTest.php 1 patch
Spacing   +85 added lines, -85 removed lines patch added patch discarded remove patch
@@ -20,245 +20,245 @@
 block discarded – undo
20 20
 	{
21 21
 		$this->context = \TestHelperFrontend::getContext();
22 22
 
23
-		$this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Catalog\Standard' )
23
+		$this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Catalog\Standard')
24 24
 			->disableOriginalConstructor()
25 25
 			->getMock();
26 26
 
27
-		$this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Catalog\Decorator\Base' )
28
-			->setConstructorArgs( [$this->stub, $this->context] )
27
+		$this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Catalog\Decorator\Base')
28
+			->setConstructorArgs([$this->stub, $this->context])
29 29
 			->getMockForAbstractClass();
30 30
 	}
31 31
 
32 32
 
33 33
 	protected function tearDown()
34 34
 	{
35
-		unset( $this->context, $this->object, $this->stub );
35
+		unset($this->context, $this->object, $this->stub);
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testConstructException()
40 40
 	{
41
-		$stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Iface' )->getMock();
41
+		$stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Iface')->getMock();
42 42
 
43
-		$this->expectException( '\Aimeos\Controller\Frontend\Exception' );
43
+		$this->expectException('\Aimeos\Controller\Frontend\Exception');
44 44
 
45
-		$this->getMockBuilder( '\Aimeos\Controller\Frontend\Catalog\Decorator\Base' )
46
-			->setConstructorArgs( [$stub, $this->context] )
45
+		$this->getMockBuilder('\Aimeos\Controller\Frontend\Catalog\Decorator\Base')
46
+			->setConstructorArgs([$stub, $this->context])
47 47
 			->getMockForAbstractClass();
48 48
 	}
49 49
 
50 50
 
51 51
 	public function testCall()
52 52
 	{
53
-		$stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Catalog\Standard' )
53
+		$stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Catalog\Standard')
54 54
 			->disableOriginalConstructor()
55
-			->setMethods( ['invalid'] )
55
+			->setMethods(['invalid'])
56 56
 			->getMock();
57 57
 
58
-		$object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Catalog\Decorator\Base' )
59
-			->setConstructorArgs( [$stub, $this->context] )
58
+		$object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Catalog\Decorator\Base')
59
+			->setConstructorArgs([$stub, $this->context])
60 60
 			->getMockForAbstractClass();
61 61
 
62
-		$stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) );
62
+		$stub->expects($this->once())->method('invalid')->will($this->returnValue(true));
63 63
 
64
-		$this->assertTrue( $object->invalid() );
64
+		$this->assertTrue($object->invalid());
65 65
 	}
66 66
 
67 67
 
68 68
 	public function testCreateManager()
69 69
 	{
70
-		$catalogManager = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' );
70
+		$catalogManager = \Aimeos\MShop\Factory::createManager($this->context, 'catalog');
71 71
 
72
-		$this->stub->expects( $this->once() )->method( 'createManager' )
73
-			->will( $this->returnValue( $catalogManager ) );
72
+		$this->stub->expects($this->once())->method('createManager')
73
+			->will($this->returnValue($catalogManager));
74 74
 
75
-		$this->assertInstanceOf( '\Aimeos\MShop\Common\Manager\Iface', $this->object->createManager( 'catalog' ) );
75
+		$this->assertInstanceOf('\Aimeos\MShop\Common\Manager\Iface', $this->object->createManager('catalog'));
76 76
 	}
77 77
 
78 78
 
79 79
 	public function testCreateFilter()
80 80
 	{
81
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createSearch();
81
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createSearch();
82 82
 
83
-		$this->stub->expects( $this->once() )->method( 'createFilter' )
84
-			->will( $this->returnValue( $search ) );
83
+		$this->stub->expects($this->once())->method('createFilter')
84
+			->will($this->returnValue($search));
85 85
 
86
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() );
86
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter());
87 87
 	}
88 88
 
89 89
 
90 90
 	public function testGetPath()
91 91
 	{
92
-		$this->stub->expects( $this->once() )->method( 'getPath' )
93
-			->will( $this->returnValue( [] ) );
92
+		$this->stub->expects($this->once())->method('getPath')
93
+			->will($this->returnValue([]));
94 94
 
95
-		$this->assertEquals( [], $this->object->getPath( -1 ) );
95
+		$this->assertEquals([], $this->object->getPath( -1 ));
96 96
 	}
97 97
 
98 98
 
99 99
 	public function testGetTree()
100 100
 	{
101
-		$catItem = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createItem();
101
+		$catItem = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createItem();
102 102
 
103
-		$this->stub->expects( $this->once() )->method( 'getTree' )
104
-			->will( $this->returnValue( $catItem ) );
103
+		$this->stub->expects($this->once())->method('getTree')
104
+			->will($this->returnValue($catItem));
105 105
 
106
-		$this->assertInstanceOf( '\Aimeos\MShop\Catalog\Item\Iface', $this->object->getTree() );
106
+		$this->assertInstanceOf('\Aimeos\MShop\Catalog\Item\Iface', $this->object->getTree());
107 107
 	}
108 108
 
109 109
 
110 110
 	public function testCreateCatalogFilter()
111 111
 	{
112
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createSearch();
112
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createSearch();
113 113
 
114
-		$this->stub->expects( $this->once() )->method( 'createCatalogFilter' )
115
-			->will( $this->returnValue( $search ) );
114
+		$this->stub->expects($this->once())->method('createCatalogFilter')
115
+			->will($this->returnValue($search));
116 116
 
117
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createCatalogFilter() );
117
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createCatalogFilter());
118 118
 	}
119 119
 
120 120
 
121 121
 	public function testGetCatalogPath()
122 122
 	{
123
-		$this->stub->expects( $this->once() )->method( 'getCatalogPath' )
124
-			->will( $this->returnValue( [] ) );
123
+		$this->stub->expects($this->once())->method('getCatalogPath')
124
+			->will($this->returnValue([]));
125 125
 
126
-		$this->assertEquals( [], $this->object->getCatalogPath( -1 ) );
126
+		$this->assertEquals([], $this->object->getCatalogPath( -1 ));
127 127
 	}
128 128
 
129 129
 
130 130
 	public function testGetCatalogTree()
131 131
 	{
132
-		$catItem = \Aimeos\MShop\Factory::createManager( $this->context, 'catalog' )->createItem();
132
+		$catItem = \Aimeos\MShop\Factory::createManager($this->context, 'catalog')->createItem();
133 133
 
134
-		$this->stub->expects( $this->once() )->method( 'getCatalogTree' )
135
-			->will( $this->returnValue( $catItem ) );
134
+		$this->stub->expects($this->once())->method('getCatalogTree')
135
+			->will($this->returnValue($catItem));
136 136
 
137
-		$this->assertInstanceOf( '\Aimeos\MShop\Catalog\Item\Iface', $this->object->getCatalogTree() );
137
+		$this->assertInstanceOf('\Aimeos\MShop\Catalog\Item\Iface', $this->object->getCatalogTree());
138 138
 	}
139 139
 
140 140
 
141 141
 	public function testAggregateIndex()
142 142
 	{
143
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
143
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
144 144
 
145
-		$this->stub->expects( $this->once() )->method( 'aggregateIndex' )
146
-			->will( $this->returnValue( [] ) );
145
+		$this->stub->expects($this->once())->method('aggregateIndex')
146
+			->will($this->returnValue([]));
147 147
 
148
-		$this->assertEquals( [], $this->object->aggregateIndex( $search, 'test' ) );
148
+		$this->assertEquals([], $this->object->aggregateIndex($search, 'test'));
149 149
 	}
150 150
 
151 151
 
152 152
 	public function testAddIndexFilterCategory()
153 153
 	{
154
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
154
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
155 155
 
156
-		$this->stub->expects( $this->once() )->method( 'addIndexFilterCategory' )
157
-			->will( $this->returnArgument( 0 ) );
156
+		$this->stub->expects($this->once())->method('addIndexFilterCategory')
157
+			->will($this->returnArgument(0));
158 158
 
159
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addIndexFilterCategory( $search, -1 ) );
159
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addIndexFilterCategory($search, -1));
160 160
 	}
161 161
 
162 162
 
163 163
 	public function testAddIndexFilterText()
164 164
 	{
165
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
165
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
166 166
 
167
-		$this->stub->expects( $this->once() )->method( 'addIndexFilterText' )
168
-			->will( $this->returnArgument( 0 ) );
167
+		$this->stub->expects($this->once())->method('addIndexFilterText')
168
+			->will($this->returnArgument(0));
169 169
 
170
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addIndexFilterText( $search, 'test' ) );
170
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addIndexFilterText($search, 'test'));
171 171
 	}
172 172
 
173 173
 
174 174
 	public function testCreateIndexFilter()
175 175
 	{
176
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
176
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
177 177
 
178
-		$this->stub->expects( $this->once() )->method( 'createIndexFilter' )
179
-			->will( $this->returnValue( $search ) );
178
+		$this->stub->expects($this->once())->method('createIndexFilter')
179
+			->will($this->returnValue($search));
180 180
 
181
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilter() );
181
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilter());
182 182
 	}
183 183
 
184 184
 
185 185
 	public function testCreateIndexFilterCategory()
186 186
 	{
187
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
187
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
188 188
 
189
-		$this->stub->expects( $this->once() )->method( 'createIndexFilterCategory' )
190
-			->will( $this->returnValue( $search ) );
189
+		$this->stub->expects($this->once())->method('createIndexFilterCategory')
190
+			->will($this->returnValue($search));
191 191
 
192
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilterCategory( -1 ) );
192
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilterCategory( -1 ));
193 193
 	}
194 194
 
195 195
 
196 196
 	public function testCreateIndexFilterText()
197 197
 	{
198
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
198
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
199 199
 
200
-		$this->stub->expects( $this->once() )->method( 'createIndexFilterText' )
201
-			->will( $this->returnValue( $search ) );
200
+		$this->stub->expects($this->once())->method('createIndexFilterText')
201
+			->will($this->returnValue($search));
202 202
 
203
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilterText( 'test' ) );
203
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createIndexFilterText('test'));
204 204
 	}
205 205
 
206 206
 
207 207
 	public function testGetIndexItems()
208 208
 	{
209
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
209
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
210 210
 
211
-		$this->stub->expects( $this->once() )->method( 'getIndexItems' )
212
-			->will( $this->returnValue( [] ) );
211
+		$this->stub->expects($this->once())->method('getIndexItems')
212
+			->will($this->returnValue([]));
213 213
 
214
-		$this->assertEquals( [], $this->object->getIndexItems( $search ) );
214
+		$this->assertEquals([], $this->object->getIndexItems($search));
215 215
 	}
216 216
 
217 217
 
218 218
 	public function testGetProductItems()
219 219
 	{
220
-		$this->stub->expects( $this->once() )->method( 'getProductItems' )
221
-			->will( $this->returnValue( [] ) );
220
+		$this->stub->expects($this->once())->method('getProductItems')
221
+			->will($this->returnValue([]));
222 222
 
223
-		$this->assertEquals( [], $this->object->getProductItems( [-1] ) );
223
+		$this->assertEquals([], $this->object->getProductItems([-1]));
224 224
 	}
225 225
 
226 226
 
227 227
 	public function testCreateTextFilter()
228 228
 	{
229
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
229
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
230 230
 
231
-		$this->stub->expects( $this->once() )->method( 'createTextFilter' )
232
-			->will( $this->returnValue( $search ) );
231
+		$this->stub->expects($this->once())->method('createTextFilter')
232
+			->will($this->returnValue($search));
233 233
 
234
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createTextFilter( 'test' ) );
234
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createTextFilter('test'));
235 235
 	}
236 236
 
237 237
 
238 238
 	public function testGetTextList()
239 239
 	{
240
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'index' )->createSearch();
240
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'index')->createSearch();
241 241
 
242
-		$this->stub->expects( $this->once() )->method( 'getTextList' )
243
-			->will( $this->returnValue( [] ) );
242
+		$this->stub->expects($this->once())->method('getTextList')
243
+			->will($this->returnValue([]));
244 244
 
245
-		$this->assertEquals( [], $this->object->getTextList( $search ) );
245
+		$this->assertEquals([], $this->object->getTextList($search));
246 246
 	}
247 247
 
248 248
 
249 249
 	public function testGetController()
250 250
 	{
251
-		$result = $this->access( 'getController' )->invokeArgs( $this->object, [] );
251
+		$result = $this->access('getController')->invokeArgs($this->object, []);
252 252
 
253
-		$this->assertSame( $this->stub, $result );
253
+		$this->assertSame($this->stub, $result);
254 254
 	}
255 255
 
256 256
 
257
-	protected function access( $name )
257
+	protected function access($name)
258 258
 	{
259
-		$class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Catalog\Decorator\Base' );
260
-		$method = $class->getMethod( $name );
261
-		$method->setAccessible( true );
259
+		$class = new \ReflectionClass('\Aimeos\Controller\Frontend\Catalog\Decorator\Base');
260
+		$method = $class->getMethod($name);
261
+		$method->setAccessible(true);
262 262
 
263 263
 		return $method;
264 264
 	}
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Catalog/FactoryTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -14,31 +14,31 @@
 block discarded – undo
14 14
 	{
15 15
 		$target = '\\Aimeos\\Controller\\Frontend\\Catalog\\Iface';
16 16
 
17
-		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext() );
18
-		$this->assertInstanceOf( $target, $controller );
17
+		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext());
18
+		$this->assertInstanceOf($target, $controller);
19 19
 
20
-		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' );
21
-		$this->assertInstanceOf( $target, $controller );
20
+		$controller = \Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'Standard');
21
+		$this->assertInstanceOf($target, $controller);
22 22
 	}
23 23
 
24 24
 
25 25
 	public function testCreateControllerInvalidImplementation()
26 26
 	{
27
-		$this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' );
28
-		\Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' );
27
+		$this->expectException('\\Aimeos\\Controller\\Frontend\\Exception');
28
+		\Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid');
29 29
 	}
30 30
 
31 31
 
32 32
 	public function testCreateControllerInvalidName()
33 33
 	{
34
-		$this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' );
35
-		\Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), '%^' );
34
+		$this->expectException('\\Aimeos\\Controller\\Frontend\\Exception');
35
+		\Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), '%^');
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testCreateControllerNotExisting()
40 40
 	{
41
-		$this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' );
42
-		\Aimeos\Controller\Frontend\Catalog\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' );
41
+		$this->expectException('\\Aimeos\\Controller\\Frontend\\Exception');
42
+		\Aimeos\Controller\Frontend\Catalog\Factory::createController(\TestHelperFrontend::getContext(), 'notexist');
43 43
 	}
44 44
 }
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Stock/Decorator/BaseTest.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -20,119 +20,119 @@
 block discarded – undo
20 20
 	{
21 21
 		$this->context = \TestHelperFrontend::getContext();
22 22
 
23
-		$this->stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Stock\Standard' )
23
+		$this->stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Stock\Standard')
24 24
 			->disableOriginalConstructor()
25 25
 			->getMock();
26 26
 
27
-		$this->object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Stock\Decorator\Base' )
28
-			->setConstructorArgs( [$this->stub, $this->context] )
27
+		$this->object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Stock\Decorator\Base')
28
+			->setConstructorArgs([$this->stub, $this->context])
29 29
 			->getMockForAbstractClass();
30 30
 	}
31 31
 
32 32
 
33 33
 	protected function tearDown()
34 34
 	{
35
-		unset( $this->context, $this->object, $this->stub );
35
+		unset($this->context, $this->object, $this->stub);
36 36
 	}
37 37
 
38 38
 
39 39
 	public function testConstructException()
40 40
 	{
41
-		$stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Iface' )->getMock();
41
+		$stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Iface')->getMock();
42 42
 
43
-		$this->expectException( '\Aimeos\Controller\Frontend\Exception' );
43
+		$this->expectException('\Aimeos\Controller\Frontend\Exception');
44 44
 
45
-		$this->getMockBuilder( '\Aimeos\Controller\Frontend\Stock\Decorator\Base' )
46
-			->setConstructorArgs( [$stub, $this->context] )
45
+		$this->getMockBuilder('\Aimeos\Controller\Frontend\Stock\Decorator\Base')
46
+			->setConstructorArgs([$stub, $this->context])
47 47
 			->getMockForAbstractClass();
48 48
 	}
49 49
 
50 50
 
51 51
 	public function testCall()
52 52
 	{
53
-		$stub = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Stock\Standard' )
53
+		$stub = $this->getMockBuilder('\Aimeos\Controller\Frontend\Stock\Standard')
54 54
 			->disableOriginalConstructor()
55
-			->setMethods( ['invalid'] )
55
+			->setMethods(['invalid'])
56 56
 			->getMock();
57 57
 
58
-		$object = $this->getMockBuilder( '\Aimeos\Controller\Frontend\Stock\Decorator\Base' )
59
-			->setConstructorArgs( [$stub, $this->context] )
58
+		$object = $this->getMockBuilder('\Aimeos\Controller\Frontend\Stock\Decorator\Base')
59
+			->setConstructorArgs([$stub, $this->context])
60 60
 			->getMockForAbstractClass();
61 61
 
62
-		$stub->expects( $this->once() )->method( 'invalid' )->will( $this->returnValue( true ) );
62
+		$stub->expects($this->once())->method('invalid')->will($this->returnValue(true));
63 63
 
64
-		$this->assertTrue( $object->invalid() );
64
+		$this->assertTrue($object->invalid());
65 65
 	}
66 66
 
67 67
 
68 68
 	public function testAddFilterCodes()
69 69
 	{
70
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'stock' )->createSearch();
70
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'stock')->createSearch();
71 71
 
72
-		$this->stub->expects( $this->once() )->method( 'addFilterCodes' )
73
-			->will( $this->returnArgument( 0 ) );
72
+		$this->stub->expects($this->once())->method('addFilterCodes')
73
+			->will($this->returnArgument(0));
74 74
 
75
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterCodes( $search, [] ) );
75
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterCodes($search, []));
76 76
 	}
77 77
 
78 78
 
79 79
 	public function testAddFilterTypes()
80 80
 	{
81
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'stock' )->createSearch();
81
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'stock')->createSearch();
82 82
 
83
-		$this->stub->expects( $this->once() )->method( 'addFilterTypes' )
84
-			->will( $this->returnArgument( 0 ) );
83
+		$this->stub->expects($this->once())->method('addFilterTypes')
84
+			->will($this->returnArgument(0));
85 85
 
86
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->addFilterTypes( $search, [] ) );
86
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->addFilterTypes($search, []));
87 87
 	}
88 88
 
89 89
 
90 90
 	public function testCreateFilter()
91 91
 	{
92
-		$search = \Aimeos\MShop\Factory::createManager( $this->context, 'stock' )->createSearch();
92
+		$search = \Aimeos\MShop\Factory::createManager($this->context, 'stock')->createSearch();
93 93
 
94
-		$this->stub->expects( $this->once() )->method( 'createFilter' )
95
-			->will( $this->returnValue( $search ) );
94
+		$this->stub->expects($this->once())->method('createFilter')
95
+			->will($this->returnValue($search));
96 96
 
97
-		$this->assertInstanceOf( '\Aimeos\MW\Criteria\Iface', $this->object->createFilter() );
97
+		$this->assertInstanceOf('\Aimeos\MW\Criteria\Iface', $this->object->createFilter());
98 98
 	}
99 99
 
100 100
 
101 101
 	public function testGetItem()
102 102
 	{
103
-		$item = \Aimeos\MShop\Factory::createManager( $this->context, 'stock' )->createItem();
103
+		$item = \Aimeos\MShop\Factory::createManager($this->context, 'stock')->createItem();
104 104
 
105
-		$this->stub->expects( $this->once() )->method( 'getItem' )
106
-			->will( $this->returnValue( $item ) );
105
+		$this->stub->expects($this->once())->method('getItem')
106
+			->will($this->returnValue($item));
107 107
 
108
-		$this->assertInstanceOf( '\Aimeos\MShop\Stock\Item\Iface', $this->object->getItem( -1 ) );
108
+		$this->assertInstanceOf('\Aimeos\MShop\Stock\Item\Iface', $this->object->getItem( -1 ));
109 109
 	}
110 110
 
111 111
 
112 112
 	public function testSearchItems()
113 113
 	{
114
-		$filter = \Aimeos\MShop\Factory::createManager( $this->context, 'stock' )->createSearch();
114
+		$filter = \Aimeos\MShop\Factory::createManager($this->context, 'stock')->createSearch();
115 115
 
116
-		$this->stub->expects( $this->once() )->method( 'searchItems' )
117
-			->will( $this->returnValue( [] ) );
116
+		$this->stub->expects($this->once())->method('searchItems')
117
+			->will($this->returnValue([]));
118 118
 
119
-		$this->assertEquals( [], $this->object->searchItems( $filter ) );
119
+		$this->assertEquals([], $this->object->searchItems($filter));
120 120
 	}
121 121
 
122 122
 
123 123
 	public function testGetController()
124 124
 	{
125
-		$result = $this->access( 'getController' )->invokeArgs( $this->object, [] );
125
+		$result = $this->access('getController')->invokeArgs($this->object, []);
126 126
 
127
-		$this->assertSame( $this->stub, $result );
127
+		$this->assertSame($this->stub, $result);
128 128
 	}
129 129
 
130 130
 
131
-	protected function access( $name )
131
+	protected function access($name)
132 132
 	{
133
-		$class = new \ReflectionClass( '\Aimeos\Controller\Frontend\Stock\Decorator\Base' );
134
-		$method = $class->getMethod( $name );
135
-		$method->setAccessible( true );
133
+		$class = new \ReflectionClass('\Aimeos\Controller\Frontend\Stock\Decorator\Base');
134
+		$method = $class->getMethod($name);
135
+		$method->setAccessible(true);
136 136
 
137 137
 		return $method;
138 138
 	}
Please login to merge, or discard this patch.
controller/frontend/tests/Controller/Frontend/Stock/FactoryTest.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -15,31 +15,31 @@
 block discarded – undo
15 15
 	{
16 16
 		$target = '\\Aimeos\\Controller\\Frontend\\Stock\\Iface';
17 17
 
18
-		$controller = \Aimeos\Controller\Frontend\Stock\Factory::createController( \TestHelperFrontend::getContext() );
19
-		$this->assertInstanceOf( $target, $controller );
18
+		$controller = \Aimeos\Controller\Frontend\Stock\Factory::createController(\TestHelperFrontend::getContext());
19
+		$this->assertInstanceOf($target, $controller);
20 20
 
21
-		$controller = \Aimeos\Controller\Frontend\Stock\Factory::createController( \TestHelperFrontend::getContext(), 'Standard' );
22
-		$this->assertInstanceOf( $target, $controller );
21
+		$controller = \Aimeos\Controller\Frontend\Stock\Factory::createController(\TestHelperFrontend::getContext(), 'Standard');
22
+		$this->assertInstanceOf($target, $controller);
23 23
 	}
24 24
 
25 25
 
26 26
 	public function testCreateControllerInvalidImplementation()
27 27
 	{
28
-		$this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' );
29
-		\Aimeos\Controller\Frontend\Stock\Factory::createController( \TestHelperFrontend::getContext(), 'Invalid' );
28
+		$this->expectException('\\Aimeos\\Controller\\Frontend\\Exception');
29
+		\Aimeos\Controller\Frontend\Stock\Factory::createController(\TestHelperFrontend::getContext(), 'Invalid');
30 30
 	}
31 31
 
32 32
 
33 33
 	public function testCreateControllerInvalidName()
34 34
 	{
35
-		$this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' );
36
-		\Aimeos\Controller\Frontend\Stock\Factory::createController( \TestHelperFrontend::getContext(), '%^' );
35
+		$this->expectException('\\Aimeos\\Controller\\Frontend\\Exception');
36
+		\Aimeos\Controller\Frontend\Stock\Factory::createController(\TestHelperFrontend::getContext(), '%^');
37 37
 	}
38 38
 
39 39
 
40 40
 	public function testCreateControllerNotExisting()
41 41
 	{
42
-		$this->expectException( '\\Aimeos\\Controller\\Frontend\\Exception' );
43
-		\Aimeos\Controller\Frontend\Stock\Factory::createController( \TestHelperFrontend::getContext(), 'notexist' );
42
+		$this->expectException('\\Aimeos\\Controller\\Frontend\\Exception');
43
+		\Aimeos\Controller\Frontend\Stock\Factory::createController(\TestHelperFrontend::getContext(), 'notexist');
44 44
 	}
45 45
 }
Please login to merge, or discard this patch.