Merge branch 'sprint/285' of https://gitlab.zcorp.cc/easycorp/zentaopms into sprint/285
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel::checkInternet();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
验证网络连接 >> 1
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('admin');
|
||||
$result = (int)$tester->admin->checkInternet();
|
||||
|
||||
r($result) && p() && e('1'); // 验证网络连接
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel::fetchAPI();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
正确的API地址 >> 1
|
||||
错误的API地址 >> 0
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('admin');
|
||||
|
||||
$realURL = 'https://www.zentao.net/publicclass.json';
|
||||
$invalidURL = 'https://test.zentao.net/publicclass.json';
|
||||
|
||||
$result1 = (int)!empty($tester->admin->fetchAPI($realURL));
|
||||
$result2 = (int)$tester->admin->fetchAPI($invalidURL);
|
||||
|
||||
r($result1) && p() && e('1'); // 正确的API地址
|
||||
r($result2) && p() && e('0'); // 错误的API地址
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel::getExtensionsByAPI();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查询断网情况插件数量 >> 3
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('admin');
|
||||
$result = $tester->admin->getExtensionsByAPI('extension', 6, false);
|
||||
|
||||
r(count($result)) && p() && e('3'); // 查询断网情况插件数量
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
|
||||
/**
|
||||
|
||||
title=测试 adminModel::getPublicClassByAPI();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
查询公开课程数量 >> 2
|
||||
|
||||
*/
|
||||
|
||||
global $tester;
|
||||
$tester->loadModel('admin');
|
||||
$result = $tester->admin->getPublicClassByAPI();
|
||||
|
||||
r(count($result)) && p() && e('2'); // 查询公开课程数量
|
||||
Reference in New Issue
Block a user