Neos\Flow\Tests\Unit\I18n\Parser\NumberParserTest::specificFormattingMethodsWork PHP Method

specificFormattingMethodsWork() public method

public specificFormattingMethodsWork ( $formatType, $numberToParse, $expectedParsedNumber, $stringFormat, array $parsedFormat )
$parsedFormat array
    public function specificFormattingMethodsWork($formatType, $numberToParse, $expectedParsedNumber, $stringFormat, array $parsedFormat)
    {
        $mockNumbersReader = $this->createMock(I18n\Cldr\Reader\NumbersReader::class);
        $mockNumbersReader->expects($this->once())->method('parseFormatFromCldr')->with($this->sampleLocale, $formatType, I18n\Cldr\Reader\NumbersReader::FORMAT_LENGTH_DEFAULT)->will($this->returnValue($parsedFormat));
        $mockNumbersReader->expects($this->once())->method('getLocalizedSymbolsForLocale')->with($this->sampleLocale)->will($this->returnValue($this->sampleLocalizedSymbols));
        $formatter = new I18n\Parser\NumberParser();
        $formatter->injectNumbersReader($mockNumbersReader);
        $methodName = 'parse' . ucfirst($formatType) . 'Number';
        $result = $formatter->{$methodName}($numberToParse, $this->sampleLocale);
        $this->assertEquals($expectedParsedNumber, $result);
    }