znt/module/execution/test/tao/gettaskgroups.php

31 lines
1.3 KiB
PHP
Raw Permalink Normal View History

#!/usr/bin/env php
<?php
/**
title=测试 executionTao::getTaskGroups();
timeout=0
cid=16394
- 测试步骤1查询包含任务的执行ID返回任务分组结构 @1
- 测试步骤2查询不存在任务的执行ID应返回空数组 @0
- 测试步骤3查询无效执行ID(0),应返回空数组 @0
- 测试步骤4查询负数执行ID应返回空数组 @0
- 测试步骤5测试方法正常调用无异常 @1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/tao.class.php';
zenData('task')->gen(100);
su('admin');
$executionTest = new executionTaoTest();
r(count($executionTest->getTaskGroupsTest(103))) && p() && e('1'); // 测试步骤1查询包含任务的执行ID返回任务分组结构
r(count($executionTest->getTaskGroupsTest(999))) && p() && e('0'); // 测试步骤2查询不存在任务的执行ID应返回空数组
r(count($executionTest->getTaskGroupsTest(0))) && p() && e('0'); // 测试步骤3查询无效执行ID(0),应返回空数组
r(count($executionTest->getTaskGroupsTest(-1))) && p() && e('0'); // 测试步骤4查询负数执行ID应返回空数组
r(is_array($executionTest->getTaskGroupsTest(103))) && p() && e('1'); // 测试步骤5测试方法正常调用无异常