Files
2025-11-14 13:05:25 +08:00

32 lines
1.1 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=测试 gogsModel::apiGetMergeRequests();
timeout=0
cid=16685
- 步骤1:正常的gogsID和项目名称 @0
- 步骤2:无效的gogsID(0) @0
- 步骤3:空的项目名称 @0
- 步骤4:不存在的gogsID(999) @0
- 步骤5:特殊字符的项目名称 @0
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/gogs.unittest.class.php';
zenData('pipeline')->loadYaml('pipeline', false, 2)->gen(7);
zenData('oauth')->loadYaml('oauth')->gen(1);
su('admin');
$gogsTest = new gogsTest();
r($gogsTest->apiGetMergeRequestsTest(5, 'testuser/testrepo')) && p() && e('0'); // 步骤1:正常的gogsID和项目名称
r($gogsTest->apiGetMergeRequestsTest(0, 'testuser/testrepo')) && p() && e('0'); // 步骤2:无效的gogsID(0)
r($gogsTest->apiGetMergeRequestsTest(5, '')) && p() && e('0'); // 步骤3:空的项目名称
r($gogsTest->apiGetMergeRequestsTest(999, 'testuser/testrepo')) && p() && e('0'); // 步骤4:不存在的gogsID(999)
r($gogsTest->apiGetMergeRequestsTest(5, 'test@user/test-repo_1')) && p() && e('0'); // 步骤5:特殊字符的项目名称