You are here

public function XmlFileLoaderTest::testDoNotModifyStateIfExceptionIsThrown in Plug 7

See also

https://github.com/symfony/symfony/pull/12158

File

lib/Symfony/validator/Symfony/Component/Validator/Tests/Mapping/Loader/XmlFileLoaderTest.php, line 121

Class

XmlFileLoaderTest

Namespace

Symfony\Component\Validator\Tests\Mapping\Loader

Code

public function testDoNotModifyStateIfExceptionIsThrown() {
  $loader = new XmlFileLoader(__DIR__ . '/withdoctype.xml');
  $metadata = new ClassMetadata('Symfony\\Component\\Validator\\Tests\\Fixtures\\Entity');
  try {
    $loader
      ->loadClassMetadata($metadata);
  } catch (MappingException $e) {
    $this
      ->setExpectedException('\\Symfony\\Component\\Validator\\Exception\\MappingException');
    $loader
      ->loadClassMetadata($metadata);
  }
}