* Modify.
This commit is contained in:
@@ -500,9 +500,12 @@ class apiModel extends model
|
||||
public function getStructListByRelease($release, $where = '1 = 1 ', $orderBy = 'id')
|
||||
{
|
||||
$strJoin = array();
|
||||
foreach($release->snap['structs'] as $struct)
|
||||
if(isset($release->snap['structs']))
|
||||
{
|
||||
$strJoin[] = "(object.id = {$struct['id']} and spec.version = {$struct['version']} )";
|
||||
foreach($release->snap['structs'] as $struct)
|
||||
{
|
||||
$strJoin[] = "(object.id = {$struct['id']} and spec.version = {$struct['version']} )";
|
||||
}
|
||||
}
|
||||
|
||||
if($strJoin) $where .= 'and (' . implode(' or ', $strJoin) . ')';
|
||||
|
||||
@@ -128,6 +128,7 @@ class apiTest
|
||||
public function getReleaseListByApiTest($libID, $id = 0, $confirm = true)
|
||||
{
|
||||
$objects = $this->objectModel->getReleaseListByApi($libID);
|
||||
a($objects);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
@@ -248,13 +249,4 @@ class apiTest
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
public function createDemoDataTest($name, $baseUrl, $version = '16.0')
|
||||
{
|
||||
$objects = $this->objectModel->createDemoData($name, $baseUrl, $version = '16.0');
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,5 +47,3 @@ r($api->createTest($normalApi)) && p('lib') && e('910');
|
||||
r($api->createTest($emptyLibApi)) && p('lib:0') && e('『API Library』should not be blank.'); //测试没有lib创建api
|
||||
r($api->createTest($emptyTitleApi)) && p('title:0') && e('『Name』should not be blank.'); //测试没有title创建api
|
||||
r($api->createTest($emptyPathApi)) && p('path:0') && e('『Request Path』should not be blank.'); //测试没有path创建api
|
||||
|
||||
//system("./ztest init");
|
||||
|
||||
@@ -33,5 +33,3 @@ $normalStruct->addedDate = helper::now();
|
||||
|
||||
r($api->createStructTest($normalStruct)) && p('name') && e('struct'); //创建数据结构
|
||||
r($api->createStructTest($emptyNameStruct)) && p('name:0') && e('『Name』should not be blank.'); //创建没有结构名的数据结构
|
||||
|
||||
//system("./ztest init");
|
||||
|
||||
@@ -25,5 +25,3 @@ $normalRelease->addedDate = helper::now();
|
||||
$release = $api->publishLibTest($normalRelease, false);
|
||||
|
||||
r($api->deleteReleaseTest($release->id, $release->lib)) && p('') && e('0'); //删除一个创建的发布
|
||||
|
||||
//system("./ztest init");
|
||||
|
||||
@@ -45,4 +45,3 @@ $apiInfo = $api->createTest($normalApi, false);
|
||||
$release = $api->publishLibTest($normalRelease, false);
|
||||
|
||||
r($api->getApiListByReleaseTest($release)) && p('0:lib') && e('910'); //创建api后创建发布,使用发布查找api
|
||||
//system("./ztest init");
|
||||
|
||||
@@ -36,5 +36,3 @@ $normalApi = $data;
|
||||
|
||||
$apiInfo = $api->createTest($normalApi, false);
|
||||
r($api->getLibByIdTest($apiInfo->id)) && p('lib') && e('910'); //获取刚创建的api
|
||||
|
||||
//system("./ztest init");
|
||||
|
||||
@@ -24,5 +24,3 @@ $normalRelease->addedDate = helper::now();
|
||||
|
||||
$release = $api->publishLibTest($normalRelease, false);
|
||||
r($api->getReleaseTest($release->lib)) && p('version') && e('Version1'); //获取刚创建的发布
|
||||
|
||||
//system("./ztest init");
|
||||
|
||||
@@ -24,5 +24,3 @@ $normalRelease->addedDate = helper::now();
|
||||
|
||||
$release = $api->publishLibTest($normalRelease, false);
|
||||
r($api->getReleaseListByApiTest($release->lib, $release->id)) && p("{$release->id}:lib") && e('910'); //获取刚插入的发布信息
|
||||
|
||||
//system("./ztest init");
|
||||
|
||||
@@ -25,5 +25,3 @@ $normalStruct->addedDate = helper::now();
|
||||
|
||||
$struct = $api->createStructTest($normalStruct, false);
|
||||
r($api->getStructByIDTest($struct->id)) && p('name') && e('struct'); //获取刚创建的数据结构
|
||||
|
||||
//system("./ztest init");
|
||||
|
||||
@@ -44,6 +44,5 @@ $normalRelease->addedDate = helper::now();
|
||||
$apiInfo = $api->createTest($normalApi, false);
|
||||
$release = $api->publishLibTest($normalRelease, false);
|
||||
|
||||
r($api->getStructListByReleaseTest()) && p() && e();
|
||||
r($api->getApiListByReleaseTest($release)) && p('0:lib') && e('910'); //创建api后创建发布,使用发布查找api
|
||||
//system("./ztest init");
|
||||
r($api->getStructListByReleaseTest($release->lib)) && p('') && e('');
|
||||
//r($api->getApiListByReleaseTest($release)) && p('0:lib') && e('910'); //创建api后创建发布,使用发布查找api
|
||||
|
||||
@@ -31,5 +31,3 @@ $normalRelease->addedDate = helper::now();
|
||||
|
||||
r($api->publishLibTest($emptyBuildRelease)) && p('version:0') && e('『Version』should not be blank.'); //没有版本名的发布
|
||||
r($api->publishLibTest($normalRelease)) && p('version') && e('Version1'); //正常的发布
|
||||
|
||||
//system("./ztest init");
|
||||
|
||||
@@ -57,5 +57,3 @@ $editApi = $editData;
|
||||
$apiInfo = $api->createTest($normalApi, false);
|
||||
|
||||
r($api->updateTest($apiInfo->id, $editApi)) && p('0:new') && e('edittestapi'); //修改一个刚创建的api
|
||||
|
||||
//system("./ztest init");
|
||||
|
||||
@@ -38,5 +38,3 @@ $emptyNameEditStruct['name'] = '';
|
||||
$struct = $api->createStructTest($normalStruct, false);
|
||||
r($api->updateStructTest($struct->id, $normalEditStruct, false)) && p('0:new') && e('editStruct'); //正常的修改
|
||||
r($api->updateStructTest($struct->id, $emptyNameEditStruct)) && p('name:0') && e('『Name』should not be blank.'); //没有名称的修改
|
||||
|
||||
//system("./ztest init");
|
||||
|
||||
Reference in New Issue
Block a user