Auto TDD ¶
If you are lucky enough and have the privilege to develop on a Linux based environment, this little tip might boost-up your TDD process (at least the Unit Testing part). Please note, that this should work just fine with Apple computers also, but not tested!
With the following shell command you can automatically check your test results in every 15 seconds! (under protected/tests)
watch -n 15 -d phpunit unit/
My DEV screen looks something like this (Tests are running on the top-left!)
ps: of course you can change the time (in seconds) to whatever you'd like ;)
Mac OS X 10.6.5
Watch command doesn't appear to be available. I'm not really a terminal expert though, but at first glance it appears that this is a no go on Mac OS X.
Watch on Mac
This might help you guys out if you're on a Mac. I haven't tested it but it's worth a shot.
http://www.sveinbjorn.org/watch_macosx
Runs PHPUnit only if php file is modified
If you want to have your tests run only if you changed the file run this code and be happy:
watch -n 60 -d find protected/tests/unit -mmin -1 -iname '"*.php"' -exec 'phpunit --bootstrap=protected/tests/bootstrap.php {} \;'
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.