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 Composer\Autoload\ClassLoader;
15 use PHPUnit\Framework\TestCase;
16 use Symfony\Component\Config\Resource\ComposerResource;
18 class ComposerResourceTest extends TestCase
20 public function testGetVendor()
22 $res = new ComposerResource();
24 $r = new \ReflectionClass(ClassLoader::class);
27 foreach ($res->getVendors() as $vendor) {
28 if ($vendor && 0 === strpos($r->getFileName(), $vendor)) {
34 $this->assertTrue($found);
37 public function testSerializeUnserialize()
39 $res = new ComposerResource();
40 $ser = unserialize(serialize($res));
42 $this->assertTrue($res->isFresh(0));
43 $this->assertTrue($ser->isFresh(0));
45 $this->assertEquals($res, $ser);