Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Loader / GlobFileLoaderTest.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\DependencyInjection\Tests\Loader;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\Config\FileLocator;
16 use Symfony\Component\Config\Resource\GlobResource;
17 use Symfony\Component\DependencyInjection\ContainerBuilder;
18 use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
19
20 class GlobFileLoaderTest extends TestCase
21 {
22     public function testSupports()
23     {
24         $loader = new GlobFileLoader(new ContainerBuilder(), new FileLocator());
25
26         $this->assertTrue($loader->supports('any-path', 'glob'), '->supports() returns true if the resource has the glob type');
27         $this->assertFalse($loader->supports('any-path'), '->supports() returns false if the resource is not of glob type');
28     }
29
30     public function testLoadAddsTheGlobResourceToTheContainer()
31     {
32         $loader = new GlobFileLoaderWithoutImport($container = new ContainerBuilder(), new FileLocator());
33         $loader->load(__DIR__.'/../Fixtures/config/*');
34
35         $this->assertEquals(new GlobResource(__DIR__.'/../Fixtures/config', '/*', false), $container->getResources()[1]);
36     }
37 }
38
39 class GlobFileLoaderWithoutImport extends GlobFileLoader
40 {
41     public function import($resource, $type = null, $ignoreErrors = false, $sourceResource = null)
42     {
43     }
44 }