[TASK] Replace inject methods with @inject
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Tests / Unit / Configuration / AbstractConfigurationManagerTest.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Tests\Unit\Configuration;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * All rights reserved
8 *
9 * This class is a backport of the corresponding class of TYPO3 Flow.
10 * All credits go to the TYPO3 Flow team.
11 *
12 * This script is part of the TYPO3 project. The TYPO3 project is
13 * free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * The GNU General Public License can be found at
19 * http://www.gnu.org/copyleft/gpl.html.
20 *
21 * This script is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * This copyright notice MUST APPEAR in all copies of the script!
27 ***************************************************************/
28 class AbstractConfigurationManagerTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
29
30 /**
31 * @var \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
32 */
33 protected $abstractConfigurationManager;
34
35 /**
36 * @var \TYPO3\CMS\Extbase\Service\TypoScriptService|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface
37 */
38 protected $mockTypoScriptService;
39
40 /**
41 * @var array
42 */
43 protected $testTypoScriptSetup = array(
44 'foo.' => array(
45 'bar' => 'baz'
46 ),
47 'config.' => array(
48 'tx_extbase.' => array(
49 'settings.' => array(
50 'setting1' => 'value1',
51 'setting2' => 'value2'
52 ),
53 'view.' => array(
54 'viewSub.' => array(
55 'key1' => 'value1',
56 'key2' => 'value2'
57 )
58 )
59 )
60 )
61 );
62
63 /**
64 * @var array
65 */
66 protected $testTypoScriptSetupConverted = array(
67 'foo' => array(
68 'bar' => 'baz'
69 ),
70 'config' => array(
71 'tx_extbase' => array(
72 'settings' => array(
73 'setting1' => 'value1',
74 'setting2' => 'value2'
75 ),
76 'view' => array(
77 'viewSub' => array(
78 'key1' => 'value1',
79 'key2' => 'value2'
80 )
81 )
82 )
83 )
84 );
85
86 /**
87 * @var array
88 */
89 protected $testPluginConfiguration = array(
90 'settings' => array(
91 'setting1' => 'overriddenValue1',
92 'setting3' => 'additionalValue'
93 ),
94 'view' => array(
95 'viewSub' => array(
96 'key1' => 'overridden',
97 'key3' => 'new key'
98 )
99 ),
100 'persistence' => array(
101 'storagePid' => '123'
102 )
103 );
104
105 /**
106 * @var array
107 */
108 protected $testSwitchableControllerActions = array(
109 'Controller1' => array(
110 'actions' => array('action1', 'action2', 'action3')
111 ),
112 'Controller2' => array(
113 'actions' => array('action4', 'action5', 'action6'),
114 'nonCacheableActions' => array('action4', 'action6')
115 )
116 );
117
118 /**
119 * Sets up this testcase
120 */
121 public function setUp() {
122 $this->abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids'));
123 $this->mockTypoScriptService = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService');
124 $this->abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
125 }
126
127 /**
128 * @test
129 */
130 public function setConfigurationResetsConfigurationCache() {
131 $this->abstractConfigurationManager->_set('configurationCache', array('foo' => 'bar'));
132 $this->abstractConfigurationManager->setConfiguration(array());
133 $this->assertEquals(array(), $this->abstractConfigurationManager->_get('configurationCache'));
134 }
135
136 /**
137 * @test
138 */
139 public function setConfigurationSetsExtensionAndPluginName() {
140 $configuration = array(
141 'extensionName' => 'SomeExtensionName',
142 'pluginName' => 'SomePluginName'
143 );
144 $this->abstractConfigurationManager->setConfiguration($configuration);
145 $this->assertEquals('SomeExtensionName', $this->abstractConfigurationManager->_get('extensionName'));
146 $this->assertEquals('SomePluginName', $this->abstractConfigurationManager->_get('pluginName'));
147 }
148
149 /**
150 * @test
151 */
152 public function setConfigurationConvertsTypoScriptArrayToPlainArray() {
153 $configuration = array(
154 'foo' => 'bar',
155 'settings.' => array('foo' => 'bar'),
156 'view.' => array('subkey.' => array('subsubkey' => 'subsubvalue'))
157 );
158 $expectedResult = array(
159 'foo' => 'bar',
160 'settings' => array('foo' => 'bar'),
161 'view' => array('subkey' => array('subsubkey' => 'subsubvalue'))
162 );
163 $this->mockTypoScriptService->expects($this->atLeastOnce())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($expectedResult));
164 $this->abstractConfigurationManager->setConfiguration($configuration);
165 $this->assertEquals($expectedResult, $this->abstractConfigurationManager->_get('configuration'));
166 }
167
168 /**
169 * @test
170 */
171 public function getConfigurationReturnsCachedResultOfCurrentPlugin() {
172 $this->abstractConfigurationManager->_set('extensionName', 'CurrentExtensionName');
173 $this->abstractConfigurationManager->_set('pluginName', 'CurrentPluginName');
174 $this->abstractConfigurationManager->_set('configurationCache', array('currentextensionname_currentpluginname' => array('foo' => 'bar'), 'someotherextension_somepluginname' => array('baz' => 'shouldnotbereturned')));
175 $expectedResult = array('foo' => 'bar');
176 $actualResult = $this->abstractConfigurationManager->getConfiguration();
177 $this->assertEquals($expectedResult, $actualResult);
178 }
179
180 /**
181 * @test
182 */
183 public function getConfigurationReturnsCachedResultForGivenExtension() {
184 $this->abstractConfigurationManager->_set('configurationCache', array('someextensionname_somepluginname' => array('foo' => 'bar'), 'someotherextension_somepluginname' => array('baz' => 'shouldnotbereturned')));
185 $expectedResult = array('foo' => 'bar');
186 $actualResult = $this->abstractConfigurationManager->getConfiguration('SomeExtensionName', 'SomePluginName');
187 $this->assertEquals($expectedResult, $actualResult);
188 }
189
190 /**
191 * @test
192 */
193 public function getConfigurationRecursivelyMergesCurrentPluginConfigurationWithFrameworkConfiguration() {
194 $this->abstractConfigurationManager->_set('extensionName', 'CurrentExtensionName');
195 $this->abstractConfigurationManager->_set('pluginName', 'CurrentPluginName');
196 $this->abstractConfigurationManager->expects($this->once())->method('getTypoScriptSetup')->will($this->returnValue($this->testTypoScriptSetup));
197 $this->mockTypoScriptService->expects($this->atLeastOnce())->method('convertTypoScriptArrayToPlainArray')->with($this->testTypoScriptSetup['config.']['tx_extbase.'])->will($this->returnValue($this->testTypoScriptSetupConverted['config']['tx_extbase']));
198 $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testPluginConfiguration));
199 $expectedResult = array(
200 'settings' => array(
201 'setting1' => 'overriddenValue1',
202 'setting2' => 'value2',
203 'setting3' => 'additionalValue'
204 ),
205 'view' => array(
206 'viewSub' => array(
207 'key1' => 'overridden',
208 'key2' => 'value2',
209 'key3' => 'new key'
210 )
211 ),
212 'persistence' => array(
213 'storagePid' => '123'
214 ),
215 'controllerConfiguration' => NULL
216 );
217 $this->abstractConfigurationManager->expects($this->once())->method('getContextSpecificFrameworkConfiguration')->with($expectedResult)->will($this->returnValue($expectedResult));
218 $actualResult = $this->abstractConfigurationManager->getConfiguration();
219 $this->assertEquals($expectedResult, $actualResult);
220 }
221
222 /**
223 * @test
224 */
225 public function getConfigurationRecursivelyMergesPluginConfigurationOfSpecifiedPluginWithFrameworkConfiguration() {
226 $this->abstractConfigurationManager->expects($this->once())->method('getTypoScriptSetup')->will($this->returnValue($this->testTypoScriptSetup));
227 $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with('SomeExtensionName', 'SomePluginName')->will($this->returnValue($this->testPluginConfiguration));
228 $this->mockTypoScriptService->expects($this->atLeastOnce())->method('convertTypoScriptArrayToPlainArray')->with($this->testTypoScriptSetup['config.']['tx_extbase.'])->will($this->returnValue($this->testTypoScriptSetupConverted['config']['tx_extbase']));
229 $expectedResult = array(
230 'settings' => array(
231 'setting1' => 'overriddenValue1',
232 'setting2' => 'value2',
233 'setting3' => 'additionalValue'
234 ),
235 'view' => array(
236 'viewSub' => array(
237 'key1' => 'overridden',
238 'key2' => 'value2',
239 'key3' => 'new key'
240 )
241 ),
242 'persistence' => array(
243 'storagePid' => '123'
244 ),
245 'controllerConfiguration' => NULL
246 );
247 $this->abstractConfigurationManager->expects($this->never())->method('getContextSpecificFrameworkConfiguration');
248 $actualResult = $this->abstractConfigurationManager->getConfiguration('SomeExtensionName', 'SomePluginName');
249 $this->assertEquals($expectedResult, $actualResult);
250 }
251
252 /**
253 * @test
254 */
255 public function getConfigurationDoesNotOverrideConfigurationWithContextSpecificFrameworkConfigurationIfDifferentPluginIsSpecified() {
256 $this->abstractConfigurationManager->expects($this->never())->method('getContextSpecificFrameworkConfiguration');
257 $this->abstractConfigurationManager->getConfiguration('SomeExtensionName', 'SomePluginName');
258 }
259
260 /**
261 * @test
262 */
263 public function getConfigurationOverridesConfigurationWithContextSpecificFrameworkConfigurationIfNoPluginWasSpecified() {
264 $this->abstractConfigurationManager->expects($this->once())->method('getTypoScriptSetup')->will($this->returnValue($this->testTypoScriptSetup));
265 $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with()->will($this->returnValue($this->testPluginConfiguration));
266 $contextSpecifixFrameworkConfiguration = array(
267 'context' => array(
268 'specific' => 'framwork',
269 'conf' => 'iguration'
270 )
271 );
272 $this->abstractConfigurationManager->expects($this->once())->method('getContextSpecificFrameworkConfiguration')->will($this->returnValue($contextSpecifixFrameworkConfiguration));
273 $actualResult = $this->abstractConfigurationManager->getConfiguration();
274 $this->assertEquals($contextSpecifixFrameworkConfiguration, $actualResult);
275 }
276
277 /**
278 * @test
279 */
280 public function getConfigurationOverridesConfigurationWithContextSpecificFrameworkConfigurationIfSpecifiedPluginIsTheCurrentPlugin() {
281 $this->abstractConfigurationManager->_set('extensionName', 'CurrentExtensionName');
282 $this->abstractConfigurationManager->_set('pluginName', 'CurrentPluginName');
283 $this->abstractConfigurationManager->expects($this->once())->method('getTypoScriptSetup')->will($this->returnValue($this->testTypoScriptSetup));
284 $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testPluginConfiguration));
285 $contextSpecifixFrameworkConfiguration = array(
286 'context' => array(
287 'specific' => 'framwork',
288 'conf' => 'iguration'
289 )
290 );
291 $this->abstractConfigurationManager->expects($this->once())->method('getContextSpecificFrameworkConfiguration')->will($this->returnValue($contextSpecifixFrameworkConfiguration));
292 $actualResult = $this->abstractConfigurationManager->getConfiguration('CurrentExtensionName', 'CurrentPluginName');
293 $this->assertEquals($contextSpecifixFrameworkConfiguration, $actualResult);
294 }
295
296 /**
297 * @test
298 */
299 public function getConfigurationStoresResultInConfigurationCache() {
300 $this->abstractConfigurationManager->_set('extensionName', 'CurrentExtensionName');
301 $this->abstractConfigurationManager->_set('pluginName', 'CurrentPluginName');
302 $this->abstractConfigurationManager->expects($this->any())->method('getPluginConfiguration')->will($this->returnValue(array('foo' => 'bar')));
303 $this->abstractConfigurationManager->getConfiguration();
304 $this->abstractConfigurationManager->getConfiguration('SomeOtherExtensionName', 'SomeOtherCurrentPluginName');
305 $expectedResult = array('currentextensionname_currentpluginname', 'someotherextensionname_someothercurrentpluginname');
306 $actualResult = array_keys($this->abstractConfigurationManager->_get('configurationCache'));
307 $this->assertEquals($expectedResult, $actualResult);
308 }
309
310 /**
311 * switchableControllerActions *
312 */
313 /**
314 * @test
315 */
316 public function switchableControllerActionsAreNotOverriddenIfPluginNameIsSpecified() {
317 /** @var \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
318 $abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('overrideSwitchableControllerActions', 'getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids'));
319 $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
320 $abstractConfigurationManager->setConfiguration(array('switchableControllerActions' => array('overriddenSwitchableControllerActions')));
321 $abstractConfigurationManager->expects($this->any())->method('getPluginConfiguration')->will($this->returnValue(array()));
322 $abstractConfigurationManager->expects($this->never())->method('overrideSwitchableControllerActions');
323 $abstractConfigurationManager->getConfiguration('SomeExtensionName', 'SomePluginName');
324 }
325
326 /**
327 * @test
328 */
329 public function switchableControllerActionsAreOverriddenIfSpecifiedPluginIsTheCurrentPlugin() {
330 /** @var \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
331 $configuration = array('extensionName' => 'CurrentExtensionName', 'pluginName' => 'CurrentPluginName', 'switchableControllerActions' => array('overriddenSwitchableControllerActions'));
332 $abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('overrideSwitchableControllerActions', 'getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids'));
333 $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration));
334 $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
335 $abstractConfigurationManager->setConfiguration($configuration);
336 $abstractConfigurationManager->expects($this->any())->method('getPluginConfiguration')->will($this->returnValue(array()));
337 $abstractConfigurationManager->expects($this->once())->method('overrideSwitchableControllerActions');
338 $abstractConfigurationManager->getConfiguration('CurrentExtensionName', 'CurrentPluginName');
339 }
340
341 /**
342 * @test
343 */
344 public function switchableControllerActionsAreOverriddenIfPluginNameIsNotSpecified() {
345 /** @var \TYPO3\CMS\Extbase\Configuration\AbstractConfigurationManager|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
346 $configuration = array('switchableControllerActions' => array('overriddenSwitchableControllerActions'));
347 $abstractConfigurationManager = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Configuration\\AbstractConfigurationManager', array('overrideSwitchableControllerActions', 'getContextSpecificFrameworkConfiguration', 'getTypoScriptSetup', 'getPluginConfiguration', 'getSwitchableControllerActions', 'getRecursiveStoragePids'));
348 $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration));
349 $abstractConfigurationManager->_set('typoScriptService', $this->mockTypoScriptService);
350 $abstractConfigurationManager->setConfiguration($configuration);
351 $abstractConfigurationManager->expects($this->any())->method('getPluginConfiguration')->will($this->returnValue(array()));
352 $abstractConfigurationManager->expects($this->once())->method('overrideSwitchableControllerActions');
353 $abstractConfigurationManager->getConfiguration();
354 }
355
356 /**
357 * @test
358 */
359 public function orderOfActionsCanBeOverriddenForCurrentPlugin() {
360 $configuration = array(
361 'extensionName' => 'CurrentExtensionName',
362 'pluginName' => 'CurrentPluginName',
363 'switchableControllerActions' => array(
364 'Controller1' => array('action2', 'action1', 'action3')
365 )
366 );
367 $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration));
368 $this->abstractConfigurationManager->setConfiguration($configuration);
369 $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testPluginConfiguration));
370 $this->abstractConfigurationManager->expects($this->once())->method('getSwitchableControllerActions')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testSwitchableControllerActions));
371 $this->abstractConfigurationManager->expects($this->once())->method('getContextSpecificFrameworkConfiguration')->will($this->returnCallBack(create_function('$a', 'return $a;')));
372 $mergedConfiguration = $this->abstractConfigurationManager->getConfiguration();
373 $expectedResult = array(
374 'Controller1' => array(
375 'actions' => array('action2', 'action1', 'action3')
376 )
377 );
378 $actualResult = $mergedConfiguration['controllerConfiguration'];
379 $this->assertEquals($expectedResult, $actualResult);
380 }
381
382 /**
383 * @test
384 */
385 public function newActionsCanBeAddedForCurrentPlugin() {
386 $configuration = array(
387 'extensionName' => 'CurrentExtensionName',
388 'pluginName' => 'CurrentPluginName',
389 'switchableControllerActions' => array(
390 'Controller1' => array('action2', 'action1', 'action3', 'newAction')
391 )
392 );
393 $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration));
394 $this->abstractConfigurationManager->setConfiguration($configuration);
395 $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testPluginConfiguration));
396 $this->abstractConfigurationManager->expects($this->once())->method('getSwitchableControllerActions')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testSwitchableControllerActions));
397 $this->abstractConfigurationManager->expects($this->once())->method('getContextSpecificFrameworkConfiguration')->will($this->returnCallBack(create_function('$a', 'return $a;')));
398 $mergedConfiguration = $this->abstractConfigurationManager->getConfiguration();
399 $expectedResult = array(
400 'Controller1' => array(
401 'actions' => array('action2', 'action1', 'action3', 'newAction')
402 )
403 );
404 $actualResult = $mergedConfiguration['controllerConfiguration'];
405 $this->assertEquals($expectedResult, $actualResult);
406 }
407
408 /**
409 * @test
410 */
411 public function controllersCanNotBeOverridden() {
412 $configuration = array(
413 'extensionName' => 'CurrentExtensionName',
414 'pluginName' => 'CurrentPluginName',
415 'switchableControllerActions' => array(
416 'NewController' => array('action1', 'action2')
417 )
418 );
419 $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration));
420 $this->abstractConfigurationManager->setConfiguration($configuration);
421 $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testPluginConfiguration));
422 $this->abstractConfigurationManager->expects($this->once())->method('getSwitchableControllerActions')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testSwitchableControllerActions));
423 $this->abstractConfigurationManager->expects($this->once())->method('getContextSpecificFrameworkConfiguration')->will($this->returnCallBack(create_function('$a', 'return $a;')));
424 $mergedConfiguration = $this->abstractConfigurationManager->getConfiguration();
425 $expectedResult = array();
426 $actualResult = $mergedConfiguration['controllerConfiguration'];
427 $this->assertEquals($expectedResult, $actualResult);
428 }
429
430 /**
431 * @test
432 */
433 public function cachingOfActionsCanNotBeChanged() {
434 $configuration = array(
435 'extensionName' => 'CurrentExtensionName',
436 'pluginName' => 'CurrentPluginName',
437 'switchableControllerActions' => array(
438 'Controller1' => array('newAction', 'action1'),
439 'Controller2' => array('newAction2', 'action4', 'action5')
440 )
441 );
442 $this->mockTypoScriptService->expects($this->any())->method('convertTypoScriptArrayToPlainArray')->with($configuration)->will($this->returnValue($configuration));
443 $this->abstractConfigurationManager->setConfiguration($configuration);
444 $this->abstractConfigurationManager->expects($this->once())->method('getPluginConfiguration')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testPluginConfiguration));
445 $this->abstractConfigurationManager->expects($this->once())->method('getSwitchableControllerActions')->with('CurrentExtensionName', 'CurrentPluginName')->will($this->returnValue($this->testSwitchableControllerActions));
446 $this->abstractConfigurationManager->expects($this->once())->method('getContextSpecificFrameworkConfiguration')->will($this->returnCallBack(create_function('$a', 'return $a;')));
447 $mergedConfiguration = $this->abstractConfigurationManager->getConfiguration();
448 $expectedResult = array(
449 'Controller1' => array(
450 'actions' => array('newAction', 'action1')
451 ),
452 'Controller2' => array(
453 'actions' => array('newAction2', 'action4', 'action5'),
454 'nonCacheableActions' => array('action4')
455 )
456 );
457 $actualResult = $mergedConfiguration['controllerConfiguration'];
458 $this->assertEquals($expectedResult, $actualResult);
459 }
460
461 /**
462 * @test
463 */
464 public function getContentObjectReturnsNullIfNoContentObjectHasBeenSet() {
465 $this->assertNull($this->abstractConfigurationManager->getContentObject());
466 }
467
468 /**
469 * @test
470 */
471 public function getContentObjectTheCurrentContentObject() {
472 $mockContentObject = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
473 $this->abstractConfigurationManager->setContentObject($mockContentObject);
474 $this->assertSame($this->abstractConfigurationManager->getContentObject(), $mockContentObject);
475 }
476 }
477
478 ?>