diff --git a/module/program/test/model/getbyid.php b/module/program/test/model/getbyid.php index a918fc5e4e..e09352e322 100755 --- a/module/program/test/model/getbyid.php +++ b/module/program/test/model/getbyid.php @@ -1,5 +1,35 @@ #!/usr/bin/env php name->setFields(array( )); $program->gen(5); -/** - -title=测试 programModel::getById(); -cid=1 -pid=1 - -通过id字段获取id=1的项目集并验证它的name。 >> 项目集1 -通过id字段获取id=1000的项目集,返回空 >> 0 -通过id字段获取id=0的项目集,返回空 >> 0 - -*/ - $programTester = new programTest(); -$program1 = $programTester->getByIDTest(1); -$program2 = $programTester->getByIDTest(1000); -$program3 = $programTester->getByIDTest(0); - -r($program1) && p('name') && e('项目集1'); // 通过id字段获取id=1的项目集并验证它的name。 -r($program2) && p() && e('0'); // 通过id字段获取id=1000的项目集,返回空 -r($program3) && p() && e('0'); // 通过id字段获取id=0的项目集,返回空 +r($programTester->getByIDTest(1)) && p('id,name,budget,type,status') && e('1,项目集1,900000,program,wait'); // 通过id字段获取id=1的项目集。 +r($programTester->getByIDTest(2)) && p('id,name,budget,type,status') && e('2,项目集2,899900,program,wait'); // 通过id字段获取id=2的项目集。 +r($programTester->getByIDTest(3)) && p('id,name,budget,type,status') && e('3,项目集3,899800,program,doing'); // 通过id字段获取id=3的项目集。 +r($programTester->getByIDTest(1000)) && p() && e('0'); // 通过id字段获取id=1000的项目集,返回空 +r($programTester->getByIDTest(0)) && p() && e('0'); // 通过id字段获取id=0的项目集,返回空