public function IniFileLoaderTest::testExceptionIsRaisedWhenIniFileDoesNotExist

@covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::__construct @covers Symfony\Component\DependencyInjection\Loader\IniFileLoader::load

File

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

Class

IniFileLoaderTest

Namespace

Symfony\Component\DependencyInjection\Tests\Loader

Code

public function testExceptionIsRaisedWhenIniFileDoesNotExist() {
  try {
    $this->loader
      ->load('foo.ini');
    $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.ini" does not exist (in: ', $e
      ->getMessage(), '->load() throws an InvalidArgumentException if the loaded file does not exist');
  }
}