Skip to content

Commit

Permalink
chore: upgrade PHPUnit 9 => 10
Browse files Browse the repository at this point in the history
replace setLocale() calls with setlocale()
  • Loading branch information
Chris8934 committed Jan 27, 2024
1 parent 4c67318 commit b19212c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion tests/Calculator/LocaleAwareBcMathCalculatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Tests\Money\Calculator;

use function setlocale;

use const LC_ALL;

/** @covers \Money\Calculator\BcMathCalculator */
Expand All @@ -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');
}
}
4 changes: 3 additions & 1 deletion tests/Calculator/LocaleAwareGmpCalculatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Tests\Money\Calculator;

use function setlocale;

use const LC_ALL;

/** @covers \Money\Calculator\GmpCalculator */
Expand All @@ -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');
}
}
3 changes: 2 additions & 1 deletion tests/ConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Money\Money;
use PHPUnit\Framework\TestCase;

use function setlocale;
use function sprintf;

use const LC_ALL;
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion tests/MoneyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use PHPUnit\Framework\TestCase;

use function json_encode;
use function setlocale;

use const LC_ALL;
use const PHP_INT_MAX;
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit b19212c

Please sign in to comment.