I am trying to generate the code coverage report in HTML format for a module I am writing so I can work out where I need to improve coverage.
Normally when I run tests for my module I use the following command:
vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist vendor/vendorname/m2-module-name/
I tried to generate the report using the following command:
vendor/bin/phpunit -c dev/tests/unit/phpunit.xml.dist --coverage-html ./report vendor/vendorname/m2-module-name/
As you can see PHPUnit is generating the report for the setup module.
Does anybody know how to run code coverage on Magento 2?
I have also tried editing the phpunit.xml.dist to include the following line but it doesn't seem to do anything:
<logging> <!--coverage_html_placeholder--> <log type="coverage-html" target="/usr/share/nginx/html/test-reports/coverage" charset="UTF-8" yui="true" highlight="true"/>