From 4305c9269fdd2c38cc94b0513c86a18019eab38e Mon Sep 17 00:00:00 2001 From: Gustavo Freze Date: Sat, 24 Oct 2026 12:39:44 -0300 Subject: [PATCH 1/2] build: Update the dependencies to their latest versions. --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index ed38864..4ef1221 100644 --- a/composer.json +++ b/composer.json @@ -25,10 +25,10 @@ "php": "^8.5" }, "require-dev": { - "ergebnis/composer-normalize": "^2.52", - "infection/infection": "^0.34", - "phpstan/phpstan": "^2.2", - "phpunit/phpunit": "^13.2", + "ergebnis/composer-normalize": "^2.54", + "infection/infection": "^0.35", + "phpstan/phpstan": "^2.3", + "phpunit/phpunit": "^13.4", "slevomat/coding-standard": "^8.31", "squizlabs/php_codesniffer": "^4.0" }, @@ -69,7 +69,7 @@ "test-file": "@php ./vendor/bin/phpunit --configuration phpunit.xml --no-coverage --filter", "tests": [ "@php -d memory_limit=2G ./vendor/bin/phpunit --configuration phpunit.xml tests", - "@php ./vendor/bin/infection --threads=max --logger-html=reports/coverage/mutation-report.html --coverage=reports/coverage" + "@php ./vendor/bin/infection --threads=max --logger-html=reports/coverage/mutation-report.html" ] } } From c0b506ab2f424209d94404f1cf0e374ae8c0d71b Mon Sep 17 00:00:00 2001 From: Gustavo Freze Date: Sat, 24 Oct 2026 13:02:52 -0300 Subject: [PATCH 2/2] refactor: Order members and parameters as the conformance hooks require. --- tests/CurrencyTest.php | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/tests/CurrencyTest.php b/tests/CurrencyTest.php index a718449..442bcad 100644 --- a/tests/CurrencyTest.php +++ b/tests/CurrencyTest.php @@ -9,6 +9,34 @@ final class CurrencyTest extends TestCase { + #[DataProvider('fractionDigitsDataProvider')] + public function testFractionDigitsWhenCurrencyIsAccessedThenReturnsExpectedNumber( + int $expected, + Currency $currency + ): void { + /** @Given a currency with a known number of fraction digits */ + + /** @When asking for the number of fraction digits */ + $actual = $currency->getFractionDigits(); + + /** @Then the returned number matches the expected one */ + self::assertSame($expected, $actual); + } + + #[DataProvider('currenciesDataProvider')] + public function testCurrencyCodeWhenAccessedThenNameAndValueAreThreeCharactersLong( + string $name, + string $value + ): void { + /** @Given a currency case from the data provider */ + + /** @When inspecting the lengths of the name and the value */ + + /** @Then both are exactly three characters long */ + self::assertSame(3, strlen($name)); + self::assertSame(3, strlen($value)); + } + public static function currenciesDataProvider(): array { return array_map(static fn(Currency $currency): array => [ @@ -50,32 +78,4 @@ public static function fractionDigitsDataProvider(): array 'Currency UYW with digits 4' => ['currency' => Currency::UYW, 'expected' => 4] ]; } - - #[DataProvider('currenciesDataProvider')] - public function testCurrencyCodeWhenAccessedThenNameAndValueAreThreeCharactersLong( - string $name, - string $value - ): void { - /** @Given a currency case from the data provider */ - - /** @When inspecting the lengths of the name and the value */ - - /** @Then both are exactly three characters long */ - self::assertSame(3, strlen($name)); - self::assertSame(3, strlen($value)); - } - - #[DataProvider('fractionDigitsDataProvider')] - public function testFractionDigitsWhenCurrencyIsAccessedThenReturnsExpectedNumber( - int $expected, - Currency $currency - ): void { - /** @Given a currency with a known number of fraction digits */ - - /** @When asking for the number of fraction digits */ - $actual = $currency->getFractionDigits(); - - /** @Then the returned number matches the expected one */ - self::assertSame($expected, $actual); - } }