Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / config / Tests / Resource / ClassExistenceResourceTest.php
1 <?php
2
3 /*
4  * This file is part of the Symfony package.
5  *
6  * (c) Fabien Potencier <fabien@symfony.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 namespace Symfony\Component\Config\Tests\Resource;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Config\Resource\ClassExistenceResource;
16
17 class ClassExistenceResourceTest extends TestCase
18 {
19     public function testToString()
20     {
21         $res = new ClassExistenceResource('BarClass');
22         $this->assertSame('BarClass', (string) $res);
23     }
24
25     public function testGetResource()
26     {
27         $res = new ClassExistenceResource('BarClass');
28         $this->assertSame('BarClass', $res->getResource());
29     }
30
31     public function testIsFreshWhenClassDoesNotExist()
32     {
33         $res = new ClassExistenceResource('Symfony\Component\Config\Tests\Fixtures\BarClass');
34
35         $this->assertTrue($res->isFresh(time()));
36
37         eval(<<<EOF
38 namespace Symfony\Component\Config\Tests\Fixtures;
39
40 class BarClass
41 {
42 }
43 EOF
44         );
45
46         $this->assertFalse($res->isFresh(time()));
47     }
48
49     public function testIsFreshWhenClassExists()
50     {
51         $res = new ClassExistenceResource('Symfony\Component\Config\Tests\Resource\ClassExistenceResourceTest');
52
53         $this->assertTrue($res->isFresh(time()));
54     }
55 }