public function XmlFileLoaderTest::testLoad

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php, line 45

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');
  }
}