How to perform unit testing of Savane
=====================================

Savane uses PHPUnit for unit testing. For information about PHPUnit,
see <http://www.phpunit.de/>.

You need to get a copy of PHPUnit 3, probably available
as a package for your distribution.

You can run all tests by executing the following command:

$> make tests


How to write test cases for Savane
==================================

In order to get your new tests run automatically, simply follow
these instructions:

* Create a new file, preferably with a name similar to the
  name of the Savane file you'll test, without the path part.
  For example, if you want to test the file
  frontend/php/include/version.php, your filename should be
  "VersionTest.php", and you class could be called "VersionTest".
* Include the Savane file you want to test.
* Place as many public functions named test* in your class as you
  like.

That's all, folks!


Skeleton example of a test file (filename: VersionTest.php)
===========================================================

<?php
require_once 'PHPUnit/Framework.php';
require_once '../../frontend/php/include/version.php';

class VersionTest extends PHPUnit_Framework_TestCase
  {
    public function testHomepage()
      {
        global $savane_url;
        $this->assertEquals($savane_url, "http://gna.org/projects/savane");
      }
  }
?>
