Yaffs site version 1.1
[yaffs-website] / vendor / symfony / dependency-injection / Tests / Loader / PhpFileLoaderTest.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\DependencyInjection\ContainerBuilder;
16 use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
17 use Symfony\Component\Config\FileLocator;
18
19 class PhpFileLoaderTest extends TestCase
20 {
21     public function testSupports()
22     {
23         $loader = new PhpFileLoader(new ContainerBuilder(), new FileLocator());
24
25         $this->assertTrue($loader->supports('foo.php'), '->supports() returns true if the resource is loadable');
26         $this->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable');
27     }
28
29     public function testLoad()
30     {
31         $loader = new PhpFileLoader($container = new ContainerBuilder(), new FileLocator());
32
33         $loader->load(__DIR__.'/../Fixtures/php/simple.php');
34
35         $this->assertEquals('foo', $container->getParameter('foo'), '->load() loads a PHP file resource');
36     }
37 }