public function formattingUsingCustomPatternWorks($format, array $parsedFormat, $expectedResult)
{
$mockDatesReader = $this->createMock(I18n\Cldr\Reader\DatesReader::class);
$mockDatesReader->expects($this->once())->method('parseCustomFormat')->with($format)->will($this->returnValue($parsedFormat));
$mockDatesReader->expects($this->once())->method('getLocalizedLiteralsForLocale')->with($this->sampleLocale)->will($this->returnValue($this->sampleLocalizedLiterals));
$formatter = new I18n\Formatter\DatetimeFormatter();
$formatter->injectDatesReader($mockDatesReader);
$result = $formatter->formatDateTimeWithCustomPattern($this->sampleDateTime, $format, $this->sampleLocale);
$this->assertEquals($expectedResult, $result);
}