Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / symfony / config / Tests / Resource / ComposerResourceTest.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 Composer\Autoload\ClassLoader;
15 use PHPUnit\Framework\TestCase;
16 use Symfony\Component\Config\Resource\ComposerResource;
17
18 class ComposerResourceTest extends TestCase
19 {
20     public function testGetVendor()
21     {
22         $res = new ComposerResource();
23
24         $r = new \ReflectionClass(ClassLoader::class);
25         $found = false;
26
27         foreach ($res->getVendors() as $vendor) {
28             if ($vendor && 0 === strpos($r->getFileName(), $vendor)) {
29                 $found = true;
30                 break;
31             }
32         }
33
34         $this->assertTrue($found);
35     }
36
37     public function testSerializeUnserialize()
38     {
39         $res = new ComposerResource();
40         $ser = unserialize(serialize($res));
41
42         $this->assertTrue($res->isFresh(0));
43         $this->assertTrue($ser->isFresh(0));
44
45         $this->assertEquals($res, $ser);
46     }
47 }