24        $this->assertEquals(
'bar', 
$loader->getSource(
'foo'));
 
   25        $this->assertEquals(
'foo', 
$loader->getSource(
'bar'));
 
   30        $path = dirname(__FILE__).
'/../Fixtures';
 
   37        $this->assertEquals(
'foo', 
$loader->getSourceContext(
'foo')->getName());
 
   38        $this->assertSame(
'', 
$loader->getSourceContext(
'foo')->getPath());
 
   40        $this->assertEquals(
'errors/index.html', 
$loader->getSourceContext(
'errors/index.html')->getName());
 
   41        $this->assertSame(
'', 
$loader->getSourceContext(
'errors/index.html')->getPath());
 
   42        $this->assertEquals(
'baz', 
$loader->getSourceContext(
'errors/index.html')->getCode());
 
   44        $this->assertEquals(
'errors/base.html', 
$loader->getSourceContext(
'errors/base.html')->getName());
 
   45        $this->assertEquals(realpath(
$path.
'/errors/base.html'), realpath(
$loader->getSourceContext(
'errors/base.html')->getPath()));
 
   46        $this->assertNotEquals(
'baz', 
$loader->getSourceContext(
'errors/base.html')->getCode());
 
   56        $loader->getSourceContext(
'foo');
 
   77        $this->assertEquals(
'foo:bar', 
$loader->getCacheKey(
'foo'));
 
   78        $this->assertEquals(
'bar:foo', 
$loader->getCacheKey(
'bar'));
 
   96        $this->assertEquals(
'bar', 
$loader->getSourceContext(
'foo')->getCode());
 
  101        $loader1 = $this->getMockBuilder(
'Twig_ChainTestLoaderWithExistsInterface')->getMock();
 
  102        $loader1->expects($this->once())->method(
'exists')->will($this->returnValue(
false));
 
  103        $loader1->expects($this->never())->method(
'getSourceContext');
 
  106        $loader2 = $this->getMockBuilder(
'Twig_ChainTestLoaderInterface')->getMock();
 
  108        $loader2->expects($this->once())->method(
'getSourceContext')->will($this->returnValue(
new Twig_Source(
'content', 
'index')));
 
  114        $this->assertTrue(
$loader->exists(
'foo'));
 
An exception for terminatinating execution or to throw for unit testing.
Loads a template from an array.
Loads templates from other loaders.
Loads template from the filesystem.
Holds information about a non-compiled Twig template.
testGetSourceWhenTemplateDoesNotExist()
@group legacy @expectedException Twig_Error_Loader
testGetSource()
@group legacy
testGetSourceContextWhenTemplateDoesNotExist()
@expectedException Twig_Error_Loader
testGetCacheKeyWhenTemplateDoesNotExist()
@expectedException Twig_Error_Loader
Adds an exists() method for loaders.
Interface all loaders must implement.
Adds a getSourceContext() method for loaders.