ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Twig_Tests_Node_Expression_NullCoalesceTest Class Reference
+ Inheritance diagram for Twig_Tests_Node_Expression_NullCoalesceTest:
+ Collaboration diagram for Twig_Tests_Node_Expression_NullCoalesceTest:

Public Member Functions

 getTests ()
 
- Public Member Functions inherited from Twig_Test_NodeTestCase
 getTests ()
 
 testCompile ($node, $source, $environment=null, $isPattern=false)
 getTests More...
 
 assertNodeCompilation ($source, Twig_Node $node, Twig_Environment $environment=null, $isPattern=false)
 

Additional Inherited Members

- Protected Member Functions inherited from Twig_Test_NodeTestCase
 getCompiler (Twig_Environment $environment=null)
 
 getEnvironment ()
 
 getVariableGetter ($name, $line=false)
 
 getAttributeGetter ()
 

Detailed Description

Definition at line 12 of file NullCoalesceTest.php.

Member Function Documentation

◆ getTests()

Twig_Tests_Node_Expression_NullCoalesceTest::getTests ( )

Definition at line 14 of file NullCoalesceTest.php.

References $tests.

15  {
16  $tests = array();
17 
18  $left = new Twig_Node_Expression_Name('foo', 1);
19  $right = new Twig_Node_Expression_Constant(2, 1);
20  $node = new Twig_Node_Expression_NullCoalesce($left, $right, 1);
21  if (PHP_VERSION_ID >= 70000) {
22  $tests[] = array($node, "((// line 1\n\$context[\"foo\"]) ?? (2))");
23  } elseif (PHP_VERSION_ID >= 50400) {
24  $tests[] = array($node, "(((// line 1\narray_key_exists(\"foo\", \$context) && !(null === (isset(\$context[\"foo\"]) ? \$context[\"foo\"] : null)))) ? ((isset(\$context[\"foo\"]) ? \$context[\"foo\"] : null)) : (2))");
25  } else {
26  $tests[] = array($node, "(((// line 1\narray_key_exists(\"foo\", \$context) && !(null === \$this->getContext(\$context, \"foo\")))) ? (\$this->getContext(\$context, \"foo\")) : (2))");
27  }
28 
29  return $tests;
30  }
$tests
Definition: bench.php:104

The documentation for this class was generated from the following file: