Testing

Testing a Subset of Methods Within a Test Case

Posted by Jeremy Harris on Sun, Jul 24, 2011 @ 8:13pm

UPDATE: @savant and I were chatting in #cakephp one night. Turns out he had something similar, and took some of my ideas and came up with a nice solution: https://gist.github.com/1208800

We all know that testing can be really slow if you have a large app with a lot of fixtures. When dealing with this on a large test case file, it becomes a huge time waste to test the entire file each time when...

Testing Quirks

Posted by Jeremy Harris on Mon, Aug 09, 2010 @ 3:29pm

In my travels across the desert plains that are unit tests, I've discovered a few quirks I thought I'd share here.

Equal !== Identical

The above is obivous, but because my testing knowledge started with the CakePHP docs and the included tests that came with the software, I wrote most of my tests using assertEqual and thought it would be sufficient. I pulled some data, sorted it, and asserted ...

Testing controllers the (slightly less) hard way

Posted by Jeremy Harris on Tue, Aug 03, 2010 @ 6:57pm

UPDATE: This post uses an old version of the class to demonstrate. The principles are the same, though. I've hosted the project on Codaset for all to fork or whatever. It's also wrapped in a nice little plugin. I removed some of the more proprietary things (mocking ACL, configuring Auth, etc.) Get to it here: http://www.42pixels.com/downloads/cakephp-extended-test-case-plugin

 

I've just rece...