* scripts/phpunit HelloTest * * * If your script (which would need to be in HelloTest.php) is found and runs, * UR DOIN IT RIGHT! */ require_once 'PHPUnit/Framework/TestCase.php'; /** * Class HelloTest */ class HelloTest extends PHPUnit_Framework_TestCase { // contains the object handle of the string class var $abc; /** * @param null $name */ function __construct($name = NULL) { parent::__construct($name); } // called before the test functions will be executed // this function is defined in PHPUnit_TestCase and overwritten // here function setUp() { // create a new instance of String with the // string 'abc' $this->abc = "hello"; } // called after the test functions are executed // this function is defined in PHPUnit_TestCase and overwritten // here function tearDown() { // delete your instance unset($this->abc); } // test the toString function function testHello() { $result = $this->abc; $expected = 'hello'; $this->assertEquals($result, $expected); } }