laravel-graphql
laravel-graphql copied to clipboard
Testing coverage with GraphQL is always return 0%
Hi,
I want to test my code coverage, so I am using php unit with xdebug.
I have a function like this:
/**
* @test
*/
public function getReturnOk()
{
$query = 'query{clients{clname, is_mypage_event}}';
$response = $this->withoutMiddleware()->get('graphql/secret?query=' . $query);
$response->assertStatus(Response::HTTP_OK);
}
But when I execute ./vendor/bin/phpunit --coverage-html coverage, the coverage result is 0%, means that no line was executed
Was my test method wrong??
Thank you so much.
And your coverage setup is working, in general? For non-GraphQL related stuff?
A project of mine I work on has working coverage also within the GraphQL parts.
My coverage is working with normal API. Could you please give me a short example of your test?