TYPO3 CMS  TYPO3_7-6
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  protected function setUp()
33  {
34  $this->renderingContext = $this->getMock(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface::class);
35  }
36 
42  {
43  $rootNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode::class);
44  $rootNode->expects($this->once())->method('getChildNodes')->will($this->returnValue([1, 2, 3, 4]));
45 
46  new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
47  }
48 
53  {
54  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
55  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
56  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('=='));
57  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
58 
59  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
60  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
61  }
62 
67  {
68  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
69  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
70  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('=='));
71  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('3'));
72 
73  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
74  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
75  }
76 
81  {
82  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
83  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
84  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('!='));
85  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
86 
87  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
88  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
89  }
90 
95  {
96  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
97  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('5'));
98  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('!='));
99  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('3'));
100 
101  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
102  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
103  }
104 
108  public function oddNumberModulo2ReturnsTrue()
109  {
110  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
111  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('43'));
112  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('%'));
113  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('2'));
114 
115  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
116  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
117  }
118 
123  {
124  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
125  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('42'));
126  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('%'));
127  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('2'));
128 
129  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
130  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
131  }
132 
137  {
138  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
139  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
140  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>'));
141  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
142 
143  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
144  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
145  }
146 
151  {
152  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
153  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
154  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>'));
155  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
156 
157  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
158  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
159  }
160 
165  {
166  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
167  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
168  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>='));
169  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
170 
171  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
172  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
173  }
174 
179  {
180  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
181  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
182  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>='));
183  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
184 
185  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
186  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
187  }
188 
193  {
194  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
195  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
196  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('>='));
197  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('11'));
198 
199  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
200  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
201  }
202 
207  {
208  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
209  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
210  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<'));
211  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
212 
213  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
214  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
215  }
216 
221  {
222  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
223  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
224  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<'));
225  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
226 
227  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
228  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
229  }
230 
235  {
236  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
237  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('9'));
238  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<='));
239  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
240 
241  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
242  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
243  }
244 
249  {
250  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
251  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
252  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<='));
253  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
254 
255  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
256  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
257  }
258 
263  {
264  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
265  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('11'));
266  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('<='));
267  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('10'));
268 
269  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
270  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
271  }
272 
277  {
278  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
279  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('11 <= -2.1'));
280  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
281  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
282  }
283 
288  {
289  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
290  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' != "stringA"'));
291 
292  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
293  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
294  }
295 
300  {
301  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
302  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' != \'stringB\''));
303 
304  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
305  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
306  }
307 
312  {
313  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
314  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == \'stringB\''));
315 
316  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
317  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
318  }
319 
324  {
325  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
326  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == "stringA"'));
327 
328  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
329  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
330  }
331 
336  {
337  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
338  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'\\\'stringA\\\'\' == \'\\\'stringA\\\'\''));
339 
340  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
341  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
342  }
343 
348  {
349  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
350  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == 42'));
351 
352  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
353  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
354  }
355 
360  {
361  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
362  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('\'stringA\' == 0'));
363 
364  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
365  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
366  }
367 
371  public function objectsAreComparedStrictly()
372  {
373  $object1 = new \stdClass();
374  $object2 = new \stdClass();
375 
376  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
377 
378  $object1Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, ['evaluate'], ['foo']);
379  $object1Node->expects($this->any())->method('evaluate')->will($this->returnValue($object1));
380 
381  $object2Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, ['evaluate'], ['foo']);
382  $object2Node->expects($this->any())->method('evaluate')->will($this->returnValue($object2));
383 
384  $rootNode->addChildNode($object1Node);
385  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('=='));
386  $rootNode->addChildNode($object2Node);
387 
388  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
389  $this->assertFalse($booleanNode->evaluate($this->renderingContext));
390  }
391 
396  {
397  $object1 = new \stdClass();
398  $object2 = new \stdClass();
399 
400  $rootNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\RootNode();
401 
402  $object1Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, ['evaluate'], ['foo']);
403  $object1Node->expects($this->any())->method('evaluate')->will($this->returnValue($object1));
404 
405  $object2Node = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::class, ['evaluate'], ['foo']);
406  $object2Node->expects($this->any())->method('evaluate')->will($this->returnValue($object2));
407 
408  $rootNode->addChildNode($object1Node);
409  $rootNode->addChildNode(new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\TextNode('!='));
410  $rootNode->addChildNode($object2Node);
411 
412  $booleanNode = new \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode($rootNode);
413  $this->assertTrue($booleanNode->evaluate($this->renderingContext));
414  }
415 
420  {
421  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(false));
422  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(true));
423  }
424 
429  {
430  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(''));
431  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('false'));
432  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('FALSE'));
433 
434  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('true'));
435  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('TRUE'));
436  }
437 
442  {
443  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(false));
444  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(true));
445 
446  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0));
447  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0'));
448 
449  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0.0));
450  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0.0'));
451 
452  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0x0));
453 
454  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0x1));
455  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0x1'));
456 
457  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0e0));
458  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0e0'));
459 
460  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(1e0));
461  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('1e0'));
462 
463  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(-1));
464  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('-1'));
465 
466  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(-0.5));
467  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('-0.5'));
468 
469  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(1));
470  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('1'));
471 
472  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0.5));
473  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0.5'));
474 
475  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(0x1));
476  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean('0x10'));
477  }
478 
483  {
484  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean([]));
485 
486  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(['foo']));
487  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(['foo' => 'bar']));
488  }
489 
494  {
495  $this->assertFalse(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(null));
496 
497  $this->assertTrue(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\BooleanNode::convertToBoolean(new \stdClass()));
498  }
499 }