PHPUnit 0% coverage with Jetbrains PHPStorm

I am using the Codeigniter3 framework and the phpunit ci-phpunit-test package . I am running php on a zend server with the zend debugger turned on.

In my phpunit.xml file there is:

<phpunit
    bootstrap="./Bootstrap.php"
    colors="true"
    testsuite="CodeIgniter Application Test Suite">
    <testsuites>
        <testsuite name="CodeIgniter Application Test Suite">
            <directory suffix="test.php">./</directory>
            <exclude>./_ci_phpunit_test/</exclude>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist>
            <directory suffix=".php">../controllers</directory>
            <directory suffix=".php">../models</directory>
        </whitelist>
    </filter>
</phpunit>

I start the code coverage using the icon with green play and dash, the following command is executed:

"C:\Program Files (x86)\Zend\ZendServer\bin\php.exe" -dzend_debugger.enable_coverage=1 C:/Users/NICOLAS/AppData/Local/Temp/ide-phpunit.php --configuration C:\....\phpunit.xml

After all tests have successfully completed, the Coverage PHPUnit sidebar opens and displays only 0% coverage (I'm sure the tests go through a lot of code).

Here is what I get:

enter image description here

UPDATE: additional information ... When I add this to the phpunit.xml file, it tells me that Xdebug is not included:

<logging>
    <log type="coverage-html" target="build/coverage"/>
    <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/>
</logging>

xdebug, veeeeeery , HTML build/coverage. , PHPStorm.

, zend PHPStorm ( phpunit.xml). , 0%...

+4
1

, .

(/media/hdd/...), .

+1

Source: https://habr.com/ru/post/1611759/


All Articles