diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index a7444a5..2967135 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -25,4 +25,4 @@ jobs: os: >- ['ubuntu-latest'] php: >- - ['8.1', '8.2', '8.3', '8.4'] + ['8.1', '8.2', '8.3', '8.4', '8.5'] diff --git a/composer.json b/composer.json index b5c9949..203cd46 100644 --- a/composer.json +++ b/composer.json @@ -68,7 +68,8 @@ "scripts": { "cs-fix": "php-cs-fixer fix", "rector": "rector", - "test": "phpunit --testdox --no-interaction", + "psalm": "psalm", + "test": "phpunit", "test-watch": "phpunit-watcher watch" } } diff --git a/tests/NumericHelperTest.php b/tests/NumericHelperTest.php index c500c8a..a2de6af 100644 --- a/tests/NumericHelperTest.php +++ b/tests/NumericHelperTest.php @@ -198,9 +198,10 @@ public function testTrimDecimalZeros(?string $input, ?string $expected): void $this->assertSame($expected, NumericHelper::trimDecimalZeros($input)); } - public function trimDecimalZerosWithNonNumericString(): void + public function testTrimDecimalZerosWithNonNumericString(): void { $this->expectException(InvalidArgumentException::class); + $this->expectExceptionMessage('Value must be numeric string or null. "hello" given.'); NumericHelper::trimDecimalZeros('hello'); } } diff --git a/tests/WildcardPatternTest.php b/tests/WildcardPatternTest.php index 9c8a9bf..afff187 100644 --- a/tests/WildcardPatternTest.php +++ b/tests/WildcardPatternTest.php @@ -109,6 +109,14 @@ public function testDisableOptions(): void $this->assertFalse($wildcardPattern->match('ABC42')); } + public function testPreparedPatternIsCachedBetweenMatchCalls(): void + { + $wildcardPattern = new WildcardPattern('begin*end'); + + $this->assertTrue($wildcardPattern->match('begin-middle-end')); + $this->assertFalse($wildcardPattern->match('begin-middle')); + } + public function testImmutability(): void { $original = new WildcardPattern('*'); diff --git a/tools/psalm/composer.json b/tools/psalm/composer.json index 9751a9f..9be3476 100644 --- a/tools/psalm/composer.json +++ b/tools/psalm/composer.json @@ -1,5 +1,5 @@ { "require-dev": { - "vimeo/psalm": "^5.26.1 || ^6.5" + "vimeo/psalm": "^5.26.1 || ^6.16.1" } }