Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong coverage #102

Open
ghost opened this issue Aug 4, 2023 · 0 comments
Open

Wrong coverage #102

ghost opened this issue Aug 4, 2023 · 0 comments

Comments

@ghost
Copy link

ghost commented Aug 4, 2023

Hello

I'm trying to setup code coverage on my Symfony app.
Here is my configuration :

php-code-coverage 9.2.27 using PHP 8.2.8 and PHPUnit 9.6.10

Command used:
php -d xdebug.mode=off -d pcov.enabled=1 -d pcov.directory=. -d pcov.exclude="vendor" bin/phpunit --coverage-clover='reports/coverage/coverage.xml' --coverage-html='reports/coverage'

My test file:

 #[NoReturn] public function testAuth(): void
    {
        $response = self::$client->post('/api/auth', [
            'json' => [
                'username' => self::$exampleUser->getUsername(),
                  'password' => self::$exampleUser->getTextPassword()
            ]
        ]);

        $responseDecoded = json_decode($response->getBody()->read($response->getBody()->getSize()), true);

        $this->assertTrue(true); // Dumb assert, it's ok
    }

The issue is : when I'm testing my app (using Guzzle client), the controllers and services are not covered (0%)
Only the.. entity folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants