* adjust code for test.
This commit is contained in:
@@ -8,23 +8,23 @@ title=测试 mrModel::getDiffs();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
使用空的MR >> return null
|
||||
使用空的MR >> return null
|
||||
使用正确的MR >> return normal
|
||||
|
||||
*/
|
||||
|
||||
$mrModel = $tester->loadModel('mr');
|
||||
|
||||
$MR = '';
|
||||
$MR = '';
|
||||
$result = $mrModel->getDiffs($MR);
|
||||
if(empty($result)) $result = 'return null';
|
||||
r($result) && p() && e('return null'); //使用空的MR
|
||||
|
||||
$MR = $tester->dao->select('*')->from(TABLE_MR)->orderBy('id_desc')->limit(1)->fetch();
|
||||
$MR = $tester->dao->select('*')->from(TABLE_MR)->orderBy('id_desc')->limit(1)->fetch();
|
||||
$result = $mrModel->getDiffs($MR);
|
||||
if(!empty($result))
|
||||
{
|
||||
$first = reset($result);
|
||||
if(isset($first->fileName) and is_array($first->contents)) $result = 'return normal';
|
||||
}
|
||||
r($result) && p() && e('return normal'); //使用正确的MR
|
||||
r($result) && p() && e('return normal'); //使用正确的MR
|
||||
|
||||
@@ -8,21 +8,19 @@ title=测试 mrModel::getLastReviewInfo();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
使用空的repoID >> return null
|
||||
使用空的repoID >> return null
|
||||
使用正确的repoID >> return normal
|
||||
|
||||
*/
|
||||
|
||||
$mrModel = $tester->loadModel('mr');
|
||||
|
||||
$repoID = 0;
|
||||
|
||||
$repoID = 0;
|
||||
$result = $mrModel->getLastReviewInfo($repoID);
|
||||
if(empty($result)) $result = 'return null';
|
||||
r($result) && p() && e('return null'); //使用空的repoID
|
||||
|
||||
$repo = $tester->dao->select('*')->from(TABLE_REPO)->orderBy('id_desc')->limit(1)->fetch();
|
||||
$repoID = $repo->id;
|
||||
$result = $mrModel->getLastReviewInfo($repoID);
|
||||
$repo = $tester->dao->select('*')->from(TABLE_REPO)->orderBy('id_desc')->limit(1)->fetch();
|
||||
$result = $mrModel->getLastReviewInfo($repo->id);
|
||||
if(isset($result->bug) and isset($result->task)) $result = 'return normal';
|
||||
r($result) && p() && e('return normal'); //使用正确的repoID
|
||||
r($result) && p() && e('return normal'); //使用正确的repoID
|
||||
|
||||
@@ -8,8 +8,8 @@ title=测试 mrModel::getReview();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
使用空的repoID, MRID, revision >> return null
|
||||
使用正确的repoID, MRID >> return normal
|
||||
使用空的repoID, MRID, revision >> return null
|
||||
使用正确的repoID, MRID >> return normal
|
||||
使用正确的repoID, MRID, 错误的revision >> return null
|
||||
|
||||
*/
|
||||
@@ -24,7 +24,7 @@ $result = $mrModel->getReview($repoID, $MRID, $revision);
|
||||
if(empty($result)) $result = 'return null';
|
||||
r($result) && p() && e('return null'); //使用空的repoID, MRID, revision
|
||||
|
||||
$MR = $tester->dao->select('*')->from(TABLE_MR)->orderBy('id_desc')->limit(1)->fetch();
|
||||
$MR = $tester->dao->select('*')->from(TABLE_MR)->orderBy('id_desc')->limit(1)->fetch();
|
||||
$repoID = $MR->repoID;
|
||||
$MRID = $MR->id;
|
||||
$result = $mrModel->getReview($repoID, $MRID, $revision);
|
||||
@@ -36,6 +36,6 @@ if(!empty($result))
|
||||
r($result) && p() && e('return normal'); //使用正确的repoID, MRID
|
||||
|
||||
$revision = '123qwe';
|
||||
$result = $mrModel->getReview($repoID, $MRID, $revision);
|
||||
$result = $mrModel->getReview($repoID, $MRID, $revision);
|
||||
if(empty($result)) $result = 'return null';
|
||||
r($result) && p() && e('return null'); //使用正确的repoID, MRID, 错误的revision
|
||||
r($result) && p() && e('return null'); //使用正确的repoID, MRID, 错误的revision
|
||||
|
||||
@@ -8,15 +8,14 @@ title=测试 mrModel::saveBug();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
使用空的repoID, MRID >> return false
|
||||
使用正确的repoID, MRID。空的title。 >> return false
|
||||
使用空的repoID, MRID >> return false
|
||||
使用正确的repoID, MRID。空的title。 >> return false
|
||||
使用正确的repoID, MRID。POST数据正确。 >> Test Bug Review
|
||||
|
||||
*/
|
||||
|
||||
$mrModel = $tester->loadModel('mr');
|
||||
|
||||
$MR = $tester->dao->select('*')->from(TABLE_MR)->orderBy('id_desc')->limit(1)->fetch();
|
||||
$_POST = array();
|
||||
$_POST['title'] = 'Test Bug Review';
|
||||
$_POST['commentText'] = 'Test Bug Review';
|
||||
@@ -35,10 +34,11 @@ if($result['result'] == 'fail' and isset($result['message']['mr']) and isset($re
|
||||
r($result) && p() && e('return false'); //使用空的repoID, MRID
|
||||
|
||||
$_POST['title'] = '';
|
||||
$MR = $tester->dao->select('*')->from(TABLE_MR)->orderBy('id_desc')->limit(1)->fetch();
|
||||
$result = $mrModel->saveBug($MR->repoID, $MR->id, $v1, $v2);
|
||||
if($result['result'] == 'fail' and isset($result['message']['title'])) $result = 'return false';
|
||||
r($result) && p() && e('return false'); //使用正确的repoID, MRID。空的title。
|
||||
|
||||
$_POST['title'] = 'Test Bug Review';
|
||||
$result = $mrModel->saveBug($MR->repoID, $MR->id, $v1, $v2);
|
||||
r($result) && p('title') && e('Test Bug Review'); //使用正确的repoID, MRID。POST数据正确。
|
||||
r($result) && p('title') && e('Test Bug Review'); //使用正确的repoID, MRID。POST数据正确。
|
||||
|
||||
@@ -16,7 +16,6 @@ pid=1
|
||||
|
||||
$mrModel = $tester->loadModel('mr');
|
||||
|
||||
$MR = $tester->dao->select('*')->from(TABLE_MR)->orderBy('id_desc')->limit(1)->fetch();
|
||||
$_POST = array();
|
||||
$_POST['title'] = 'Test Task Review';
|
||||
$_POST['commentText'] = 'Test Task Review';
|
||||
@@ -36,10 +35,11 @@ if($result['result'] == 'fail' and isset($result['message']['mr']) and isset($re
|
||||
r($result) && p() && e('return false'); //使用空的repoID, MRID
|
||||
|
||||
$_POST['title'] = '';
|
||||
$MR = $tester->dao->select('*')->from(TABLE_MR)->orderBy('id_desc')->limit(1)->fetch();
|
||||
$result = $mrModel->saveTask($MR->repoID, $MR->id, $v1, $v2);
|
||||
if($result['result'] == 'fail' and isset($result['message']['name'])) $result = 'return false';
|
||||
r($result) && p() && e('return false'); //使用正确的repoID, MRID。空的title。
|
||||
|
||||
$_POST['title'] = 'Test Task Review';
|
||||
$result = $mrModel->saveTask($MR->repoID, $MR->id, $v1, $v2);
|
||||
r($result) && p('title') && e('Test Task Review'); //使用正确的repoID, MRID。POST数据正确。
|
||||
r($result) && p('title') && e('Test Task Review'); //使用正确的repoID, MRID。POST数据正确。
|
||||
|
||||
Reference in New Issue
Block a user