enygma / frisk

An automated front-end unit testing testing tool written in PHP designed to mimic web requests and evaluate the response
http://testwithfrisk.com
14 stars 0 forks source link

####################### Frisk : Lightweight Functional Testing #######################

Frisk is functional testing framework designed to be run from the command line. It allows for simple gets/posts and passing the results through assertions to test the resulting content.

If you're familiar at all with the PHP unit testing framework PHPUnit (http://phpunit.de) you'll find a lot of similarities with frisk. Several of the concepts and methods names have been borrowed to help make frisk easier to pick up.


The current feature set allows you to:

Requirements

PHP 5.2+ pecl_http extension

Install

No install really needed - tests go in the /tests folder and the "frisk" file needs to be made executable. Oh, and you might want to change the PHP path at the top of it.

Example:

<?php

class MyTest extends Test {

public function test(){
    $data=array('key1'=>'value1');
    $this->get('/foo.php','www.myhost.com')
        ->submitForm($data)
        ->assertContains('foo');
}

}

?>

Additionally, assertions can be called with "Not" in them to negate the check. For example: ->assertContains('foo'); versus ->assertNotContains('foo');


Author: Chris Cornutt ccornutt@phpdeveloper.org