Test with Frisk!
For a while now, I've had a renewed interesting testing applications - unit, functional, performance, etc - and have been learning all I can about the software you can use to run these tests. Obviously, one of the mainstays of the PHP world is PHPUnit for unit testing. There's a few others out there that are good for other kinds of testing - too many to name (and lots that aren't written in PHP).
Lately, though, I've been looking more at testing the frontend of applications and their flow. I started looking around at the current testing tools and found some I wanted to use, but I wanted more to know how they worked. So, as an exercise, I started on Frisk, a light-weight simple testing framework that has some of the basics of functionally testing, nothing fancy though. Oh, and of course it's open sourced so you can take a look at the work behind it too.
It's not a complete testing tool, but it does work. I've thrown together a simple example of how I've used it to test two things on the Joind.in site - the homepage content and the result of a login:
When this file is dropped in the "tests" directory and the "frisk" executable is run, it'll execute these tests and check the results of those requests. The "ji-enygma.localhost" is a reference to my local Joind.in instance. The results are spit back out as a PHP array that reports the results of each part of the test (pass/fail) split out by test function name and action/assert result:
PLAIN TEXT PHP:- Start!
- A
- =====================
- ending status: Array
- (
- A A [JoindinTest] = Array
- A A A A (
- A A A A A A [testHomepageContent] = Array
- A A A A A A A A (
- A A A A A A A A A A [ActionGet] = Array
- "/
Truncated by Planet PHP, read more at the original (another 11843 bytes)


