Closed vitalyiegorov closed 6 years ago
Are you running tests against the PHP httpd, or some other web server? I'm collecting code coverage through the internal PHP httpd through a custom router and some HTTP headers set in the Guzzle client. I can share the setup if you want?
We have apache setup, can you please share your config?
Created a gist with the relevant parts here:
https://gist.github.com/christeredvartsen/de3123c0c5cba1519ab57cd3e3e5a665
The router.php
file needs to handled somewhat different since you use Apache, but you could probably just include it in your bootstrap file when in debug/dev mode or something similar.
The gist also includes a configuration file that enables code coverage, so when I want to collect coverage I can just use that file:
./vendor/bin/behat -c behat-coverage.yml
With this setup you won't need to change the Behat API extension at all.
@vitalyiegorov Did you get code coverage up and running?
:zzz:
@christeredvartsen We have faced a situation where we would like to get code coverage by running web api tests. I believe that this is possible if we can change Guzzle client to Symfony Client. Do you know any ClientInterface implementation for this? Our we can make our own? What do you think?