我剛剛在我的Ubuntu上安裝了phpunit。phpunit在mvc結構中
現在我不想實施一些測試到我的(php代碼)mvc結構。但我沒有在那裏我得到測試輸出的任何線索......
我有控制器功能,看起來像這樣:
public function run_test(){
error_log("i was called correctly");
$mytest = new modeltest();
$mytest->run();
// $this->outputvar = testresults ??
$this->set_template("mytestview");
}
以及我testmodel:
class ModelTest extends PHPUnit_Framework_TestCase{
public function testWorks(){
error_log("i was called correctly as well");
$model = new model();
$this->assertEquals(3, $model->works(2, 1));
}
}
作品僅僅是測試phpunit運行的簡單函數,它增加了兩個值。
我如何獲得測試結果?
AAAH。 ..現在我明白了:-)我上次在2004年或2005年使用它。許多事情在那些日子裏有所不同。 – helle 2011-01-25 10:23:10