diff --git a/.github/workflows/cs-fix.yml b/.github/workflows/cs-fix.yml index db5860c..14f585c 100644 --- a/.github/workflows/cs-fix.yml +++ b/.github/workflows/cs-fix.yml @@ -12,5 +12,6 @@ jobs: permissions: contents: write uses: spiral/gh-actions/.github/workflows/cs-fix.yml@master - -... + with: + php: >- + ['8.4'] diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 55040ad..3a2ac91 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -14,3 +14,5 @@ jobs: ['ubuntu-latest'] stability: >- ['prefer-lowest', 'prefer-stable'] + php: >- + ['8.4', '8.5'] diff --git a/.github/workflows/psalm.yml b/.github/workflows/psalm.yml index 4c1f9dd..aec32a7 100644 --- a/.github/workflows/psalm.yml +++ b/.github/workflows/psalm.yml @@ -13,3 +13,5 @@ jobs: with: os: >- ['ubuntu-latest'] + php: >- + ['8.4'] diff --git a/.gitignore b/.gitignore index a37b2b5..9a30fee 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,6 @@ /vendor/ /.env /composer.lock +/.phpunit.result.cache *.log *.exe diff --git a/composer.json b/composer.json index a56d683..f05e376 100644 --- a/composer.json +++ b/composer.json @@ -43,10 +43,10 @@ ], "require": { "ext-json": "*", - "php": ">=8.1", + "php": ">=8.4", "nyholm/psr7": "^1.8.2", "mockery/mockery": "^1.6.12", - "phpunit/phpunit": "^9.6 || 10.5.45", + "phpunit/phpunit": "^13.0.5", "spiral/auth": "^3.16", "spiral/auth-http": "^3.16", "spiral/boot": "^3.16", @@ -65,9 +65,6 @@ "spiral/scaffolder": "^3.16", "symfony/mime": "^6.4.18 || ^7.2 || ^8.0" }, - "conflict": { - "phpunit/phpunit": ">10.5.45" - }, "suggest": { "brianium/paratest": "Required to run tests in parallel (^6.0).", "ext-gd": "Required to use generate fake image files" @@ -95,6 +92,7 @@ "minimum-stability": "dev", "prefer-stable": true, "config": { + "lock": false, "sort-packages": true, "allow-plugins": { "spiral/composer-publish-plugin": false diff --git a/phpunit.xml b/phpunit.xml index 27d113c..0b6a9ff 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,43 +1,29 @@ - - - - tests - - - - - - - - - - - - - - - src - - - tests - - - - - + + + + tests + + + + + + + + + + + + + + + src + + + tests + + + + + diff --git a/src/TestCase.php b/src/TestCase.php index 3b62139..b62e404 100644 --- a/src/TestCase.php +++ b/src/TestCase.php @@ -228,16 +228,16 @@ protected function tearDownTraits(): void $this->runTraitSetUpOrTearDown('tearDown'); } - protected function runTest(): mixed + protected function invokeTestMethod(string $methodName, array $testArguments): mixed { $scope = $this->getTestScope(); if ($scope === null) { - return parent::runTest(); + return parent::invokeTestMethod($methodName, $testArguments); } $scopes = \is_array($scope->scope) ? $scope->scope : [$scope->scope]; - $result = self::runScopes($scopes, function (): mixed { - return parent::runTest(); + $result = self::runScopes($scopes, function () use ($methodName, $testArguments): mixed { + return parent::invokeTestMethod($methodName, $testArguments); }, $this->getContainer(), $scope->bindings); return $result; diff --git a/tests/src/Traits/InteractsWithDispatcherTest.php b/tests/src/Traits/InteractsWithDispatcherTest.php index 97d1c96..9ab5193 100644 --- a/tests/src/Traits/InteractsWithDispatcherTest.php +++ b/tests/src/Traits/InteractsWithDispatcherTest.php @@ -4,6 +4,7 @@ namespace Spiral\Testing\Tests\Traits; +use PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations; use Spiral\Boot\DispatcherInterface; use Spiral\Boot\Environment; use Spiral\Boot\EnvironmentInterface; @@ -69,6 +70,7 @@ public function canServe(EnvironmentInterface $env): bool $this->assertDispatcherCannotBeServed($dispatcher::class); } + #[AllowMockObjectsWithoutExpectations] public function testGetRegisteredDispatchers(): void { $dispatcherA = $this->createMock(DispatcherInterface::class);