public function testResourceDoesNotExist() { $this->
expectException(\InvalidArgumentException::
class);
$this->
expectExceptionMessageMatches('/The file ".*" does not exist./'
);
new FileResource('/____foo/foobar'.
mt_rand(1, 999999
));
} public function testIsFresh() { $this->
assertTrue($this->resource->
isFresh($this->time
), '->isFresh() returns true if the resource has not changed in same second'
);
$this->
assertTrue($this->resource->
isFresh($this->time + 10
), '->isFresh() returns true if the resource has not changed'
);
$this->
assertFalse($this->resource->
isFresh($this->time - 86400
), '->isFresh() returns false if the resource has been updated'
);
} public function testIsFreshForDeletedResources() { unlink($this->file
);
$this->
assertFalse($this->resource->
isFresh($this->time
), '->isFresh() returns false if the resource does not exist'
);
}