| Question | Answer
| ------------| ---------------
| Infection version | 0.5.2
| Test Framework version | PHPUnit 6.1.0
| PHP version | 7.1.0
| Platform | MacOS
| Github Repo | https://github.com/oxidmod/rest-bundle/tree/repo/mutation-tests
There is an issue with either XDebug or PHPUnit Coverage component that leads to uncovered mutant with 100% code coverage.
--- Original
+++ New
@@ @@
{
- switch (true) {
+ switch (false) {
case $data === null:
return new NullResource();
case is_array($data):
case $data instanceof \Traversable:
return new Collection($data, $this->transformer, $resourceKey);
default:
I've created an issue in the PHPUnit_Coverage repository to track it: https://github.com/sebastianbergmann/php-code-coverage/issues/552
Temporary solution is to rewrite this code with ifs
There is an issue with either XDebug or PHPUnit Coverage component that leads to uncovered mutant with 100% code coverage.
Looks like it's PHP itself since the same can be seen with phpdbg without Xdebug loaded:
<?php
phpdbg_start_oplog();
switch (true) {
case false:
echo 'here';
break;
}
var_dump(phpdbg_get_executable());
↪ phpdbg -qrr coverage.php
array(1) {
'/home/morozov/coverage.php' =>
array(5) {
[3] =>
int(0)
[6] =>
int(0)
[7] =>
int(0)
[8] =>
int(0)
[11] =>
int(0)
}
}
A PHPDBG ticket: https://bugs.php.net/bug.php?id=75422.
Looks like won't fix according to Derick's explanation: https://bugs.xdebug.org/view.php?id=1479
Closing for now...