public function Twig_Tests_EnvironmentTest::testAddExtension in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php \Twig_Tests_EnvironmentTest::testAddExtension()
 
File
- vendor/
twig/ twig/ test/ Twig/ Tests/ EnvironmentTest.php, line 181  
Class
Code
public function testAddExtension() {
  $twig = new Twig_Environment($this
    ->getMock('Twig_LoaderInterface'));
  $twig
    ->addExtension(new Twig_Tests_EnvironmentTest_Extension());
  $this
    ->assertArrayHasKey('test', $twig
    ->getTags());
  $this
    ->assertArrayHasKey('foo_filter', $twig
    ->getFilters());
  $this
    ->assertArrayHasKey('foo_function', $twig
    ->getFunctions());
  $this
    ->assertArrayHasKey('foo_test', $twig
    ->getTests());
  $this
    ->assertArrayHasKey('foo_unary', $twig
    ->getUnaryOperators());
  $this
    ->assertArrayHasKey('foo_binary', $twig
    ->getBinaryOperators());
  $this
    ->assertArrayHasKey('foo_global', $twig
    ->getGlobals());
  $visitors = $twig
    ->getNodeVisitors();
  $this
    ->assertEquals('Twig_Tests_EnvironmentTest_NodeVisitor', get_class($visitors[2]));
}