public function test() { $this->load->library('unit_test'); $test = 1 + 2; $expected_result = $this->test_fun(1,2); $test_name = '測試判斷'; $this->unit->run($test, $expected_result, $test_name); echo $this->unit->report(); } private function test_fun($a,$b) { return $a+$b; }