Search code examples
phpunitcode-coveragexdebug

PHPUnit not producing records


For some reason PHPUnit has stopped producing coverage records and I don't know why. It was producing them yesterday just fine. It still runs unit tests as expected and they pass/fail correctly, but it no longer respects the --coverage parameters.


Solution

  • It turns out that this is actually caused by an upgrade to OSX. When OSX upgrades it replaces the currently installed PHP-cli bin with a default one. This can cause a problem if you've re-mapped php to refer to another binary installed with MacPorts. Be sure to look for a warning XDebug not installed, or similar, which will indicate that this has happened.

    Should be noted: this will happen any time that XDebug is removed as an extension, not just in OSX. However because OSX is particularly destructive when it comes to resetting defaults (I actually have the MacPorts httpd server mapped to a different name so that it won't ever override the correct Apache settings) it is worth noting here.