Pascal Borreli 14 лет назад
Родитель
Сommit
cc6318b622

+ 10 - 0
tests/Symfony/Tests/Component/Translation/Loader/CsvFileLoaderTest.php

@@ -37,4 +37,14 @@ class CsvFileLoaderTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals('en', $catalogue->getLocale());
         $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources());
     }
+
+    /**
+     * @expectedException \InvalidArgumentException
+     */
+    public function testLoadThrowsAnExceptionIfFileNotExists()
+    {
+        $loader = new CsvFileLoader();
+        $resource = __DIR__.'/../fixtures/not-exists.csv';
+        $loader->load($resource, 'en', 'domain1');
+    }
 }

+ 4 - 1
tests/Symfony/Tests/Component/Translation/fixtures/resources.csv

@@ -1 +1,4 @@
-"foo"; "bar"
+"foo"; "bar"
+#"bar"; "foo"
+"incorrect"; "number"; "columns"; "will"; "be"; "ignored"
+"incorrect"