function testBlahBlah() { $foo = new Foo(); $this->assertEquals($foo->baz(), 1); } } <?php class foo { public function baz() { return 1; } } FooTest.php: Foo.php woensdag 25 april 12
{ public function testBlahBlah() { $foo = new Foo(); $this->assertEquals($foo->baz(), 1); } public function testIsOdd() { $foo = new Foo(); $this->assertTrue($foo->isOdd(1)); } public function testDoesIsOddReturnFalseWhenAnEvenDigitIsGiven { $foo = new Foo(); $this->assertFalse($foo->isOdd(2)); } } woensdag 25 april 12
setUp() { $this->_foo = new Bar(); } public tearDown() { unset($this->_foo); } public function testBlahBlah() { .... } public function testBlah() { .... } } woensdag 25 april 12