znt/module/repo/test/model/getgitlabgroups.php

31 lines
1.2 KiB
PHP
Executable file
Raw Permalink 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
/**
title=测试 repoModel::getGitlabGroups();
timeout=0
cid=18060
- 步骤1正常gitlabID查询群组第0条的text属性 @GitLab Instance
- 步骤2验证群组数据结构第0条的value属性 @2
- 步骤3无效gitlabID查询 @0
- 步骤4边界值gitlabID查询 @0
- 步骤5验证群组数量统计 @3
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
zenData('pipeline')->gen(5);
su('admin');
$repoTest = new repoModelTest();
r($repoTest->getGitlabGroupsTest(1)) && p('0:text') && e('GitLab Instance'); // 步骤1正常gitlabID查询群组
r($repoTest->getGitlabGroupsTest(1)) && p('0:value') && e('2'); // 步骤2验证群组数据结构
r(count($repoTest->getGitlabGroupsTest(0))) && p('') && e('0'); // 步骤3无效gitlabID查询
r(count($repoTest->getGitlabGroupsTest(-1))) && p('') && e('0'); // 步骤4边界值gitlabID查询
r(count($repoTest->getGitlabGroupsTest(1))) && p('') && e('3'); // 步骤5验证群组数量统计