$this->localeProvider =
static::
createMock(LanguageLocaleCodeProvider::
class);
$this->formatter =
new CurrencyFormatter($this->localeProvider
);
} /**
* @dataProvider formattingParameterProvider
*/
public function testFormatCurrencyByLanguageWillUseProvidedDecimalPlaces(float
$price, int
$decimalPlaces, string
$localeCode, string
$expectedSeparator, string
$currencyISO): void
{ $this->localeProvider->
expects(static::
once())->
method('getLocaleForLanguageId'
)->
willReturn($localeCode);
$pattern =
sprintf('/\%s\d{%s}/',
$expectedSeparator,
(string) $decimalPlaces);
$formattedPrice =
$this->formatter->
formatCurrencyByLanguage( $price,
$currencyISO,
Uuid::
randomHex(),
$this->
createContext($decimalPlaces),
3
);
static::
assertMatchesRegularExpression($pattern,
$formattedPrice);
} /**
* @dataProvider formattingParameterProvider
*/