Unit Tests



Install PHPunit's channel

$ pear channel-discover pear.phpunit.de

Install the package

$ pear install phpunit/PHPUnit

Ensure you are in the root of the sgl2 directory, and make sure the tests autoloader is setup correctly

$ cd /path/to/sgl2

Run Seagull's test suite

$ phpunit tests

Setting up the tests autoloader

When you checkout sgl2 you will notice the scripts directory. The PHPunit tests require a boostrap autoloader to run correctly.

execute the autloader script (you must be running PHP 5.3.x)

$ php scripts/autoload.php src/lib tests/out_bootstrap.php

Ensure that the phpunit "binary" is including the bootstrap before running. Currently I am requiring the bootstrap from the phpunit script, which is not ideal.