PHP代码覆盖与非单元测试[关闭]

Are there tools that let you instrument PHP to collect code coverage data from integration tests or just manual testing/usage?

I'm aware the coverage options for phpunit but not sure how to proceed beyond that.

This blog post raises the question of what value codecoverage might be when running Behat tests

The nature of acceptance tests is not really to tests units of code, but to assure that the behavior of your application meets a certain set of criteria (Behat Scenarios).

as does this blog post

There is generally no point in having code coverage for Behat test cases because of their nature: The purpose of an acceptance test is to assert a certain behavior of an application, not to technically test a piece of code. Therefore, there is no point in checking for uncovered code pieces in order to write a Behat test for it.

However, Codeception does, and Behat can do so with the vipsoft extension

Our PHP Test Coverage tool will do this.

You use the tool to instrument the application. Then you run the application, any way you like: as an manual/interactive process, triggered from unit tests, run via integratation tests, etc. It collects test coverage data as it runs.

It dumps the test coverage data between every executed page, so you can stop at at arbitrary point and check the code coverage of the recent activity. You can reset the coverage, and continue execution, so you can collect coverage data on episodes of execution.

A viewer tool shows the coverage data, superimposed on the source code.