コード例 #1
0
 /**
  * @test
  */
 public function renderReturnsChildNodesEvenIfValueIsFalseButDefaultIsTrue()
 {
     $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')->will($this->returnValue(true));
     $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with(\TYPO3\CMS\Fluid\ViewHelpers\SwitchViewHelper::class, 'stateStack')->will($this->returnValue(array(array('break' => false, 'expression' => 'someValue'))));
     $renderedChildNodes = 'ChildNodes';
     $this->assertSame($renderedChildNodes, $this->viewHelper->render('someOtherValue', true));
 }
コード例 #2
0
 /**
  * @test
  */
 public function renderReturnsChildNodesEvenIfValueIsFalseButDefaultIsTrue()
 {
     $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('exists')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\SwitchViewHelper', 'switchExpression')->will($this->returnValue(TRUE));
     $this->viewHelperVariableContainer->expects($this->atLeastOnce())->method('get')->with('TYPO3\\CMS\\Fluid\\ViewHelpers\\SwitchViewHelper', 'switchExpression')->will($this->returnValue('someValue'));
     $renderedChildNodes = 'ChildNodes';
     $this->viewHelper->expects($this->once())->method('renderChildren')->will($this->returnValue($renderedChildNodes));
     $this->assertSame($renderedChildNodes, $this->viewHelper->render('someOtherValue', TRUE));
 }