23 $viewHelper = $this->getMock(
'TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\PrintfViewHelper', array(
'renderChildren'));
24 $viewHelper->expects($this->once())->method(
'renderChildren')->will($this->returnValue(
'%04d-%02d-%02d'));
25 $actualResult = $viewHelper->render(array(
'year' => 2009,
'month' => 4,
'day' => 5));
26 $this->assertEquals(
'2009-04-05', $actualResult);
33 $viewHelper = $this->getMock(
'TYPO3\\CMS\\Fluid\\ViewHelpers\\Format\\PrintfViewHelper', array(
'renderChildren'));
34 $viewHelper->expects($this->once())->method(
'renderChildren')->will($this->returnValue(
'%2$s %1$d %3$s %2$s'));
35 $actualResult = $viewHelper->render(array(123,
'foo',
'bar'));
36 $this->assertEquals(
'foo 123 bar foo', $actualResult);