我刚刚在我的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