我正在使用Codeigniter3框架和phpunit软件包
ci-phpunit-test.
我在启用了zend调试器的zend服务器上运行php.
我在启用了zend调试器的zend服务器上运行php.
我的phpunit.xml文件在那里:
<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>
我使用带有绿色播放和破折号的图标运行代码覆盖率执行,这将运行以下命令:
"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
成功运行所有测试后,Coverage PHPUnit侧栏将打开,仅显示0%的覆盖率(我确信测试会经过大量代码).
这是我得到的:
更新:更多信息……
当我在phpunit.xml文件中添加它时,它告诉我Xdebug未启用:
<logging> <log type="coverage-html" target="build/coverage"/> <log type="junit" target="build/logs/junit.xml" logIncompleteSkipped="false"/> </logging>
因此,我尝试启用xdebug调试器,测试运行缓慢,我在build / coverage文件夹中获得了HTML报告.它很好但没有集成在PHPStorm环境中.
所以我回到zend调试器并尝试PHPStorm功能(删除phpunit.xml中的日志部分).测试快速运行,但覆盖率保持在0%……
解决方法
我有同样的问题,这
answer做了伎俩.
By changing the project root to the absolute path (/media/hdd/…) I was able to resolve the problem.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。