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

39 lines
1.3 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::updateCommitCount();
timeout=0
cid=18111
- 测试步骤1正常更新版本库提交计数
- 属性id @1
- 属性commits @100
- 测试步骤2更新提交计数为0
- 属性id @2
- 属性commits @0
- 测试步骤3更新提交计数为极大值
- 属性id @3
- 属性commits @999999
- 测试步骤4更新不存在的版本库ID @0
- 测试步骤5更新另一个版本库的提交计数
- 属性id @4
- 属性commits @1000
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
zenData('repo')->loadYaml('repo')->gen(5);
su('admin');
$repoTest = new repoModelTest();
r($repoTest->updateCommitCountTest(1, 100)) && p('id,commits') && e('1,100'); // 测试步骤1正常更新版本库提交计数
r($repoTest->updateCommitCountTest(2, 0)) && p('id,commits') && e('2,0'); // 测试步骤2更新提交计数为0
r($repoTest->updateCommitCountTest(3, 999999)) && p('id,commits') && e('3,999999'); // 测试步骤3更新提交计数为极大值
r($repoTest->updateCommitCountTest(999, 50)) && p() && e('0'); // 测试步骤4更新不存在的版本库ID
r($repoTest->updateCommitCountTest(4, 1000)) && p('id,commits') && e('4,1000'); // 测试步骤5更新另一个版本库的提交计数