Setup PHPUnit

Its plain simple but better to describe the process.

Normally if you have pear installed is enough to install with:

pear channel-discover

But if you got something like this:

invalid package name/package file \"\"

for this you must register the channel:

pear channel-discover

And finish with installing PHPUnit

pear install

Here is an example test case with init at the bottom to test in browser:

require_once 'PHPUnit/Autoload.php';

class OutputTest extends PHPUnit_Framework_TestCase
    public function testExpectFooActualFoo()
        print 'foo';

    public function testExpectBarActualBaz()
        print 'baz';

$test = new OutputTest();

Great way to show and run your test in browser: