You are here

public function Twig_Environment::getTest in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Environment.php \Twig_Environment::getTest()

Gets a test by name.

Parameters

string $name The test name:

Return value

Twig_Test|false A Twig_Test instance or false if the test does not exist

File

vendor/Twig/Environment.php, line 915

Class

Twig_Environment
Stores the Twig configuration.

Code

public function getTest($name) {
  if (!$this->extensionInitialized) {
    $this
      ->initExtensions();
  }
  if (isset($this->tests[$name])) {
    return $this->tests[$name];
  }
  return false;
}