108 public function setUp() {
110 $this->view = $this->
getAccessibleMock(
'TYPO3\\CMS\\Fluid\\View\\StandaloneView', array(
'testFileExistence',
'buildParserConfiguration'), array(),
'', FALSE);
111 $this->mockTemplateParser = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser');
112 $this->mockParsedTemplate = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Parser\\ParsedTemplateInterface');
113 $this->mockTemplateParser->expects($this->any())->method(
'parse')->will($this->returnValue($this->mockParsedTemplate));
114 $this->mockConfigurationManager = $this->getMock(
'TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
115 $this->mockObjectManager = $this->getMock(
'TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
116 $this->mockObjectManager->expects($this->any())->method(
'get')->will($this->returnCallback(array($this,
'objectManagerCallback')));
117 $this->mockRequest = $this->getMock(
'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
118 $this->mockUriBuilder = $this->getMock(
'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder');
119 $this->mockFlashMessageContainer = $this->getMock(
'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\FlashMessageContainer');
120 $this->mockContentObject = $this->getMock(
'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
121 $this->mockControllerContext = $this->getMock(
'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext');
122 $this->mockControllerContext->expects($this->any())->method(
'getRequest')->will($this->returnValue($this->mockRequest));
123 $this->mockViewHelperVariableContainer = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\ViewHelper\\ViewHelperVariableContainer');
124 $this->mockRenderingContext = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext');
125 $this->mockRenderingContext->expects($this->any())->method(
'getControllerContext')->will($this->returnValue($this->mockControllerContext));
126 $this->mockRenderingContext->expects($this->any())->method(
'getViewHelperVariableContainer')->will($this->returnValue($this->mockViewHelperVariableContainer));
127 $this->view->_set(
'templateParser', $this->mockTemplateParser);
128 $this->view->_set(
'objectManager', $this->mockObjectManager);
129 $this->view->setRenderingContext($this->mockRenderingContext);
130 $this->mockTemplateCompiler = $this->getMock(
'TYPO3\\CMS\\Fluid\\Core\\Compiler\\TemplateCompiler');
131 $this->view->_set(
'templateCompiler', $this->mockTemplateCompiler);
136 $mockCacheManager = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\CacheManager', array(), array(),
'', FALSE);
137 $mockCache = $this->getMock(
'TYPO3\\CMS\\Core\\Cache\\Frontend\\PhpFrontend', array(), array(),
'', FALSE);
138 $mockCacheManager->expects($this->any())->method(
'getCache')->will($this->returnValue($mockCache));
156 switch ($className) {
157 case 'TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface':
159 case 'TYPO3\\CMS\\Fluid\\Core\\Parser\\TemplateParser':
161 case 'TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContext':
163 case 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request':
165 case 'TYPO3\\CMS\\Extbase\\Mvc\\Web\\Routing\\UriBuilder':
167 case 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ControllerContext':
169 case 'TYPO3\\CMS\\Extbase\\Mvc\\Controller\\FlashMessageContainer':
171 case 'TYPO3\\CMS\\Fluid\\Core\\Compiler\\TemplateCompiler':
174 throw new \InvalidArgumentException(
'objectManagerCallback cannot handle class "' . $className .
'". Looks like incomplete mocking in the tests.', 1417105493);
180 public function constructorSetsSpecifiedContentObject() {
182 $mockContentObject = $this->getMock(
'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
183 $this->mockConfigurationManager->expects($this->once())->method(
'setContentObject')->with($this->identicalTo(
$mockContentObject));
191 $this->mockConfigurationManager->expects($this->once())->method(
'setContentObject')->with($this->identicalTo($this->mockContentObject));
200 $this->mockRequest->expects($this->once())->method(
'setRequestURI')->with($expectedRequestUri);
209 $this->mockRequest->expects($this->once())->method(
'setBaseURI')->with($expectedBaseUri);
217 $this->mockUriBuilder->expects($this->once())->method(
'setRequest')->with($this->mockRequest);
225 $this->mockControllerContext->expects($this->once())->method(
'setRequest')->with($this->mockRequest);
233 $this->mockControllerContext->expects($this->once())->method(
'setUriBuilder')->with($this->mockUriBuilder);
242 $this->view->render();
249 $this->view->setTemplateSource(
'The Template Source');
250 $this->mockTemplateParser->expects($this->once())->method(
'parse')->with(
'The Template Source');
251 $this->view->render();
259 $expectedResult = file_get_contents($templatePathAndFilename);
260 $this->view->setTemplatePathAndFilename($templatePathAndFilename);
261 $this->mockTemplateParser->expects($this->once())->method(
'parse')->with($expectedResult);
262 $this->view->render();
270 $this->view->setTemplatePathAndFilename(
'NonExistingTemplatePath');
271 @$this->view->render();
278 $this->mockRequest->expects($this->once())->method(
'setFormat')->with(
'xml');
279 $this->view->setFormat(
'xml');
287 $this->view->getLayoutRootPath();
295 $this->view->getLayoutRootPaths();
302 $templatePathAndFilename =
'some/template/RootPath/SomeTemplate.html';
303 $layoutRootPath =
'some/layout/RootPath';
304 $this->view->setTemplatePathAndFilename($templatePathAndFilename);
305 $this->view->setLayoutRootPath($layoutRootPath);
306 $actualResult = $this->view->getLayoutRootPath();
307 $this->assertEquals($layoutRootPath, $actualResult);
314 $templatePathAndFilename =
'some/template/RootPath/SomeTemplate.html';
315 $layoutRootPaths = array(
316 'some/layout/RootPath' 318 $this->view->setTemplatePathAndFilename($templatePathAndFilename);
319 $this->view->setLayoutRootPaths($layoutRootPaths);
320 $actualResult = $this->view->getLayoutRootPaths();
321 $this->assertEquals($layoutRootPaths, $actualResult);
328 $templatePathAndFilename =
'some/template/RootPath/SomeTemplate.html';
329 $this->view->setTemplatePathAndFilename($templatePathAndFilename);
330 $expectedResult =
'some/template/RootPath/Layouts';
331 $actualResult = $this->view->getLayoutRootPath();
332 $this->assertEquals($expectedResult, $actualResult);
339 $templatePathAndFilename =
'some/template/RootPath/SomeTemplate.html';
340 $this->view->setTemplatePathAndFilename($templatePathAndFilename);
341 $expectedResult = array(
'some/template/RootPath/Layouts');
342 $actualResult = $this->view->getLayoutRootPaths();
343 $this->assertEquals($expectedResult, $actualResult);
351 $this->view->setLayoutRootPath(
'some/non/existing/Path');
352 $this->view->_call(
'getLayoutSource');
360 $this->view->setLayoutRootPaths(array(
'some/non/existing/Path'));
361 $this->view->_call(
'getLayoutSource');
369 $layoutRootPath = __DIR__ .
'/Fixtures';
370 $this->view->setLayoutRootPaths(array($layoutRootPath));
371 $this->view->_call(
'getLayoutSource',
'NonExistingLayout');
379 $this->view->setLayoutRootPath($layoutRootPath);
380 $this->mockRequest->expects($this->once())->method(
'getFormat')->will($this->returnValue(
'html'));
381 $this->view->expects($this->once())->method(
'testFileExistence')->with($layoutRootPath .
'/LayoutFixture.html')->will($this->returnValue(TRUE));
382 $expectedResult = file_get_contents($layoutRootPath .
'/LayoutFixture.html');
383 $actualResult = $this->view->_call(
'getLayoutSource',
'LayoutFixture');
384 $this->assertEquals($expectedResult, $actualResult);
392 $this->view->setLayoutRootPath($layoutRootPath);
393 $this->mockRequest->expects($this->once())->method(
'getFormat')->will($this->returnValue(
'xml'));
394 $this->view->expects($this->once())->method(
'testFileExistence')->with($layoutRootPath .
'/LayoutFixture.xml')->will($this->returnValue(TRUE));
395 $expectedResult = file_get_contents($layoutRootPath .
'/LayoutFixture.xml');
396 $actualResult = $this->view->_call(
'getLayoutSource',
'LayoutFixture');
397 $this->assertEquals($expectedResult, $actualResult);
405 $this->view->setLayoutRootPath($layoutRootPath);
406 $this->mockRequest->expects($this->once())->method(
'getFormat')->will($this->returnValue(
'foo'));
407 $this->view->expects($this->at(0))->method(
'testFileExistence')->with($layoutRootPath .
'/LayoutFixture.foo')->will($this->returnValue(FALSE));
408 $this->view->expects($this->at(1))->method(
'testFileExistence')->with($layoutRootPath .
'/LayoutFixture')->will($this->returnValue(TRUE));
409 $expectedResult = file_get_contents($layoutRootPath .
'/LayoutFixture');
410 $actualResult = $this->view->_call(
'getLayoutSource',
'LayoutFixture');
411 $this->assertEquals($expectedResult, $actualResult);
419 $this->view->getPartialRootPath();
426 $templatePathAndFilename =
'some/template/RootPath/SomeTemplate.html';
427 $partialRootPath =
'some/partial/RootPath';
428 $this->view->setTemplatePathAndFilename($templatePathAndFilename);
429 $this->view->setPartialRootPath($partialRootPath);
430 $actualResult = $this->view->getPartialRootPath();
431 $this->assertEquals($partialRootPath, $actualResult);
438 $templatePathAndFilename =
'some/template/RootPath/SomeTemplate.html';
439 $this->view->setTemplatePathAndFilename($templatePathAndFilename);
440 $expectedResult =
'some/template/RootPath/Partials';
441 $actualResult = $this->view->getPartialRootPath();
442 $this->assertEquals($expectedResult, $actualResult);
450 $this->view->setPartialRootPath(
'some/non/existing/Path');
451 $this->view->_call(
'getPartialSource',
'SomePartial');
459 $partialRootPath = __DIR__ .
'/Fixtures';
460 $this->view->setPartialRootPath($partialRootPath);
461 $this->view->_call(
'getPartialSource',
'NonExistingPartial');
468 $partialRootPath = __DIR__ .
'/Fixtures';
469 $this->view->setPartialRootPath($partialRootPath);
470 $this->mockRequest->expects($this->once())->method(
'getFormat')->will($this->returnValue(
'html'));
471 $this->view->expects($this->once())->method(
'testFileExistence')->will($this->returnValue(TRUE));
472 $expectedResult = file_get_contents($partialRootPath .
'/LayoutFixture.html');
473 $actualResult = $this->view->_call(
'getPartialSource',
'LayoutFixture');
474 $this->assertEquals($expectedResult, $actualResult);
481 $partialRootPath = __DIR__ .
'/Fixtures';
482 $this->view->setPartialRootPath($partialRootPath);
483 $this->mockRequest->expects($this->once())->method(
'getFormat')->will($this->returnValue(
'xml'));
484 $this->view->expects($this->once())->method(
'testFileExistence')->will($this->returnValue(TRUE));
485 $expectedResult = file_get_contents($partialRootPath .
'/LayoutFixture.xml');
486 $actualResult = $this->view->_call(
'getPartialSource',
'LayoutFixture');
487 $this->assertEquals($expectedResult, $actualResult);
494 $partialRootPath = __DIR__ .
'/Fixtures';
495 $this->view->setPartialRootPath($partialRootPath);
496 $this->mockRequest->expects($this->once())->method(
'getFormat')->will($this->returnValue(
'foo'));
497 $this->view->expects($this->at(1))->method(
'testFileExistence')->will($this->returnValue(TRUE));
498 $expectedResult = file_get_contents($partialRootPath .
'/LayoutFixture');
499 $actualResult = $this->view->_call(
'getPartialSource',
'LayoutFixture');
500 $this->assertEquals($expectedResult, $actualResult);
507 $this->view->setPartialRootPath(
'/foo/bar');
508 $this->view->setPartialRootPaths(array(
'/overruled/path'));
509 $expected = array(
'/overruled/path');
510 $actual = $this->view->_call(
'getPartialRootPaths');
511 $this->assertEquals($expected, $actual,
'A set partial root path was not returned correctly.');
518 $this->view->setLayoutRootPath(
'/foo/bar');
519 $this->view->setLayoutRootPaths(array(
'/overruled/path'));
520 $expected = array(
'/overruled/path');
521 $actual = $this->view->_call(
'getLayoutRootPaths');
522 $this->assertEquals($expected, $actual,
'A set layout root path was not returned correctly.');
529 $this->view->setLayoutRootPaths(array(
'some/Default/Directory'));
530 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
531 $this->view->expects($this->at(0))->method(
'testFileExistence')->with(
'some/Default/Directory/LayoutName.html')->willReturn(FALSE);
532 $this->view->expects($this->at(1))->method(
'testFileExistence')->with(
'some/Default/Directory/LayoutName')->willReturn(FALSE);
533 $this->view->expects($this->at(2))->method(
'testFileExistence')->with(
'some/Default/Directory/layoutName.html')->willReturn(TRUE);
534 $this->assertSame(
'some/Default/Directory/layoutName.html', $this->view->_call(
'getLayoutPathAndFilename',
'layoutName'));
541 $this->view->setLayoutRootPaths(array(
'some/Default/Directory'));
542 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
543 $this->view->expects($this->at(0))->method(
'testFileExistence')->with(
'some/Default/Directory/LayoutName.html')->willReturn(TRUE);
544 $this->assertSame(
'some/Default/Directory/LayoutName.html', $this->view->_call(
'getLayoutPathAndFilename',
'layoutName'));
551 $this->view->setLayoutRootPaths(array(
552 'default' =>
'some/Default/Directory',
553 'specific' =>
'specific/Layouts',
555 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
556 $this->view->expects($this->once())->method(
'testFileExistence')->with(
'specific/Layouts/Default.html')->will($this->returnValue(TRUE));
557 $this->assertEquals(
'specific/Layouts/Default.html', $this->view->_call(
'getLayoutPathAndFilename'));
564 $this->view->setLayoutRootPaths(array(
565 'default' =>
'some/Default/Directory',
566 'specific' =>
'specific/Layouts',
568 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
569 $this->view->expects($this->at(2))->method(
'testFileExistence')->with(
'some/Default/Directory/Default.html')->will($this->returnValue(TRUE));
570 $this->assertEquals(
'some/Default/Directory/Default.html', $this->view->_call(
'getLayoutPathAndFilename'));
577 $this->view->setLayoutRootPaths(array(
578 '10' =>
'some/Default/Directory',
579 '25' =>
'evenMore/Specific/Layouts',
580 '17' =>
'specific/Layouts',
582 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
583 $this->view->expects($this->at(2))->method(
'testFileExistence')->with(
'specific/Layouts/Default.html')->will($this->returnValue(TRUE));
584 $this->assertEquals(
'specific/Layouts/Default.html', $this->view->_call(
'getLayoutPathAndFilename'));
591 $this->view->setLayoutRootPaths(array(
592 '10' =>
'some/Default/Directory',
593 '25' =>
'evenMore/Specific/Layouts',
594 '17' =>
'specific/Layouts',
596 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
597 $this->view->expects($this->at(4))->method(
'testFileExistence')->with(
'some/Default/Directory/Default.html')->will($this->returnValue(TRUE));
598 $this->assertEquals(
'some/Default/Directory/Default.html', $this->view->_call(
'getLayoutPathAndFilename'));
607 $this->view->setLayoutRootPaths(array(
608 '10' =>
'some/Default/Directory',
609 '25' =>
'evenMore/Specific/Layouts',
610 '17' =>
'specific/Layouts',
612 $this->view->expects($this->any())->method(
'testFileExistence')->will($this->returnValue(FALSE));
613 $this->view->_call(
'getLayoutPathAndFilename');
621 $this->view->setPartialRootPaths(array(
'some/Default/Directory'));
622 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
623 $this->view->expects($this->at(0))->method(
'testFileExistence')->with(
'some/Default/Directory/PartialName.html')->willReturn(FALSE);
624 $this->view->expects($this->at(1))->method(
'testFileExistence')->with(
'some/Default/Directory/PartialName')->willReturn(FALSE);
625 $this->view->expects($this->at(2))->method(
'testFileExistence')->with(
'some/Default/Directory/partialName.html')->willReturn(TRUE);
626 $this->assertSame(
'some/Default/Directory/partialName.html', $this->view->_call(
'getPartialPathAndFilename',
'partialName'));
633 $this->view->setPartialRootPaths(array(
'some/Default/Directory'));
634 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
635 $this->view->expects($this->at(0))->method(
'testFileExistence')->with(
'some/Default/Directory/PartialName.html')->willReturn(TRUE);
636 $this->assertSame(
'some/Default/Directory/PartialName.html', $this->view->_call(
'getPartialPathAndFilename',
'partialName'));
643 $this->view->setPartialRootPaths(array(
644 'default' =>
'some/Default/Directory',
645 'specific' =>
'specific/Partials',
647 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
648 $this->view->expects($this->once())->method(
'testFileExistence')->with(
'specific/Partials/Partial.html')->will($this->returnValue(TRUE));
649 $this->assertEquals(
'specific/Partials/Partial.html', $this->view->_call(
'getPartialPathAndFilename',
'Partial'));
656 $this->view->setPartialRootPaths(array(
657 'default' =>
'some/Default/Directory',
658 'specific' =>
'specific/Partials',
660 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
661 $this->view->expects($this->at(2))->method(
'testFileExistence')->with(
'some/Default/Directory/Partial.html')->will($this->returnValue(TRUE));
662 $this->assertEquals(
'some/Default/Directory/Partial.html', $this->view->_call(
'getPartialPathAndFilename',
'Partial'));
669 $this->view->setPartialRootPaths(array(
670 '10' =>
'some/Default/Directory',
671 '25' =>
'evenMore/Specific/Partials',
672 '17' =>
'specific/Partials',
674 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
675 $this->view->expects($this->at(2))->method(
'testFileExistence')->with(
'specific/Partials/Partial.html')->will($this->returnValue(TRUE));
676 $this->assertEquals(
'specific/Partials/Partial.html', $this->view->_call(
'getPartialPathAndFilename',
'Partial'));
683 $this->view->setPartialRootPaths(array(
684 '10' =>
'some/Default/Directory',
685 '25' =>
'evenMore/Specific/Partials',
686 '17' =>
'specific/Partials',
688 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
689 $this->view->expects($this->at(4))->method(
'testFileExistence')->with(
'some/Default/Directory/Partial.html')->will($this->returnValue(TRUE));
690 $this->assertEquals(
'some/Default/Directory/Partial.html', $this->view->_call(
'getPartialPathAndFilename',
'Partial'));
699 $this->view->setPartialRootPaths(array(
700 '10' =>
'some/Default/Directory',
701 '25' =>
'evenMore/Specific/Partials',
702 '17' =>
'specific/Partials',
704 $this->view->expects($this->any())->method(
'testFileExistence')->will($this->returnValue(FALSE));
705 $this->view->_call(
'getPartialPathAndFilename',
'Partial');
712 $this->view->setPartialRootPaths(array(
713 '10' =>
'some/Default/Directory',
714 '25' =>
'evenMore/Specific/Partials',
715 '17' =>
'specific/Partials',
717 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
718 $this->view->expects($this->at(0))->method(
'testFileExistence')->with(
'evenMore/Specific/Partials/Partial.html')->will($this->returnValue(FALSE));
719 $this->view->expects($this->at(1))->method(
'testFileExistence')->with(
'evenMore/Specific/Partials/Partial')->will($this->returnValue(FALSE));
720 $this->view->expects($this->at(2))->method(
'testFileExistence')->with(
'specific/Partials/Partial.html')->will($this->returnValue(FALSE));
721 $this->view->expects($this->at(3))->method(
'testFileExistence')->with(
'specific/Partials/Partial')->will($this->returnValue(FALSE));
722 $this->view->expects($this->at(4))->method(
'testFileExistence')->with(
'some/Default/Directory/Partial.html')->will($this->returnValue(FALSE));
723 $this->view->expects($this->at(5))->method(
'testFileExistence')->with(
'some/Default/Directory/Partial')->will($this->returnValue(TRUE));
724 $this->assertEquals(
'some/Default/Directory/Partial', $this->view->_call(
'getPartialPathAndFilename',
'Partial'));
731 $this->view->setLayoutRootPaths(array(
732 '10' =>
'some/Default/Directory',
733 '25' =>
'evenMore/Specific/Layouts',
734 '17' =>
'specific/Layouts',
736 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
737 $this->view->expects($this->at(0))->method(
'testFileExistence')->with(
'evenMore/Specific/Layouts/Default.html')->will($this->returnValue(FALSE));
738 $this->view->expects($this->at(1))->method(
'testFileExistence')->with(
'evenMore/Specific/Layouts/Default')->will($this->returnValue(FALSE));
739 $this->view->expects($this->at(2))->method(
'testFileExistence')->with(
'specific/Layouts/Default.html')->will($this->returnValue(FALSE));
740 $this->view->expects($this->at(3))->method(
'testFileExistence')->with(
'specific/Layouts/Default')->will($this->returnValue(FALSE));
741 $this->view->expects($this->at(4))->method(
'testFileExistence')->with(
'some/Default/Directory/Default.html')->will($this->returnValue(FALSE));
742 $this->view->expects($this->at(5))->method(
'testFileExistence')->with(
'some/Default/Directory/Default')->will($this->returnValue(TRUE));
743 $this->assertEquals(
'some/Default/Directory/Default', $this->view->_call(
'getLayoutPathAndFilename'));
750 $this->view->setPartialRootPaths(array(
751 'default' =>
'some/Default/Directory',
752 'specific' =>
'specific/Partials',
753 'verySpecific' =>
'evenMore/Specific/Partials',
755 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
756 $this->view->expects($this->at(0))->method(
'testFileExistence')->with(
'evenMore/Specific/Partials/Partial.html')->will($this->returnValue(FALSE));
757 $this->view->expects($this->at(1))->method(
'testFileExistence')->with(
'evenMore/Specific/Partials/Partial')->will($this->returnValue(FALSE));
758 $this->view->expects($this->at(2))->method(
'testFileExistence')->with(
'specific/Partials/Partial.html')->will($this->returnValue(FALSE));
759 $this->view->expects($this->at(3))->method(
'testFileExistence')->with(
'specific/Partials/Partial')->will($this->returnValue(FALSE));
760 $this->view->expects($this->at(4))->method(
'testFileExistence')->with(
'some/Default/Directory/Partial.html')->will($this->returnValue(FALSE));
761 $this->view->expects($this->at(5))->method(
'testFileExistence')->with(
'some/Default/Directory/Partial')->will($this->returnValue(TRUE));
762 $this->assertEquals(
'some/Default/Directory/Partial', $this->view->_call(
'getPartialPathAndFilename',
'Partial'));
769 $this->view->setLayoutRootPaths(array(
770 'default' =>
'some/Default/Directory',
771 'specific' =>
'specific/Layout',
772 'verySpecific' =>
'evenMore/Specific/Layout',
774 $this->mockRequest->expects($this->any())->method(
'getFormat')->will($this->returnValue(
'html'));
775 $this->view->expects($this->at(0))->method(
'testFileExistence')->with(
'evenMore/Specific/Layout/Default.html')->will($this->returnValue(FALSE));
776 $this->view->expects($this->at(1))->method(
'testFileExistence')->with(
'evenMore/Specific/Layout/Default')->will($this->returnValue(FALSE));
777 $this->view->expects($this->at(2))->method(
'testFileExistence')->with(
'specific/Layout/Default.html')->will($this->returnValue(FALSE));
778 $this->view->expects($this->at(3))->method(
'testFileExistence')->with(
'specific/Layout/Default')->will($this->returnValue(FALSE));
779 $this->view->expects($this->at(4))->method(
'testFileExistence')->with(
'some/Default/Directory/Default.html')->will($this->returnValue(FALSE));
780 $this->view->expects($this->at(5))->method(
'testFileExistence')->with(
'some/Default/Directory/Default')->will($this->returnValue(TRUE));
781 $this->assertEquals(
'some/Default/Directory/Default', $this->view->_call(
'getLayoutPathAndFilename'));
setPartialRootPathsOverridesValueSetBySetPartialRootPath()
getLayoutPathAndFilenameResolvesTheSpecificFileWithNumericIndices()
getPartialPathAndFilenameThrowsExceptionIfNoFileWasFound()
static getSingletonInstances()
getLayoutSourceThrowsExceptionIfLayoutRootPathDoesNotExist()
getPartialSourceReturnsContentOfPartialFileForTheDefaultFormat()
static setSingletonInstance($className, \TYPO3\CMS\Core\SingletonInterface $instance)
static addInstance($className, $instance)
getPartialPathAndFilenameWalksStringKeysInReversedOrder()
renderPassesSpecifiedTemplateSourceToTemplateParser()
getLayoutPathAndFilenameWalksStringKeysInReversedOrder()
getLayoutSourceThrowsExceptionIfLayoutRootPathsDoesNotExist()
getPartialPathAndFilenameWalksNumericalIndicesInDescendingOrder()
getPartialRootPathReturnsDefaultPathIfNoPartialRootPathIsSpecified()
getPartialPathAndFilenameResolvesTheDefaultFile()
getPartialPathAndFilenameFindsUpperCasedPartialName()
getPartialPathAndFilenameRespectsCasingOfPartialName()
static getIndpEnv($getEnvName)
renderLoadsSpecifiedTemplateFileAndPassesSourceToTemplateParser()
getLayoutSourceThrowsExceptionIfLayoutFileDoesNotExist()
getLayoutPathAndFilenameResolvesTheDefaultFileWithNumericIndices()
getLayoutPathAndFilenameRespectsCasingOfLayoutName()
getLayoutSourceReturnsContentOfLayoutFileForTheDefaultFormat()
getLayoutRootPathReturnsSpecifiedLayoutRootPathByDefault()
getPartialRootPathThrowsExceptionIfPartialRootPathAndTemplatePathAreNotSpecified()
getPartialSourceThrowsExceptionIfPartialRootPathDoesNotExist()
getLayoutRootPathsReturnsSpecifiedLayoutRootPathByDefault()
getPartialPathAndFilenameResolvesTheSpecificFile()
getLayoutRootPathsReturnsDefaultPathIfNoLayoutRootPathIsSpecified()
$mockViewHelperVariableContainer
static resetSingletonInstances(array $newSingletonInstances)
constructorInjectsRequestToUriBuilder()
constructorSetsRequestUri()
getAccessibleMock( $originalClassName, array $methods=array(), array $arguments=array(), $mockClassName='', $callOriginalConstructor=TRUE, $callOriginalClone=TRUE, $callAutoload=TRUE)
getLayoutPathAndFilenameResolvesTheDefaultFile()
getLayoutPathAndFilenameThrowsExceptionIfNoFileWasFound()
getLayoutPathAndFilenameResolvesTheSpecificFile()
static fixWindowsFilePath($theFile)
getPartialPathAndFilenameResolvesTheDefaultFileWithNumericIndices()
renderThrowsExceptionIfSpecifiedTemplateFileDoesNotExist()
getLayoutRootPathsThrowsExceptionIfLayoutRootPathAndTemplatePathAreNotSpecified()
getLayoutPathAndFilenameWalksNumericalIndicesInDescendingOrder()
getPartialRootPathReturnsSpecifiedPartialRootPathByDefault()
objectManagerCallback($className)
getLayoutSourceReturnsContentOfLayoutFileForTheSpecifiedFormat()
setFormatSetsRequestFormat()
getLayoutPathAndFilenameFindsUpperCasedLayoutName()
constructorInjectsRequestToControllerContext()
getLayoutRootPathReturnsDefaultPathIfNoLayoutRootPathIsSpecified()
getLayoutSourceReturnsContentOfDefaultLayoutFileIfNoLayoutExistsForTheSpecifiedFormat()
getPartialSourceThrowsExceptionIfPartialFileDoesNotExist()
$mockConfigurationManager
constructorInjectsUriBuilderToControllerContext()
getLayoutRootPathThrowsExceptionIfLayoutRootPathAndTemplatePathAreNotSpecified()
$mockFlashMessageContainer
setLayoutRootPathsOverridesValuesSetBySetLayoutRootPath()
getPartialSourceReturnsContentOfPartialFileForTheSpecifiedFormat()
constructorCreatesContentObjectIfItIsNotSpecified()
renderThrowsExceptionIfTemplateIsNotSpecified()
getPartialPathAndFilenameResolvesTheSpecificFileWithNumericIndices()
getPartialSourceReturnsContentOfDefaultPartialFileIfNoPartialExistsForTheSpecifiedFormat()