From b19212c45615aa9a1cc9cf98d6e766a5211aa52e Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Sat, 27 Jan 2024 19:41:28 +0100 Subject: [PATCH] chore: upgrade PHPUnit 9 => 10 replace setLocale() calls with setlocale() --- tests/Calculator/LocaleAwareBcMathCalculatorTest.php | 4 +++- tests/Calculator/LocaleAwareGmpCalculatorTest.php | 4 +++- tests/ConverterTest.php | 3 ++- tests/MoneyTest.php | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/Calculator/LocaleAwareBcMathCalculatorTest.php b/tests/Calculator/LocaleAwareBcMathCalculatorTest.php index a31d4641..d0a57090 100644 --- a/tests/Calculator/LocaleAwareBcMathCalculatorTest.php +++ b/tests/Calculator/LocaleAwareBcMathCalculatorTest.php @@ -4,6 +4,8 @@ namespace Tests\Money\Calculator; +use function setlocale; + use const LC_ALL; /** @covers \Money\Calculator\BcMathCalculator */ @@ -13,6 +15,6 @@ public function setUp(): void { parent::setUp(); - $this->setLocale(LC_ALL, 'ru_RU.UTF-8'); + setlocale(LC_ALL, 'ru_RU.UTF-8'); } } diff --git a/tests/Calculator/LocaleAwareGmpCalculatorTest.php b/tests/Calculator/LocaleAwareGmpCalculatorTest.php index 19fff94d..aca32ab9 100644 --- a/tests/Calculator/LocaleAwareGmpCalculatorTest.php +++ b/tests/Calculator/LocaleAwareGmpCalculatorTest.php @@ -4,6 +4,8 @@ namespace Tests\Money\Calculator; +use function setlocale; + use const LC_ALL; /** @covers \Money\Calculator\GmpCalculator */ @@ -13,6 +15,6 @@ public function setUp(): void { parent::setUp(); - $this->setLocale(LC_ALL, 'ru_RU.UTF-8'); + setlocale(LC_ALL, 'ru_RU.UTF-8'); } } diff --git a/tests/ConverterTest.php b/tests/ConverterTest.php index 6dad6ca5..cab4134d 100644 --- a/tests/ConverterTest.php +++ b/tests/ConverterTest.php @@ -13,6 +13,7 @@ use Money\Money; use PHPUnit\Framework\TestCase; +use function setlocale; use function sprintf; use const LC_ALL; @@ -192,7 +193,7 @@ public function itConvertsToADifferentCurrencyWhenDecimalSeparatorIsComma( $amount, $expectedAmount ): void { - $this->setLocale(LC_ALL, 'ru_RU.UTF-8'); + setlocale(LC_ALL, 'ru_RU.UTF-8'); $this->itConvertsToADifferentCurrency( $baseCurrencyCode, diff --git a/tests/MoneyTest.php b/tests/MoneyTest.php index a6aeff39..a80ad7d8 100644 --- a/tests/MoneyTest.php +++ b/tests/MoneyTest.php @@ -10,6 +10,7 @@ use PHPUnit\Framework\TestCase; use function json_encode; +use function setlocale; use const LC_ALL; use const PHP_INT_MAX; @@ -99,7 +100,7 @@ public function itMultipliesTheAmount(int|string $multiplier, int $roundingMode, */ public function itMultipliesTheAmountWithLocaleThatUsesCommaSeparator(): void { - $this->setLocale(LC_ALL, 'es_ES.utf8'); + setlocale(LC_ALL, 'es_ES.utf8'); $money = new Money(100, new Currency(self::CURRENCY)); $money = $money->multiply('0.1');