/**
  * @dataProvider getTests
  */
 public function testCompile($node, $source, $environment = null, $isPattern = false)
 {
     $env = $this->getEnvironment();
     $metaLoader = new ChainLoader();
     $context = new Context(new ArrayCache());
     $metaLoader->addLoader(new ArticleLoader(__DIR__, new MetaFactory($context)));
     $env->addExtension(new GimmeExtension($context, $metaLoader));
     $this->assertNodeCompilation($source, $node, $env);
 }
 public function testBrokenTemplate()
 {
     $loader = new \Twig_Loader_Array(['error_gimme' => '{% gimme article {id: 1} %}{{ article.title }}{% endgimme %}']);
     $metaLoader = new ChainLoader();
     $context = new Context(new ArrayCache());
     $metaLoader->addLoader(new ArticleLoader(__DIR__, new MetaFactory($context)));
     $twig = new \Twig_Environment($loader);
     $twig->addExtension(new GimmeExtension($context, $metaLoader));
     $this->expectException(\Twig_Error_Syntax::class);
     $twig->render('error_gimme');
 }