* * 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:----eycxPFTRDYy1868mMTdhpJgACE1YG810rClmdUUe9UyKtAmKCodWJXRX/z7Vb/mBHHy1TFLmnlfOtL+7Bu/xB029kK9LxQLsVZUeI87vo+iyjI695+nXK2zfHE0GxosdcFJuh/WI0Qw7Nmli588fM5vOIl9hsv4ds9mTZYGUU0FrMc500K+dSLyGJ384/G9jbUxzssU0+RwVzZBlEYw/v+hFl51MCbVWYPxQ9Wd05Fo7LSB5olQsP0tiW9rutGQKdzuvfCAOn7p9p/mNF419KBr0Rs0ZvgYsc9u4bRkCEgbtSqtESnlYuAaG4rK935HkXR7C6+gHZ5Hj3QjS8czYmHeGAlkn0sY59kCc44FbSouHk3y/6sRX0SBr2cg7epU6/pKXv9w0evftPD8fW2fIg7S2NhTDLgSg/t9Lc1sH+i2XgfT+SzZILsf1TEZKGsRGGMftcfYhTPdY8sGRCb+Ij66AXg184KkOFLIbOO6eQWTnBL9mEe7AACLpl1hO+Cq3pGn/nOjY3FImCTF/AYzSAgF5el8QpjLYIzhwBnrUmD/nA2Ts8p+EngWWpAtaElQGAMq5CGiE7SS9MFfqfsyA1iPtqcNClnvnXlA8DISAGijSzybOAm1kLYYgB6Cs5wtjwgvGQL5xuBbeSz8sSGxfd6fkJyKNlwuspyILlKO/9QI=----ATTACHMENT:----NzE1NDk4Mjc1MTA4MDUzIDExMDQ3MTg3MjY3NjI2MDMgMjg5MTczNjE2MzEwNTQwNA==