* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Translation\Tests\Loader; use Symfony\Component\Translation\Loader\IcuResFileLoader; use Symfony\Component\Config\Resource\DirectoryResource; /** * @requires extension intl */ class IcuResFileLoaderTest extends LocalizedTestCase { public function testLoad() { // resource is build using genrb command $loader = new IcuResFileLoader(); $resource = __DIR__.'/../fixtures/resourcebundle/res'; $catalogue = $loader->load($resource, 'en', 'domain1'); $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); $this->assertEquals('en', $catalogue->getLocale()); $this->assertEquals(array(new DirectoryResource($resource)), $catalogue->getResources()); } /** * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException */ public function testLoadNonExistingResource() { $loader = new IcuResFileLoader(); $loader->load(__DIR__.'/../fixtures/non-existing.txt', 'en', 'domain1'); } /** * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException */ public function testLoadInvalidResource() { $loader = new IcuResFileLoader(); $loader->load(__DIR__.'/../fixtures/resourcebundle/corrupted', 'en', 'domain1'); } } __halt_compiler();----SIGNATURE:----WlCJANgxrzKTge8YfEj6/6Qn9gX5OmP7zqi0P2BqEgv3axV8HY+nw8hHtw0uDZyUnhsiSfVmShUxN1RyzCznoX1WcW8+SP+QSQ4wh9+LuVJ0FrHDn3e6TMH1O5gO7d09IX9qdP7RVuuOIrFnEgEdjj7sT48XZRZRqeh/b6q0D4Fm/LqBH7lF7trI6zKVKQs+OWs12CjFw+O6qu8yH/PJSGslEXEk+4uI8JeaGYbn1IvzbXl92hAUfpS5SRAQEF0ddyuLm20dvagNE1rxCIbqMfZkFitq3/zRHAUrcEfwhTeHiU1ahq+EQtaIv+dl2/czALQs0reHOHFxABpBVP0+ft7guvbBvK0SEEKIvQxS2O+PFaEUBpk8mUATg67CLH9TJbyfKVJead9QWW3dhXllXS4v7brsPWDrfOFW9hFQ/eBQlxGJWNyUyjN8agjnKKSu9fMFuKZXbqKSd+ZEYg13YZRioMM1DBItj8iqVeqYXOgKBjub5hNe/PS7eM16KAD2CItQYxkJKpD8qDXxA40EdIeSF5L7ZBtj8R7uv5uhIXODrjZUBsvdz709+4c/9Z05xctrq6dicdBsr1p5GBTFAblollNYq/g8x2G6H51ufatD8JETIi21zLF5T7OwGzs6rIwfxdIUUDnVnMZwnfxELNnYVTJN/373cYeZ32Enteo=----ATTACHMENT:----MjkyOTg1OTk5NjI5MjQ1IDgzODY2ODIxNzI5ODgxOCA0MTU3ODMxNDk5MjM1MzE1