如果您正在测试如下所示的计数函数,那么在一个函数中为函数测试多个事物与为每个测试都有一个测试函数是“正确的”还是“错误的”?
function testGetKeywordCount() {
$tester = $this -> getDatabaseTester($this -> CompleteDataFile);
$tester -> onSetUp();
$KeywordID = 0;
$this -> setExpectedException('InvalidArgumentException');
$this -> keyword -> getKeywordCount($KeywordID,'Active');
$KeywordID = 1;
$this -> setExpectedException('InvalidArgumentException');
$this -> keyword -> getKeywordCount($KeywordID,'InvalidStatus');
$this -> assertEquals(1, $this -> keyword -> getKeywordCount($KeywordID,'Active'));
$tester -> onTearDown();
}