SymfonyComponentTranslationTestsLoaderIcuResFileLoaderTest

The Simple Calendar Symfony Component Translation Tests Loader IcuResFileLoaderTest class.

Defined (1)

The class is defined in the following location(s).

/vendor/symfony/translation/Tests/Loader/IcuResFileLoaderTest.php  
  1. class IcuResFileLoaderTest extends LocalizedTestCase 
  2. public function testLoad() 
  3. // resource is build using genrb command 
  4. $loader = new IcuResFileLoader(); 
  5. $resource = __DIR__.'/../fixtures/resourcebundle/res'; 
  6. $catalogue = $loader->load($resource, 'en', 'domain1'); 
  7.  
  8. $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); 
  9. $this->assertEquals('en', $catalogue->getLocale()); 
  10. $this->assertEquals(array(new DirectoryResource($resource)), $catalogue->getResources()); 
  11.  
  12. /** 
  13. * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException 
  14. */ 
  15. public function testLoadNonExistingResource() 
  16. $loader = new IcuResFileLoader(); 
  17. $loader->load(__DIR__.'/../fixtures/non-existing.txt', 'en', 'domain1'); 
  18.  
  19. /** 
  20. * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException 
  21. */ 
  22. public function testLoadInvalidResource() 
  23. $loader = new IcuResFileLoader(); 
  24. $loader->load(__DIR__.'/../fixtures/resourcebundle/corrupted', 'en', 'domain1');