소스 검색

[Routing] Added XmlFileLoader tests handling invalid xml files (schema validation based).

Jakub Zalas 14 년 전
부모
커밋
29922faa33
1개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      tests/Symfony/Tests/Component/Routing/Loader/XmlFileLoaderTest.php

+ 10 - 0
tests/Symfony/Tests/Component/Routing/Loader/XmlFileLoaderTest.php

@@ -58,6 +58,16 @@ class XmlFileLoaderTest extends \PHPUnit_Framework_TestCase
      * @dataProvider getPathsToInvalidFiles
      */
     public function testLoadThrowsExceptionWithInvalidFile($filePath)
+    {
+        $loader = new XmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures')));
+        $loader->load($filePath);
+    }
+
+    /**
+     * @expectedException \InvalidArgumentException
+     * @dataProvider getPathsToInvalidFiles
+     */
+    public function testLoadThrowsExceptionWithInvalidFileEvenWithoutSchemaValidation($filePath)
     {
         $loader = new CustomXmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures')));
         $loader->load($filePath);