In the test method, you can define the simulation foo() . Do something like this:
<?php public function testSomething () {
This works because a function can be defined in another method or function. Although they are defined in the method, they are available worldwide.
Using the pecl extension is not required. In addition, it potentially pollutes the test execution environment and at least adds unnecessary requirements.
In addition, note that PHPUnit since version 3.6 supports annotations @codeCoverageIgnore , @codeCoverageIgnoreStart , @codeCoverageIgnoreEnd , which can be used to exclude classes, methods, or portions of code from coverage analysis.
source share