Twig_Environment::getTests PHP Method

getTests() public method

public getTests ( )
    public function getTests()
    {
        if (null === $this->tests) {
            $this->tests = array();
            foreach ($this->getExtensions() as $extension) {
                $this->tests = array_merge($this->tests, $extension->getTests());
            }
        }

        return $this->tests;
    }

Same methods

Twig_Environment::getTests ( ) : Twig_TestInterface[]

Usage Example

Example #1
0
 protected function getTestNodeClass(Twig_Environment $env, $name)
 {
     $testMap = $env->getTests();
     if (isset($testMap[$name]) && $testMap[$name] instanceof Twig_Test_Node) {
         return $testMap[$name]->getClass();
     }
     return 'Twig_Node_Expression_Test';
 }
All Usage Examples Of Twig_Environment::getTests