在那些日子里,我们在一个自制的框架中开发了一个工具,并为此用PHPUnit设置了单元测试(whitout )。然后我就可以用代码转换白化问题做测试了。
现在,我将我的工具迁移为Symfony包。我现在可以在没有错误的情况下测试它(白化编码覆盖)。
我在谷歌上搜索并没有发现任何关于CodeCoverage.php未定义通知问题的信息。
phpunit -c app src/myVendor/myBundle/
.............................................................. 62 / 139 ( 44%)
.............................................................. 124 / 139 ( 89%)
...............
Time: 14.5 seconds, Memory: 45.00Mb
OK (139 tests, 5733 assertions)但是,当我为代码转换添加日志配置时,执行就会崩溃。,但在我将工具迁移到包之前,它是有效的。
<phpunit bootstrap="bootstrap.php.cache"
stopOnError="true"
stopOnFailure="true"
stopOnRisky="true"
stopOnIncomplete="true"
stopOnSkipped="true"
>
<logging>
<log type="coverage-html"
target="C:/Users/FPI/Desktop/PHPUnit_CodeCoverage/html"
lowUpperBound="35"
highLowerBound="70"/>
</logging>
</phpunit>我收到这个错误:
Fatal error: Uncaught exception 'Symfony\Component\Debug\Exception\ContextErrorException' with message 'Notice: Undefined offset: 4658' in phar://C:/bin/phpunit/php-code-coverage/CodeCoverage.php on line 694
Symfony\Component\Debug\Exception\ContextErrorException: Notice: Undefined offset: 4658 in phar://C:/bin/phpunit/php-code-coverage/CodeCoverage.php on line 694
Call Stack:
34.3818 45467848 1. Symfony\Component\Debug\ErrorHandler->handleException() D:\Projekte\myproject\vendor\symfony\symfony\src\Symfony\Component\Debug\ErrorHandler.php:0谢谢你的帮助。PHPUnit诉4.6.9。PHP 5.5.26
发布于 2015-10-13 11:53:35
多亏@Jean,PHPUnit更新解决了这个问题。
https://stackoverflow.com/questions/32313043
复制相似问题