diff --git a/api/v1/entries/product.php b/api/v1/entries/product.php index a8286fbf8e..ca5af67f04 100644 --- a/api/v1/entries/product.php +++ b/api/v1/entries/product.php @@ -78,7 +78,7 @@ class productEntry extends Entry if(isset($data->result) and $data->result == 'fail') return $this->sendError(400, $data->message); $product = $this->product->getByID($productID); - $this->sendSuccess(200, $this->format($product, 'createdDate:time')); + $this->send(200, array('product' => $this->format($product, 'createdDate:time'))); } /** diff --git a/api/v1/entries/user.php b/api/v1/entries/user.php index 8642cff4ee..66c7437641 100644 --- a/api/v1/entries/user.php +++ b/api/v1/entries/user.php @@ -28,6 +28,8 @@ class userEntry extends Entry $control->profile($userID); $data = $this->getData(); + if(!$data) return $this->send404(); // If no user, send 404. + $user = $data->data->user; unset($user->password); diff --git a/db/standard/zentao15.7.sql b/db/standard/zentao15.7.sql index d23b31a126..49dcaddac5 100644 --- a/db/standard/zentao15.7.sql +++ b/db/standard/zentao15.7.sql @@ -114,7 +114,7 @@ CREATE TABLE `zt_apistruct_spec` `addedBy` varchar(30) NOT NULL DEFAULT 0, `addedDate` datetime NOT NULL, primary key (`id`) -) +); CREATE TABLE `zt_block` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, `account` char(30) NOT NULL, diff --git a/db/update15.6.sql b/db/update15.6.sql index d4cea2e913..f6bd88b033 100644 --- a/db/update15.6.sql +++ b/db/update15.6.sql @@ -101,4 +101,4 @@ CREATE TABLE `zt_apistruct_spec` `addedBy` varchar(30) NOT NULL DEFAULT 0, `addedDate` datetime NOT NULL, primary key (`id`) -) +); diff --git a/db/zentao.sql b/db/zentao.sql index 60e963ee7d..df96ad703d 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -121,7 +121,7 @@ CREATE TABLE `zt_apistruct_spec` `addedBy` varchar(30) NOT NULL DEFAULT 0, `addedDate` datetime NOT NULL, primary key (`id`) -) +); -- DROP TABLE IF EXISTS `zt_block`; CREATE TABLE IF NOT EXISTS `zt_block` ( `id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, diff --git a/module/api/control.php b/module/api/control.php index a5d5f2180a..5b2da11eea 100755 --- a/module/api/control.php +++ b/module/api/control.php @@ -617,7 +617,7 @@ class api extends control if(intval($libID) > 0) { $menu .= ""; @@ -690,7 +690,7 @@ EOT; if(!empty($versions)) { $versionName = $version > 0 ? $versions[$version]->version : $this->lang->api->defaultVersion; - $output .= <<
-noticeAcl);?> +api->noticeAcl);?> diff --git a/module/api/view/editlib.html.php b/module/api/view/editlib.html.php index 4a6ad4b856..ccc8cee79c 100644 --- a/module/api/view/editlib.html.php +++ b/module/api/view/editlib.html.php @@ -33,12 +33,12 @@ api->control;?> - acl->aclList, $doc->acl, "onchange='toggleAcl(this.value, \"lib\")'");?> - noticeAcl['open'];?> + api->aclList, 'open', "onchange='toggleAcl(this.value, \"lib\")'")?> + api->noticeAcl['open'];?> - '> - acl->whiteList;?> + + api->whiteList;?>
acl->group?> @@ -75,11 +75,9 @@ api->control;?> - - api->aclListB, 'open', "onchange='toggleAcl(this.value, \"lib\")'");?> - + api->aclListB, 'open', "onchange='toggleAcl(this.value, \"lib\")'")?>
-noticeAcl);?> +api->noticeAcl);?> diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index fbb7fffd99..59b4a7c9c2 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -320,25 +320,6 @@ $lang->themes['pink'] = '芙蕖粉'; $lang->themes['blackberry'] = '露莓黑'; $lang->themes['classic'] = '经典蓝'; -/* global access control lang */ -/* common access control lang */ -$lang->acl->whiteList = '白名单'; -$lang->acl->aclList['open'] = '公开'; -$lang->acl->aclList['private'] = '私有'; -$lang->acl->aclList['custom'] = '自定义'; -$lang->acl->group = '分组'; -$lang->acl->user = '用户'; - -$lang->noticeAcl = [ - 'open' => '所有人都可以访问', - 'custom' => '白名单的用户可以访问', - 'private' => '只有创建者自己可以访问', -]; - -/* 全局公众配置 */ -$lang->curd->create = '创建'; - - /* 错误提示信息。*/ $lang->error = new stdclass(); $lang->error->companyNotFound = "您访问的域名 %s 没有对应的公司。"; diff --git a/module/group/lang/changelog.php b/module/group/lang/changelog.php index 5689920682..24bc48ab5f 100644 --- a/module/group/lang/changelog.php +++ b/module/group/lang/changelog.php @@ -424,3 +424,16 @@ $lang->changelog['15.0.rc1'][] = 'stakeholder-createExpect'; $lang->changelog['15.0.rc1'][] = 'stakeholder-editExpect'; $lang->changelog['15.0.rc1'][] = 'stakeholder-viewExpect'; $lang->changelog['15.0.rc1'][] = 'stakeholder-userIssue'; + +$lang->changelog['15.7'][] = 'api-index'; +$lang->changelog['15.7'][] = 'api-createLib'; +$lang->changelog['15.7'][] = 'api-editLib'; +$lang->changelog['15.7'][] = 'api-deleteLib'; +$lang->changelog['15.7'][] = 'api-publish'; +$lang->changelog['15.7'][] = 'api-struct'; +$lang->changelog['15.7'][] = 'api-createStruct'; +$lang->changelog['15.7'][] = 'api-editStruct'; +$lang->changelog['15.7'][] = 'api-deleteStruct'; +$lang->changelog['15.7'][] = 'api-create'; +$lang->changelog['15.7'][] = 'api-edit'; +$lang->changelog['15.7'][] = 'api-delete'; diff --git a/module/group/lang/en.php b/module/group/lang/en.php index 65ead073b0..563329af9e 100644 --- a/module/group/lang/en.php +++ b/module/group/lang/en.php @@ -63,6 +63,7 @@ $lang->group->copyOptions['copyPriv'] = 'Copy Privileges'; $lang->group->copyOptions['copyUser'] = 'Copy Users'; $lang->group->versions[''] = 'History'; +$lang->group->versions['15_7'] = 'ZenTao15.7'; $lang->group->versions['15_0_rc1'] = 'ZenTao15.0.rc1'; $lang->group->versions['12_5'] = 'ZenTao12.5'; $lang->group->versions['12_3'] = 'ZenTao12.3'; diff --git a/module/group/lang/zh-cn.php b/module/group/lang/zh-cn.php index 9c5070e8e6..92e7e6f6ae 100644 --- a/module/group/lang/zh-cn.php +++ b/module/group/lang/zh-cn.php @@ -63,6 +63,7 @@ $lang->group->copyOptions['copyPriv'] = '复制权限'; $lang->group->copyOptions['copyUser'] = '复制用户'; $lang->group->versions[''] = '修改历史'; +$lang->group->versions['15_7'] = '禅道15.7'; $lang->group->versions['15_0_rc1'] = '禅道15.0.rc1'; $lang->group->versions['12_5'] = '禅道12.5'; $lang->group->versions['12_3'] = '禅道12.3'; diff --git a/module/group/lang/zh-tw.php b/module/group/lang/zh-tw.php index 505afa10c2..a6b3dff1ba 100644 --- a/module/group/lang/zh-tw.php +++ b/module/group/lang/zh-tw.php @@ -63,6 +63,7 @@ $lang->group->copyOptions['copyPriv'] = '複製權限'; $lang->group->copyOptions['copyUser'] = '複製用戶'; $lang->group->versions[''] = '修改歷史'; +$lang->group->versions['15_7'] = '禪道15.7'; $lang->group->versions['15_0_rc1'] = '禪道15.0.rc1'; $lang->group->versions['12_5'] = '禪道12.5'; $lang->group->versions['12_3'] = '禪道12.3'; diff --git a/module/group/model.php b/module/group/model.php index db27dc620c..32f14009c9 100644 --- a/module/group/model.php +++ b/module/group/model.php @@ -381,10 +381,11 @@ class groupModel extends model /* Update whitelist. */ $this->loadModel('personnel'); - $users = $this->getUserPairs($groupID); - $users = array_keys($users); + $users = $this->getUserPairs($groupID); + $users = array_keys($users); + $objectTypes = array_reverse($this->config->group->acl->objectTypes); //Adjust the order of object types, because execution is subordinate to the whitelist of projects, as well as products to programs. - foreach($this->config->group->acl->objectTypes as $key => $objectType) + foreach($objectTypes as $key => $objectType) { $oldAcls = isset($oldGroup->acl[$key]) ? $oldGroup->acl[$key] : array(); $newAcls = isset($actions[$key]) ? $actions[$key] : array(); @@ -456,7 +457,9 @@ class groupModel extends model $acl = json_decode($acl); $this->loadModel('personnel'); - foreach($this->config->group->acl->objectTypes as $key => $objectType) + $objectTypes = array_reverse($this->config->group->acl->objectTypes); //Adjust the order of object types, because execution is subordinate to the whitelist of projects, as well as products to programs. + + foreach($objectTypes as $key => $objectType) { if(!isset($acl->{$key})) continue; foreach($acl->{$key} as $objectID) diff --git a/module/story/model.php b/module/story/model.php index 17b8fd376b..90cc985186 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2478,7 +2478,7 @@ class storyModel extends model $story->planTitle = ''; $storyPlans = explode(',', trim($story->plan, ',')); foreach($storyPlans as $planID) $story->planTitle .= zget($plans, $planID, '') . ' '; - $stories[] = $story; + $stories[$story->id] = $story; } return $stories; } diff --git a/module/upgrade/model.php b/module/upgrade/model.php index fd0fb2e297..48da796885 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -723,6 +723,7 @@ class upgradeModel extends model $this->appendExec('15_5'); case '15_6': $this->saveLogs('Execute 15_6'); + $this->execSQL($this->getUpgradeFile('15.6')); $this->appendExec('15_6'); } @@ -927,7 +928,7 @@ class upgradeModel extends model $confirmContent .= file_get_contents($xuanxuanSql); } case '15_5': $confirmContent .= file_get_contents($this->getUpgradeFile('15.5')); - case '15_6': + case '15_6': $confirmContent .= file_get_contents($this->getUpgradeFile('15.6')); } return str_replace('zt_', $this->config->db->prefix, $confirmContent); } diff --git a/test/api/testcases/delete.php b/test/api/testcases/delete.php new file mode 100644 index 0000000000..6603df589a --- /dev/null +++ b/test/api/testcases/delete.php @@ -0,0 +1,28 @@ +#!/usr/bin/env php +> {"message":"success"} +使用不存在的用例id删除用例 >> {"message":"success"} +查询已删除的用例信息 >> 这个是测试用例1,1 + +*/ +global $token; +$header = array('Token' => $token->token); + +$deleteExist = $rest->delete('/testcases/1', $header); +$deleteNotExist = $rest->delete('/testcases/10001', $header); + +r($deleteExist) && c(200) && p() && e('{"message":"success"}'); // 使用正确用例id删除用例 +r($deleteNotExist) && c(200) && p() && e('{"message":"success"}'); // 使用不存在的用例id删除用例 + +$existCase = $rest->get('/testcases/1', $header); +$existCase->body = array($existCase->body); + +r($existCase) && c(200) && p('title,deleted') && e('这个是测试用例1,1'); // 查询已删除的用例信息 diff --git a/test/api/testcases/getbyid.php b/test/api/testcases/getbyid.php new file mode 100644 index 0000000000..d8c3bf81bc --- /dev/null +++ b/test/api/testcases/getbyid.php @@ -0,0 +1,25 @@ +#!/usr/bin/env php +> 这个是测试用例100 +使用不存在的用例id查询用例详情 >> 404 Not found + +*/ +global $token; +$header = array('Token' => $token->token); + +$existCase = $rest->get('/testcases/100', $header); +$noCase = $rest->get('/testcases/100001', $header); + +$existCase->body = array($existCase->body); +$noCase->body = array($noCase->body); + +r($existCase) && c(200) && p('title') && e('这个是测试用例100'); // 使用正确用例id查询用例详情 +r($noCase) && c(404) && p('error') && e('404 Not found'); // 使用不存在的用例id查询用例详情 diff --git a/test/api/testcases/getlist.php b/test/api/testcases/getlist.php new file mode 100644 index 0000000000..4ba8977926 --- /dev/null +++ b/test/api/testcases/getlist.php @@ -0,0 +1,33 @@ +#!/usr/bin/env php +> 200 +使用不存在的产品id查询用例列表的状态码 >> 200 +使用正确产品id获取用例列表的数量 >> 50 +使用不存在的产品id获取用例列表的数量 >> 0 +使用正确产品id获取用例列表 >> 这个是测试用例51,这个是测试用例52 + +*/ +global $token; +$header = array('Token' => $token->token); + +$existProductCases = $rest->get('/products/2/testcases?page=1&limit=100&order=id_asc', $header); +$noProductCases = $rest->get('/products/1000/testcases?page=1&limit=10&order=id_asc', $header); + +r($existProductCases->status_code) && p() && e('200'); // 使用正确产品id查询用例列表的状态码 +r($noProductCases->status_code) && p() && e('200'); // 使用不存在的产品id查询用例列表的状态码 + +$existCases = $existProductCases->body->testcases; +$emptyCases = $noProductCases->body->testcases; + +r(count($existCases)) && p() && e('50'); // 使用正确产品id获取用例列表的数量 +r(count($emptyCases)) && p() && e('0'); // 使用不存在的产品id获取用例列表的数量 + +r($existCases) && p('title') && e('这个是测试用例51,这个是测试用例52,这个是测试用例53,这个是测试用例54,这个是测试用例55,这个是测试用例56,这个是测试用例57,这个是测试用例58,这个是测试用例59,这个是测试用例60,这个是测试用例61,这个是测试用例62,这个是测试用例63,这个是测试用例64,这个是测试用例65,这个是测试用例66,这个是测试用例67,这个是测试用例68,这个是测试用例69,这个是测试用例70,这个是测试用例71,这个是测试用例72,这个是测试用例73,这个是测试用例74,这个是测试用例75,这个是测试用例76,这个是测试用例77,这个是测试用例78,这个是测试用例79,这个是测试用例80,这个是测试用例81,这个是测试用例82,这个是测试用例83,这个是测试用例84,这个是测试用例85,这个是测试用例86,这个是测试用例87,这个是测试用例88,这个是测试用例89,这个是测试用例90,这个是测试用例91,这个是测试用例92,这个是测试用例93,这个是测试用例94,这个是测试用例95,这个是测试用例96,这个是测试用例97,这个是测试用例98,这个是测试用例99,这个是测试用例100'); // 使用正确产品id获取用例列表 diff --git a/test/data/case.yaml b/test/data/case.yaml new file mode 100644 index 0000000000..b6ee0ed499 --- /dev/null +++ b/test/data/case.yaml @@ -0,0 +1,146 @@ +title: table zt_case +desc: "测试用例" +author: automated export +version: "1.0" +fields: + - field: id + note: "ID" + range: 1-10000 + - field: product + note: "产品ID" + range: 1-180{50},0{1000} + - field: branch + note: "分支ID" + range: 0 + - field: execution + note: "执行ID" + range: 0 + - field: lib + note: "所属库" + range: 0{9000},1-10{100} + - field: module + note: "所属模块" + range: 0 + - field: path + note: "" + range: "0" + - field: story + note: "相关需求" + range: "0" + - field: storyVersion + note: "需求版本" + range: "1" + - field: title + note: "用例标题" + range: "1-10000" + prefix: "这个是测试用例" + - field: precondition + note: "前置条件" + range: "1-10000" + prefix: "这是前置条件" + - field: keywords + note: "关键词" + range: "1-10000" + prefix: "这是关键词" + - field: pri + note: "优先级" + range: 1-4 + - field: type + note: "用例类型" + range: feature,performance,config,install,security,interface,other + - field: auto + note: "是否是自动化测试用例" + range: "no" + - field: frame + note: "自动化测试框架" + range: "" + - field: stage + note: "适用阶段" + range: unittest,feature,intergrate,system,smoke,bvt + - field: howRun + note: "测试方式" + range: "" + - field: scriptedBy + note: "脚本由谁创建" + range: "" + - field: scriptedDate + note: "脚本创建日期" + from: common.date.v1.yaml + use: dateB + - field: scriptStatus + note: "脚本状态" + range: "" + - field: scriptLocation + note: "脚本地址" + range: "" + - field: status + note: "用例状态" + range: wait,normal,blocked,investigate + - field: subStatus + note: "子状态" + range: "" + - field: color + note: "标题颜色" + from: common.color.v1.yaml + use: color + - field: frequency + note: "使用频率" + range: 1-3 + - field: order + note: "排序" + range: 1-500:5 + - field: openedBy + note: "由谁创建" + range: 1-100 + prefix: "test" + - field: openedDate + note: "创建日期" + range: "-:600" + type: timestamp + format: "YYYY-MM-DD hh:mm:ss" + - field: reviewedBy + note: "由谁评审" + range: admin + - field: reviewedDate + note: "评审时间" + range: "-:300" + type: timestamp + format: "YYYY-MM-DD hh:mm:ss" + - field: lastEditedBy + note: "最后修改者" + range: admin + - field: lastEditedDate + note: "修改日期" + range: "-:300" + type: timestamp + format: "YYYY-MM-DD hh:mm:ss" + - field: version + note: "用例版本" + range: "1" + - field: linkCase + note: "相关用例" + range: 0 + - field: fromBug + note: "来源Bug" + range: 0 + - field: fromCaseID + note: "" + range: 0 + - field: fromCaseVersion + note: "" + range: 1 + - field: deleted + note: "是否删除" + range: 0{9950},1{50} + - field: lastRunner + note: "执行人" + range: 1-100 + prefix: "test" + - field: lastRunDate + note: "执行时间" + range: "-:500" + type: timestamp + format: "YYYY-MM-DD hh:mm:ss" + - field: lastRunResult + note: "结果" + range: [pass,fail] diff --git a/test/data/zentao/config.php b/test/data/zentao/config.php index 8080e22c3e..41723fbf8e 100644 --- a/test/data/zentao/config.php +++ b/test/data/zentao/config.php @@ -26,3 +26,5 @@ $builder->release = array('rows' => 8, 'data' => array('release')); $builder->blockDefault = array('rows' => 150, 'data' => array('block', 'blockdefault')); $builder->blockRandom = array('rows' => 120, 'data' => array('block', 'blockrandom')); $builder->projectProduct = array('rows' => 21, 'data' => array('projectproduct')); + +$builder->case = array('rows' => 10000, 'data' => array('case')); diff --git a/test/data/zt_case.yaml b/test/data/zt_case.yaml deleted file mode 100644 index dd975ebc16..0000000000 --- a/test/data/zt_case.yaml +++ /dev/null @@ -1,302 +0,0 @@ -title: table zt_case -desc: "测试用例" -author: automated export -version: "1.0" -fields: - - field: id - note: "ID" - range: "1-10000" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: product - note: "产品ID" - range: "1-10000" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: branch - note: "分支ID" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: lib - note: "所属库" - range: "0-1:R" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: module - note: "所属模块" - range: "1-10000" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: path - note: "" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: story - note: "相关需求" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: storyVersion - note: "需求版本" - range: "1" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: title - note: "用例标题" - range: "1-10000" - prefix: "这个是测试用例" - postfix: "" - loop: 0 - format: "" - - field: precondition - note: "前置条件" - range: "1-10000" - prefix: "这是前置条件" - postfix: "" - loop: 0 - format: "" - - field: keywords - note: "关键词" - range: "1-10000" - prefix: "这是关键词" - postfix: "" - loop: 0 - format: "" - - field: pri - note: "优先级" - range: 1-4 - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: type - note: "用例类型" - range: feature,performance,config,install,security,interface,other - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: auto - range: "no" - note: "" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: frame - note: "" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: stage - note: "适用阶段" - range: unittest,feature,intergrate,system,smoke,bvt - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: howRun - note: "" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: scriptedBy - note: "" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: scriptedDate - note: "" - from: common.date.v1.yaml - use: dateB - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: scriptStatus - note: "" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: scriptLocation - note: "" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: status - note: "用例状态" - range: wait,normal,blocked,investigate - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: subStatus - note: "子状态" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: color - note: "标题颜色" - from: common.color.v1.yaml - use: color - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: frequency - note: "" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: order - note: "排序" - range: "1-100:5" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: openedBy - note: "由谁创建" - from: common.user.v1.yaml - use: user - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: openedDate - note: "创建日期" - from: common.date.v1.yaml - use: dateA - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: reviewedBy - note: "由谁评审" - from: common.user.v1.yaml - use: user - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: reviewedDate - note: "评审时间" - prefix: "" - from: common.date.v1.yaml - use: dateA - postfix: "" - loop: 0 - format: "" - - field: lastEditedBy - note: "最后修改者" - from: common.user.v1.yaml - use: user - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: lastEditedDate - note: "修改日期" - from: common.date.v1.yaml - use: dateA - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: version - note: "用例版本" - range: "1" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: linkCase - note: "相关用例" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: fromBug - note: "来源Bug" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: fromCaseID - note: "" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: fromCaseVersion - note: "" - range: "0" - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: deleted - note: "是否删除" - range: "0" - prefix: "0" - postfix: "" - loop: 0 - format: "" - - field: lastRunner - note: "执行人" - from: common.user.v1.yaml - use: user - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: lastRunDate - note: "执行时间" - from: common.date.v1.yaml - use: dateA - prefix: "" - postfix: "" - loop: 0 - format: "" - - field: lastRunResult - note: "结果" - range: "pass,0" - prefix: "" - postfix: "" - loop: 0 - format: "" diff --git a/test/lib/init.php b/test/lib/init.php index 1197056ab9..1c882b7541 100644 --- a/test/lib/init.php +++ b/test/lib/init.php @@ -84,7 +84,7 @@ function r($result) * @access public * @return void */ -function p($key, $delimiter = ',') +function p($key = '', $delimiter = ',') { global $_result; echo ">> "; diff --git a/test/lib/rest.php b/test/lib/rest.php index 9ad46d94f1..94ad48c494 100644 --- a/test/lib/rest.php +++ b/test/lib/rest.php @@ -90,7 +90,7 @@ class rest $headers['Accept'] = 'application/json'; $headers['Content-Type'] = 'application/json'; - $resp = requests::put($this->base . $url, $headers, $data, $options); + $resp = requests::put($this->base . $url, $headers, $data, $options = array()); try { $resp->body = json_decode($resp->body);