diff --git a/src/Symfony/Component/Translation/Tests/Loader/QtFileLoaderTest.php b/src/Symfony/Component/Translation/Tests/Loader/QtFileLoaderTest.php index 56f5d6ddd4..17f3cc15e8 100644 --- a/src/Symfony/Component/Translation/Tests/Loader/QtFileLoaderTest.php +++ b/src/Symfony/Component/Translation/Tests/Loader/QtFileLoaderTest.php @@ -43,4 +43,24 @@ class QtFileLoaderTest extends \PHPUnit_Framework_TestCase $resource = __DIR__.'/../fixtures/non-existing.ts'; $loader->load($resource, 'en', 'domain1'); } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadNonLocalResource() + { + $loader = new QtFileLoader(); + $resource = 'http://domain1.com/resources.ts'; + $loader->load($resource, 'en', 'domain1'); + } + + /** + * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException + */ + public function testLoadInvalidResource() + { + $loader = new QtFileLoader(); + $resource = __DIR__.'/../fixtures/invalid-xml-resources.xlf'; + $loader->load($resource, 'en', 'domain1'); + } } diff --git a/src/Symfony/Component/Translation/Tests/fixtures/invalid-xml-resources.xlf b/src/Symfony/Component/Translation/Tests/fixtures/invalid-xml-resources.xlf new file mode 100644 index 0000000000..a726ed5699 --- /dev/null +++ b/src/Symfony/Component/Translation/Tests/fixtures/invalid-xml-resources.xlf @@ -0,0 +1,23 @@ + + + + + + foo + bar + + + extra + + + key + + + + test + with + note + + + +