+ 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
@@ -0,0 +1,31 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
su('admin');
/**
title=测试 testtaskModel->getDataOfTestTaskPerRunResult();
cid=1
pid=1
获取测试单0的执行结果 >> 0
获取测试单1的成功执行结果 >> 2
获取测试单1的失败执行结果 >> 2
获取测试单2的成功执行结果 >> 2
获取测试单2的失败执行结果 >> 2
*/
global $tester;
$tester->loadModel('testtask');
$result0 = $tester->testtask->getDataOfTestTaskPerRunResult(0);
$result1 = $tester->testtask->getDataOfTestTaskPerRunResult(1);
$result2 = $tester->testtask->getDataOfTestTaskPerRunResult(2);
r($result0) && p() && e('0'); // 获取测试单0的执行结果
r($result1) && p('pass:value') && e('2'); // 获取测试单1的成功执行结果
r($result1) && p('fail:value') && e('2'); // 获取测试单1的失败执行结果
r($result2) && p('pass:value') && e('2'); // 获取测试单2的成功执行结果
r($result2) && p('fail:value') && e('2'); // 获取测试单2的失败执行结果