exists() public method

public exists ( $name )
示例#1
0
 public function testNonExistsWithBaseLoader()
 {
     $mockLoader = $this->getMock('Twig_LoaderInterface');
     $mockLoader->expects($this->once())->method('getSource')->with($this->equalTo('foo'))->will($this->throwException(new \Twig_Error_Loader("File not found")));
     $mockLoader->expects($this->never())->method('exists');
     $twitalLoader = new TwitalLoader($mockLoader, null, false);
     $this->assertFalse($twitalLoader->exists('foo'));
 }