Ejemplo n.º 1
0
 public function setUp()
 {
     parent::setUp();
     $this->mockContentObject = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', array(), array(), '', FALSE);
     $this->mockConfigurationManager = $this->getMock('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface');
     $this->mockConfigurationManager->expects($this->any())->method('getContentObject')->will($this->returnValue($this->mockContentObject));
     $this->viewHelper = $this->getMock('TYPO3\\Fluid\\ViewHelpers\\Format\\CropViewHelper', array('renderChildren'));
     $this->viewHelper->injectConfigurationManager($this->mockConfigurationManager);
     $this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue('Some Content'));
 }
Ejemplo n.º 2
0
 /**
  * @test
  */
 public function constructorCreatesContentObjectIfItIsNotSpecified()
 {
     // FIXME should be compared with identicalTo() - but that does not seem to work
     $this->mockConfigurationManager->expects($this->once())->method('setContentObject')->with($this->equalTo($this->mockContentObject));
     new \TYPO3\Fluid\View\StandaloneView();
 }