Files
EasySoft-ZenTaoPMS/test/model/api/getstructlistbyrelease.php
宋辰轩 b21e8bf480 * Modify.
2022-05-10 15:21:06 +08:00

49 lines
1.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/api.class.php';
su('admin');
/**
title=测试 apiModel->getStructListByRelease();
cid=1
pid=1
*/
global $tester;
$api = new apiTest();
$data = array(
'lib' => 910,
'module' => 0,
'title' => 'testapi',
'protocol' => 'HTTP',
'method' => 'GET',
'path' => '/api/test/id',
'requestType' => 'application/json',
'status' => 'done',
'owner' => 'admin',
'type' => 'formData',
'params' => '{"header":[],"params":[],"paramsType":"","query":[]}',
'desc' => '',
'paramsExample' => '',
'response' => '[]',
'responseExample' => ''
);
$normalApi = $data;
$normalRelease = new stdclass();
$normalRelease->version = 'Version1';
$normalRelease->desc = '';
$normalRelease->lib = 910;
$normalRelease->addedBy = $tester->app->user->account;
$normalRelease->addedDate = helper::now();
$apiInfo = $api->createTest($normalApi, false);
$release = $api->publishLibTest($normalRelease, false);
r($api->getStructListByReleaseTest($release->lib)) && p('') && e('');
//r($api->getApiListByReleaseTest($release)) && p('0:lib') && e('910'); //创建api后创建发布使用发布查找api