예제 #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]);
 }
예제 #2
0
 /**
  * @depends testCallingFactoryWithNoConfigReturnsTwigInstance
  */
 public function testUnconfiguredTwigInstanceContainsNoPaths(Twig $twig)
 {
     $paths = $twig->getPaths();
     $this->assertInternalType('array', $paths);
     $this->assertEmpty($paths);
 }