+ Move unit test from test directory to each module.

This commit is contained in:
zhouxin
2023-04-24 02:16:47 +00:00
parent 8b32e6592a
commit 4efea42989
1671 changed files with 83077 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 2) . '/testtask.class.php';
su('admin');
/**
title=测试 testtaskModel->getLinkableCasesByBug();
cid=1
pid=1
通过测试单1关联的版本下的Bug,获取可关联到测试单1的用例数量 >> 0
通过测试单2关联的版本下的Bug,获取可关联到测试单2的用例数量 >> 0
*/
global $tester;
$tester->loadModel('testtask');
$tester->app->loadClass('pager', $static = true);
$task1 = $tester->testtask->getById(1);
$task2 = $tester->testtask->getById(2);
$pager = new pager(0, 10, 1);
$cases1 = $tester->testtask->getLinkableCasesByBug(1, $task1, '1 = 1', '', $pager);
$cases2 = $tester->testtask->getLinkableCasesByBug(2, $task2, '1 = 1', '', $pager);
r(count($cases1)) && p() && e('0'); // 通过测试单1关联的版本下的Bug,获取可关联到测试单1的用例数量
r(count($cases2)) && p() && e('0'); // 通过测试单2关联的版本下的Bug,获取可关联到测试单2的用例数量