TYPO3  7.6
fluid/Tests/Unit/Core/Parser/SyntaxTree/AbstractNodeTest.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Fluid\Tests\Unit\Core\Parser\SyntaxTree;
3 
4 /* *
5  * This script is backported from the TYPO3 Flow package "TYPO3.Fluid". *
6  * *
7  * It is free software; you can redistribute it and/or modify it under *
8  * the terms of the GNU Lesser General Public License, either version 3 *
9  * of the License, or (at your option) any later version. *
10  * *
11  * The TYPO3 project - inspiring people to share! *
12  * */
13 
17 class AbstractNodeTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
18 {
19  protected $renderingContext;
20 
21  protected $abstractNode;
22 
23  protected $childNode;
24 
25  protected function setUp()
26  {
27  $this->renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::class, array(), array(), '', false);
28 
29  $this->abstractNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class, array('evaluate'));
30 
31  $this->childNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode::class);
32  $this->abstractNode->addChildNode($this->childNode);
33  }
34 
39  {
40  $this->childNode->expects($this->once())->method('evaluate')->with($this->renderingContext);
41  $this->abstractNode->evaluateChildNodes($this->renderingContext);
42  }
43 
47  public function childNodeCanBeReadOutAgain()
48  {
49  $this->assertSame($this->abstractNode->getChildNodes(), array($this->childNode));
50  }
51 }