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\DependencyInjection\Tests\Loader;
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\DependencyInjection\ContainerBuilder;
16 use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
17 use Symfony\Component\Config\FileLocator;
19 class PhpFileLoaderTest extends TestCase
21 public function testSupports()
23 $loader = new PhpFileLoader(new ContainerBuilder(), new FileLocator());
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');
29 public function testLoad()
31 $loader = new PhpFileLoader($container = new ContainerBuilder(), new FileLocator());
33 $loader->load(__DIR__.'/../Fixtures/php/simple.php');
35 $this->assertEquals('foo', $container->getParameter('foo'), '->load() loads a PHP file resource');