You are here

public function XmlFileLoaderTest::testLoad in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php \Symfony\Component\DependencyInjection\Tests\Loader\XmlFileLoaderTest::testLoad()

File

vendor/symfony/dependency-injection/Tests/Loader/XmlFileLoaderTest.php, line 36

Class

XmlFileLoaderTest

Namespace

Symfony\Component\DependencyInjection\Tests\Loader

Code

public function testLoad() {
  $loader = new XmlFileLoader(new ContainerBuilder(), new FileLocator(self::$fixturesPath . '/ini'));
  try {
    $loader
      ->load('foo.xml');
    $this
      ->fail('->load() throws an InvalidArgumentException if the loaded file does not exist');
  } catch (\Exception $e) {
    $this
      ->assertInstanceOf('InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file does not exist');
    $this
      ->assertStringStartsWith('The file "foo.xml" does not exist (in:', $e
      ->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not exist');
  }
}