As most people know TextMate is a pretty amazing text editor, probably one of the best for MacOS. What you may not know is that CakePHP has its own textmate bundle. this bundle is maintained by Joël Perras who is also a recent addition to the CakePHP core team. Joël & Andy Dawson have been working on another project called CakeMate CakeMate is described as
A plugin used to extend the functionality of the CakePHP TextMate bundle, which can be found on “The Chaw”: http://thechaw.com/cakephp_tmbundle This plugin is designed to work in conjunction with the Textmate bundle, and will not work as a standalone.
Sounds pretty cool eh? Well it is. If you write and run unit tests all day CakeMate might help reduce all the
cmd+tab, cmd+r you are doing. CakeMate is still a work in progress, but the testing shell works. I spent a few hours on the weekend updating the output to make it prettier and easier to read. You can find those in my fork of CakeMate and hopefully in the main fork as well.
Using CakeMate to run tests
So in order to run unit tests using CakeMate you need to download and place it in your
app/plugins directory, or otherwise link it up Once that is done, you need to create a command in TextMate so you can run the CakeMate tester shell. Mine looks like
- $TM_PROJECT_DIRECTORY/cake/console/cake cakemate tester -working $TM_PROJECT_DIRECTORY
You’ll want to set the
input as “None”, and the
output as “Show as Html” I’ve bound this to command to
cmd+ctrl+r. Once you’ve added the command, anytime you have a test case as the active document, you can hit your command and run the test. You should get a popup that looks a little like this
No more having to leave textmate to run unit tests which is really nice.