public function IniFileLoaderTest::testExceptionIsRaisedWhenIniFileCannotBeParsed

@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 69

Class

IniFileLoaderTest

Namespace

Symfony\Component\DependencyInjection\Tests\Loader

Code

public function testExceptionIsRaisedWhenIniFileCannotBeParsed() {
  try {
    @$this->loader
      ->load('nonvalid.ini');
    $this
      ->fail('->load() throws an InvalidArgumentException if the loaded file is not parseable');
  } catch (\Exception $e) {
    $this
      ->assertInstanceOf('\\InvalidArgumentException', $e, '->load() throws an InvalidArgumentException if the loaded file is not parseable');
    $this
      ->assertEquals('The "nonvalid.ini" file is not valid.', $e
      ->getMessage(), '->load() throws an InvalidArgumentException if the loaded file is not parseable');
  }
}