diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 859481c..2a0659b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -87,7 +87,12 @@ jobs: SYMFONY_REQUIRE: ${{ matrix.symfony }} - name: Run tests - run: composer test + run: | + if [[ "${{ matrix.coverage }}" == 'pcov' ]]; then + composer test-coverage + else + composer test + fi - name: Monitor coverage if: matrix.coverage != 'none' diff --git a/composer.json b/composer.json index 4425ca9..8c817f7 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "symfony/http-kernel": "^5.4 || ^6.4 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^11.0", + "phpunit/phpunit": "^10.5 || ^11.0", "symfony/browser-kit": "^5.4 || ^6.4 || ^7.0", "symfony/yaml": "^5.4 || ^6.4 || ^7.0" }, @@ -54,6 +54,7 @@ "sort-packages": true }, "scripts": { - "test": "vendor/bin/phpunit --coverage-clover=coverage-report.xml" + "test": "vendor/bin/phpunit", + "test-coverage": "vendor/bin/phpunit --coverage-clover=coverage-report.xml" } } diff --git a/tests/Functional/FunctionalTest.php b/tests/Functional/FunctionalTest.php index 585fdd2..0d2f47b 100644 --- a/tests/Functional/FunctionalTest.php +++ b/tests/Functional/FunctionalTest.php @@ -19,18 +19,14 @@ class FunctionalTest extends WebTestCase { protected ?KernelBrowser $client; - protected ?ContainerInterface $container; - protected function setUp() : void { $this->client = self::createClient(); - - $this->container = $this->client->getContainer(); } public function testServiceWiring() { - $service = $this->container->get(KernelEventSubscriber::class); + $service = self::getContainer()->get(KernelEventSubscriber::class); self::assertInstanceOf(KernelEventSubscriber::class, $service); }