You are here

public function Twig_Tests_EnvironmentTest::testRemoveExtension in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php \Twig_Tests_EnvironmentTest::testRemoveExtension()

@group legacy

File

vendor/twig/twig/test/Twig/Tests/EnvironmentTest.php, line 200

Class

Twig_Tests_EnvironmentTest

Code

public function testRemoveExtension() {
  $twig = new Twig_Environment($this
    ->getMock('Twig_LoaderInterface'));
  $twig
    ->addExtension(new Twig_Tests_EnvironmentTest_Extension());
  $twig
    ->removeExtension('environment_test');
  $this
    ->assertFalse(array_key_exists('test', $twig
    ->getTags()));
  $this
    ->assertFalse(array_key_exists('foo_filter', $twig
    ->getFilters()));
  $this
    ->assertFalse(array_key_exists('foo_function', $twig
    ->getFunctions()));
  $this
    ->assertFalse(array_key_exists('foo_test', $twig
    ->getTests()));
  $this
    ->assertFalse(array_key_exists('foo_unary', $twig
    ->getUnaryOperators()));
  $this
    ->assertFalse(array_key_exists('foo_binary', $twig
    ->getBinaryOperators()));
  $this
    ->assertFalse(array_key_exists('foo_global', $twig
    ->getGlobals()));
  $this
    ->assertCount(2, $twig
    ->getNodeVisitors());
}