You are here

public function IcuDatFileLoaderTest::testDatEnglishLoad in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/translation/Tests/Loader/IcuDatFileLoaderTest.php \Symfony\Component\Translation\Tests\Loader\IcuDatFileLoaderTest::testDatEnglishLoad()

File

vendor/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());
}