TYPO3 CMS  TYPO3_6-2
BooleanNodeTest.php
Go to the documentation of this file.
1 <?php
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 
18 
22  protected $viewHelperNode;
23 
27  protected $renderingContext;
28 
32  public function setUp() {
33  $this->renderingContext = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Rendering\\RenderingContextInterface');
34  }
35 
41  $rootNode = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\RootNode');
42  $rootNode->expects($this->once())->method('getChildNodes')->will($this->returnValue(array(1, 2, 3, 4)));
43 
44  new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
45  }
46 
51  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
52  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
53  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('=='));
54  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
55 
56  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
57  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
58  }
59 
64  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
65  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
66  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('=='));
67  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('3'));
68 
69  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
70  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
71  }
72 
77  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
78  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
79  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('!='));
80  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
81 
82  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
83  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
84  }
85 
90  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
91  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
92  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('!='));
93  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('3'));
94 
95  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
96  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
97  }
98 
102  public function oddNumberModulo2ReturnsTrue() {
103  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
104  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('43'));
105  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('%'));
106  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('2'));
107 
108  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
109  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
110  }
111 
115  public function evenNumberModulo2ReturnsFalse() {
116  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
117  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('42'));
118  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('%'));
119  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('2'));
120 
121  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
122  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
123  }
124 
129  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
130  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
131  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>'));
132  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
133 
134  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
135  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
136  }
137 
142  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
143  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
144  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>'));
145  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
146 
147  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
148  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
149  }
150 
155  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
156  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
157  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>='));
158  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
159 
160  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
161  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
162  }
163 
168  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
169  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
170  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>='));
171  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
172 
173  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
174  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
175  }
176 
181  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
182  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
183  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>='));
184  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('11'));
185 
186  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
187  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
188  }
189 
194  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
195  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
196  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<'));
197  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
198 
199  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
200  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
201  }
202 
207  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
208  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
209  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<'));
210  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
211 
212  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
213  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
214  }
215 
220  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
221  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
222  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<='));
223  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
224 
225  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
226  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
227  }
228 
233  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
234  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
235  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<='));
236  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
237 
238  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
239  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
240  }
241 
246  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
247  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('11'));
248  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<='));
249  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
250 
251  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
252  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
253  }
254 
259  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
260  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('11 <= -2.1'));
261  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
262  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
263  }
264 
269  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
270  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' != "stringA"'));
271 
272  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
273  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
274  }
275 
280  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
281  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' != \'stringB\''));
282 
283  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
284  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
285  }
286 
291  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
292  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == \'stringB\''));
293 
294  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
295  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
296  }
297 
302  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
303  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == "stringA"'));
304 
305  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
306  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
307  }
308 
313  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
314  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'\\\'stringA\\\'\' == \'\\\'stringA\\\'\''));
315 
316  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
317  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
318  }
319 
324  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
325  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == 42'));
326 
327  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
328  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
329  }
330 
335  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
336  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == 0'));
337 
338  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
339  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
340  }
341 
345  public function objectsAreComparedStrictly() {
346  $object1 = new \stdClass();
347  $object2 = new \stdClass();
348 
349  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
350 
351  $object1Node = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array('evaluate'), array('foo'));
352  $object1Node->expects($this->any())->method('evaluate')->will($this->returnValue($object1));
353 
354  $object2Node = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array('evaluate'), array('foo'));
355  $object2Node->expects($this->any())->method('evaluate')->will($this->returnValue($object2));
356 
357  $rootNode->addChildNode($object1Node);
358  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('=='));
359  $rootNode->addChildNode($object2Node);
360 
361  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
362  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
363  }
364 
369  $object1 = new \stdClass();
370  $object2 = new \stdClass();
371 
372  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
373 
374  $object1Node = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array('evaluate'), array('foo'));
375  $object1Node->expects($this->any())->method('evaluate')->will($this->returnValue($object1));
376 
377  $object2Node = $this->getMock('TYPO3\\CMS\\Fluid\\Core\\Parser\\SyntaxTree\\ObjectAccessorNode', array('evaluate'), array('foo'));
378  $object2Node->expects($this->any())->method('evaluate')->will($this->returnValue($object2));
379 
380  $rootNode->addChildNode($object1Node);
381  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('!='));
382  $rootNode->addChildNode($object2Node);
383 
384  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
385  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
386  }
387 
392  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(FALSE));
393  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(TRUE));
394  }
395 
400  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(''));
401  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('false'));
402  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('FALSE'));
403 
404  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('true'));
405  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('TRUE'));
406  }
407 
412  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(FALSE));
413  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(TRUE));
414 
415  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0));
416  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0'));
417 
418  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0.0));
419  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0.0'));
420 
421  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0x0));
422 
423  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0x1));
424  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0x1'));
425 
426  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0e0));
427  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0e0'));
428 
429  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(1e0));
430  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('1e0'));
431 
432  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(-1));
433  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('-1'));
434 
435  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(-0.5));
436  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('-0.5'));
437 
438  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(1));
439  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('1'));
440 
441  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0.5));
442  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0.5'));
443 
444  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0x1));
445  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0x10'));
446  }
447 
452  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(array()));
453 
454  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(array('foo')));
455  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(array('foo' => 'bar')));
456  }
457 
462  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(NULL));
463 
464  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(new \stdClass()));
465  }
466 }