iTerm over the built in terminal). whereis phpunit
I tried a few different ways to install php, I’m not sure which one eventually installed it, but… yeah I know sounds dumb, but when you try a bunch of different ways and then it ‘just starts working’ you lose track which way actually fixed it. Besides it was two weeks ago, I can’t remember that far back. I do know that one of the has Xdebug turned on to generate the nice reports of code coverage.
For example. ` Shane:tests shane$ whereis phpunit /usr/bin/phpunit Shane:tests shane$ phpunit —version PHPUnit 3.4.6 by Sebastian Bergmann.
Shane:tests shane$ `
Bonus This will create a neat little tree of your folder structure ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
So I have this structure for my application |-application |---configs |---controllers |---models |-----DbTable |---views |-----helpers |-----scripts |-------error |-------index |-library |-public |-tests |---application |-----controllers |-----models |---library |---log |-----report
Notice the “test” folder with subfolders? Good.
We now have the necessary folder, here are files
tests/phpunit.xml `
<filter>
<whitelist>
<directory suffix=".php">../library/</directory>
<directory suffix=".php">../application/</directory>
<exclude>
<directory suffix=".phtml">../application/</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./log/report" charset="UTF-8"
yui="true" highlight="true"
lowUpperBound="50" highLowerBound="80"/>
<log type="testdox-html" target="./log/testdox.html" />
</logging>
`tests/bootstrap.php