Get Coverage Reports working with PHPUnit and MAMP
If you get a “The Xdebug extension is not loaded. No code coverage will be generated.” error message when running phpunit –coverage-html test, you need to add Xdebug to the php.ini as follows:
zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
;xdebug.idekey=
The actual path may actual be different as I am using ActiveState’s Komodo version of Xdebug that I manually copied to the PHP extensions directory.
If you are running MAMP Pro you should also add the above lines to the php.ini template. Do this by opening MAMP Pro Application and click “Edit Template” from the File menu, then click “PHP 5.3.6 php.ini”.
Save and restart your servers.