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')); }
/** * @test */ public function viewHelperHandlesMultiByteValuesCorrectly() { $this->viewHelper->expects($this->never())->method('renderChildren'); $actualResult = $this->viewHelper->render(3, '...', 'Äßütest'); $this->assertEquals('Äßü...', $actualResult); }