Ejemplo n.º 1
0
 public function testCanAddPathWithNamespace()
 {
     $template = new TwigTemplate();
     $template->addPath(__DIR__ . '/TestAsset', 'test');
     $paths = $template->getPaths();
     $this->assertInternalType('array', $paths);
     $this->assertEquals(1, count($paths));
     $this->assertTemplatePath(__DIR__ . '/TestAsset', $paths[0]);
     $this->assertTemplatePathString(__DIR__ . '/TestAsset', $paths[0]);
     $this->assertTemplatePathNamespace('test', $paths[0]);
 }
Ejemplo n.º 2
0
 /**
  * @depends testCallingFactoryWithNoConfigReturnsTwigInstance
  */
 public function testUnconfiguredTwigInstanceContainsNoPaths(Twig $twig)
 {
     $paths = $twig->getPaths();
     $this->assertInternalType('array', $paths);
     $this->assertEmpty($paths);
 }