First, edit your php.init file
$ sublime /Applications/MAMP/bin/php/php5.x.xx/conf/php.ini
(You can find your php version by "php -v" and the path by "which php")
Uncomment:
;zend_extension="/Applications/MAMP/bin/php...
Edit your phpunit file
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="bootstrap/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
>
<testsuites>
<testsuite name="Application Test Suite">
<directory>./app/tests/</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-html" target="app/storage/coverage" title="Base32"
charset="UTF-8" yui="true" highlight="true"
lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="app/storage/coverage/clover.xml"/>
</logging>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">app/models</directory>
<directory suffix=".php">app/controllers</directory>
</whitelist>
</filter>
</phpunit>
$ phpunit