You are here

public function IcuDatFileLoaderTest::testDatEnglishLoad in Plug 7

File

lib/Symfony/translation/Tests/Loader/IcuDatFileLoaderTest.php, line 35

Class

IcuDatFileLoaderTest

Namespace

Symfony\Component\Translation\Tests\Loader

Code

public function testDatEnglishLoad() {

  // bundled resource is build using pkgdata command which at least in ICU 4.2 comes in extremely! buggy form
  // you must specify an temporary build directory which is not the same as current directory and
  // MUST reside on the same partition. pkgdata -p resources -T /srv -d.packagelist.txt
  $loader = new IcuDatFileLoader();
  $resource = __DIR__ . '/../fixtures/resourcebundle/dat/resources';
  $catalogue = $loader
    ->load($resource, 'en', 'domain1');
  $this
    ->assertEquals(array(
    'symfony' => 'Symfony 2 is great',
  ), $catalogue
    ->all('domain1'));
  $this
    ->assertEquals('en', $catalogue
    ->getLocale());
  $this
    ->assertEquals(array(
    new FileResource($resource . '.dat'),
  ), $catalogue
    ->getResources());
}