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

29 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
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
/**
title=测试 repoModel::updateCommitDate();
timeout=0
cid=18112
- 步骤1更新Gitlab版本库属性lastCommit @2023-12-23 11:39:02
- 步骤2更新Gitea版本库属性lastCommit @~~
- 步骤3不存在的版本库ID @return empty
- 步骤4SVN版本库不在同步范围属性name @testSvn
- 步骤5无效的版本库ID0 @return empty
*/
zenData('repo')->loadYaml('repo')->gen(5);
$repo = new repoModelTest();
r($repo->updateCommitDateTest(1)) && p('lastCommit') && e('2023-12-23 11:39:02'); // 步骤1更新Gitlab版本库
r($repo->updateCommitDateTest(3)) && p('lastCommit') && e('~~'); // 步骤2更新Gitea版本库
r($repo->updateCommitDateTest(999)) && p() && e('return empty'); // 步骤3不存在的版本库ID
r($repo->updateCommitDateTest(4)) && p('name') && e('testSvn'); // 步骤4SVN版本库不在同步范围
r($repo->updateCommitDateTest(0)) && p() && e('return empty'); // 步骤5无效的版本库ID0