* Add mr update unit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
|
||||
/**
|
||||
|
||||
title=测试 mrModel::update();
|
||||
cid=0
|
||||
pid=0
|
||||
|
||||
POST数据正确修改MR描述 >> success
|
||||
使用title为空的数据mr请求 >> 『名称』不能为空。
|
||||
|
||||
*/
|
||||
|
||||
$mrModel = $tester->loadModel('mr');
|
||||
$MRID = 1;
|
||||
|
||||
$_POST = array();
|
||||
$_POST['targetBranch'] = 'master';
|
||||
$_POST['title'] = 'Test MR';
|
||||
$_POST['description'] = date("Y-m-d H:i:s");
|
||||
$_POST['repoID'] = 1;
|
||||
$_POST['assignee'] = '';
|
||||
$_POST['removeSourceBranch'] = '0';
|
||||
$result = $mrModel->update($MRID);
|
||||
if($result['result'] == 'success') $result = 'success';
|
||||
r($result) && p() && e('success'); //POST数据正确修改MR描述
|
||||
|
||||
$_POST['title'] = '';
|
||||
$result = $mrModel->update($MRID);
|
||||
r($result) && p('message[title]:0') && e('『名称』不能为空。'); //使用title为空的数据mr请求
|
||||
Reference in New Issue
Block a user