4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Config\Tests\Resource;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Config\Resource\ClassExistenceResource;
17 class ClassExistenceResourceTest extends TestCase
19 public function testToString()
21 $res = new ClassExistenceResource('BarClass');
22 $this->assertSame('BarClass', (string) $res);
25 public function testGetResource()
27 $res = new ClassExistenceResource('BarClass');
28 $this->assertSame('BarClass', $res->getResource());
31 public function testIsFreshWhenClassDoesNotExist()
33 $res = new ClassExistenceResource('Symfony\Component\Config\Tests\Fixtures\BarClass');
35 $this->assertTrue($res->isFresh(time()));
38 namespace Symfony\Component\Config\Tests\Fixtures;
46 $this->assertFalse($res->isFresh(time()));
49 public function testIsFreshWhenClassExists()
51 $res = new ClassExistenceResource('Symfony\Component\Config\Tests\Resource\ClassExistenceResourceTest');
53 $this->assertTrue($res->isFresh(time()));