public function addTest($name, Twig_TestInterface $test) { if (null === $this->tests) { $this->getTests(); } $this->tests[$name] = $test; }
protected function getEnvironment() { $env = new Twig_Environment(new Twig_Loader_Array(array())); $env->addTest(new Twig_Test('anonymous', function () { })); return $env; }