public function testInvalidTemplateNameIsFresh() { $loader = $this->getMock('Twig_LoaderInterface'); $loader->expects($this->once())->method('isFresh')->with('asdf', 1234)->will($this->throwException(new \Twig_Error_Loader(''))); $resource = new TwigResource($loader, 'asdf'); $this->assertFalse($resource->isFresh(1234)); }
public function __toString() { // Ensure that the name property is cast as a string before returning. // This fixes the issue of PHP not bubbling down the __toString() // methods. // Oh and $name is a private variable so can not be accessed directly. // @see https://gist.github.com/lsjroberts/7084126 return (string) parent::__toString(); }