* scripts/phpunit HelloTest * * * If your script (which would need to be in HelloTest.php) is found and runs, * UR DOIN IT RIGHT! */ /** * Class HelloTest */ class HelloTest extends PHPUnit_Framework_TestCase { // contains the object handle of the string class var $abc; /** * @param string|null $name */ public 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 */ public 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. */ public function tearDown() { // delete your instance unset($this->abc); } /** * test the toString function */ public function testHello() { $result = $this->abc; $expected = 'hello'; $this->assertEquals($result, $expected); } }