/** * @dataProvider provideMergeableValues */ public function testFollowLocaleAliases($childData, $parentData, $result) { $this->reader->setLocaleAliases(array('mo' => 'ro_MD')); if (null === $childData || is_array($childData)) { $this->readerImpl->expects($this->at(0))->method('read')->with(self::RES_DIR, 'ro_MD')->will($this->returnValue(array('Foo' => array('Bar' => $childData)))); // Read fallback locale of aliased locale ("ro_MD" -> "ro") $this->readerImpl->expects($this->at(1))->method('read')->with(self::RES_DIR, 'ro')->will($this->returnValue(array('Foo' => array('Bar' => $parentData)))); } else { $this->readerImpl->expects($this->once())->method('read')->with(self::RES_DIR, 'ro_MD')->will($this->returnValue(array('Foo' => array('Bar' => $childData)))); } $this->assertSame($result, $this->reader->readEntry(self::RES_DIR, 'mo', array('Foo', 'Bar'), true)); }
/** * @return BundleEntryReader */ protected function createEntryReader() { $entryReader = new BundleEntryReader($this->createBundleReader()); $entryReader->setLocaleAliases($this->getLocaleAliases()); return $entryReader; }