public function Twig_Tests_Node_Expression_TestTest::getTests

Overrides Twig_Test_NodeTestCase::getTests

File

drupal/core/vendor/twig/twig/test/Twig/Tests/Node/Expression/TestTest.php, line 38

Class

Twig_Tests_Node_Expression_TestTest

Code

public function getTests() {
  $tests = array();
  $expr = new Twig_Node_Expression_Constant('foo', 1);
  $node = new Twig_Node_Expression_Test_Null($expr, 'null', new Twig_Node(array()), 1);
  $tests[] = array(
    $node,
    '(null === "foo")',
  );

  // test as an anonymous function
  if (version_compare(phpversion(), '5.3.0', '>=')) {
    $node = $this
      ->createTest(new Twig_Node_Expression_Constant('foo', 1), 'anonymous', array(
      new Twig_Node_Expression_Constant('foo', 1),
    ));
    $tests[] = array(
      $node,
      'call_user_func_array($this->env->getTest(\'anonymous\')->getCallable(), array("foo", "foo"))',
    );
  }
  return $tests;
}