Assetic\Extension\Twig\TwigResource::isFresh PHP Method

isFresh() public method

public isFresh ( $timestamp )
    public function isFresh($timestamp)
    {
        try {
            return $this->loader->isFresh($this->name, $timestamp);
        } catch (\Twig_Error_Loader $e) {
            return false;
        }
    }

Usage Example

Esempio n. 1
0
 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));
 }