瀏覽代碼

[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
      * @dataProvider getPathsToInvalidFiles
      */
      */
     public function testLoadThrowsExceptionWithInvalidFile($filePath)
     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 = new CustomXmlFileLoader(new FileLocator(array(__DIR__.'/../Fixtures')));
         $loader->load($filePath);
         $loader->load($filePath);