Files
EasySoft-ZenTaoPMS/test/model/gitlab/create.php
T
2022-08-05 08:26:59 +08:00

37 lines
962 B
PHP

#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/gitlab.class.php';
su('admin');
/**
title=测试gitlabModel->create();
cid=1
pid=1
GitLab名称为空 >> name
服务器地址为空 >> url
正确GitLab数据 >> GitLab,http://10.0.1.161:58080,1196c85ba525a268570df9da627e3a7b2d
*/
$gitlab = new gitlabTest();
$_POST = array();
$_POST['name'] = '';
$_POST['url'] = 'http://10.0.1.161:51080';
$_POST['token'] = 'y2UBqwPPzaLxsniy8R6A';
$_POST['password'] = '';
r($gitlab->create()) && p() && e('name'); // GitLab名称为空
$_POST['name'] = 'GitLab';
$_POST['url'] = '';
r($gitlab->create()) && p() && e('url'); // 服务器地址为空
$_POST['url'] = 'http://10.0.1.161:51080';
r($gitlab->create()) && p('name,url,token') && e('GitLab,http://10.0.1.161:51080,y2UBqwPPzaLxsniy8R6A'); // 正确GitLab数据
system("./ztest init");