/** * @return void */ public function setUp() { $samplePluralRulesData = array('pluralRules[@locales="ro mo"]' => array('pluralRule[@count="one"]' => 'n is 1', 'pluralRule[@count="few"]' => 'n is 0 OR n is not 1 AND n mod 100 in 1..19')); $mockModel = $this->getAccessibleMock(\TYPO3\Flow\I18n\Cldr\CldrModel::class, array('getRawArray'), array(array('fake/path'))); $mockModel->expects($this->once())->method('getRawArray')->with('plurals')->will($this->returnValue($samplePluralRulesData)); $mockRepository = $this->getMock(\TYPO3\Flow\I18n\Cldr\CldrRepository::class); $mockRepository->expects($this->once())->method('getModel')->with('supplemental/plurals')->will($this->returnValue($mockModel)); $mockCache = $this->getMock(\TYPO3\Flow\Cache\Frontend\VariableFrontend::class, array(), array(), '', FALSE); $mockCache->expects($this->at(0))->method('has')->with('rulesets')->will($this->returnValue(FALSE)); $mockCache->expects($this->at(1))->method('set')->with('rulesets'); $mockCache->expects($this->at(2))->method('set')->with('rulesetsIndices'); $this->reader = new PluralsReader(); $this->reader->injectCldrRepository($mockRepository); $this->reader->injectCache($mockCache); $this->reader->initializeObject(); }