/** * @test */ public function elseArgumentHasPriorityOverChildNodesIfConditionIsFalse() { $mockElseViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate', 'setRenderingContext'), array(), '', false); $mockElseViewHelperNode->expects($this->any())->method('getViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class)); $mockElseViewHelperNode->expects($this->never())->method('evaluate'); $this->viewHelper->setChildNodes(array($mockElseViewHelperNode)); $this->arguments['else'] = 'ElseArgument'; $this->injectDependenciesIntoViewHelper($this->viewHelper); $actualResult = $this->viewHelper->_call('renderElseChild'); $this->assertEquals('ElseArgument', $actualResult); }