* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Config\Tests\Resource; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\Resource\FileExistenceResource; class FileExistenceResourceTest extends TestCase { protected $resource; protected $file; protected $time; protected function setUp() { $this->file = realpath(sys_get_temp_dir()).'/tmp.xml'; $this->time = time(); $this->resource = new FileExistenceResource($this->file); } protected function tearDown() { if (file_exists($this->file)) { unlink($this->file); } } public function testToString() { $this->assertSame($this->file, (string) $this->resource); } public function testGetResource() { $this->assertSame($this->file, $this->resource->getResource(), '->getResource() returns the path to the resource'); } public function testIsFreshWithExistingResource() { touch($this->file, $this->time); $serialized = serialize(new FileExistenceResource($this->file)); $resource = unserialize($serialized); $this->assertTrue($resource->isFresh($this->time), '->isFresh() returns true if the resource is still present'); unlink($this->file); $resource = unserialize($serialized); $this->assertFalse($resource->isFresh($this->time), '->isFresh() returns false if the resource has been deleted'); } public function testIsFreshWithAbsentResource() { $serialized = serialize(new FileExistenceResource($this->file)); $resource = unserialize($serialized); $this->assertTrue($resource->isFresh($this->time), '->isFresh() returns true if the resource is still absent'); touch($this->file, $this->time); $resource = unserialize($serialized); $this->assertFalse($resource->isFresh($this->time), '->isFresh() returns false if the resource has been created'); } } __halt_compiler();----SIGNATURE:----lsrBPOn+8nNPpuipmKMECluw/ZBpKE1k8eT+ReWI29C/7dD6XbAzhmjlqj2eogp+i0pGPIMWNXiZR4xEYOAuQ0uj2CxBiHIbi25tKpDSqE2zt0HnJxhmN13lvDCPn6hs7phKRe16vpE3DQSGq/S06rgZ2WUPmZh4fH1wZsCgNdWXFumYqzptyJxHeEZuEcelUob8CWlXN5T0jMlELz0HDkNYBGSknZouA6lz8vwy3SIH3jKMnhqfJUurv5supuXBOyWcOBVU9t4PWJdD2kUydsobIso7EoZhpIgelylxAhUIw0WTxgMpjvArq0vdiCTv/F9LvShgiwXJLzw2oU4y1wKcL4PYdW9qORcqfzsM4T72RVVqRaIO+PQDac6BWBrcmQdTlCCmuFdMjudNfC8VEgnIJc54P8ixtJoz6K0ZsWW3AHq4UHBEToomIFkAsCivrdZONOOWtvBTnwBTXqZ7y7mzYcDPuHcmI54wJKilEFyhtpNib5uV/ZvyvUWptotfZDC/kAT/pDhPZu8TsqfJ1KRqzZeJ9esjaUQBzY+KPFUMWgv9HD9+cDWMKsGba0IgybaEU+ASH2TaRBWudgedVGCyOQ5NEkel0HDTUFN0Bt7kuBYpcYjIke2AISg3E3+XVzEW6pX+zpvaNFoTGzS4t5ZuimqJ4RB1wMBVKdhCqdU=----ATTACHMENT:----NzkzMzgxNjEyMTk4OTMyIDY1MjAzMTQyODU3MjkzNjYgNjkyMjE0NjQ0NjU0NTY5NQ==