TYPO3 CMS  TYPO3_6-2
NumericNodeTest.php
Go to the documentation of this file.
1 <?php
3 
4 /* *
5  * This script belongs to the TYPO3 Flow package "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 
18 
23  $string = '1';
24  $node = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode($string);
25  $this->assertEquals($node->evaluate($this->getMock('TYPO3\CMS\Fluid\Core\Rendering\RenderingContext')), 1, 'The rendered value of a numeric node does not match the string given in the constructor.');
26  }
27 
32  $string = '1.1';
33  $node = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode($string);
34  $this->assertEquals($node->evaluate($this->getMock('TYPO3\CMS\Fluid\Core\Rendering\RenderingContext')), 1.1, 'The rendered value of a numeric node does not match the string given in the constructor.');
35  }
36 
42  new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode('foo');
43  }
44 
49  public function addChildNodeThrowsException() {
50  $node = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\NumericNode('1');
51  $node->addChildNode(clone $node);
52  }
53 }