From 2e17f47723deec08f868e4169eabe8f9b005a95d Mon Sep 17 00:00:00 2001 From: tianshujie Date: Mon, 29 Aug 2022 10:39:27 +0800 Subject: [PATCH] * Add case of execution modules. --- test/class/execution.class.php | 25 +++++++++++++++++++ test/model/execution/getlimitedexecution.php | 19 ++++++++++++++ .../execution/gettaskgroupbyexecution.php | 23 +++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100755 test/model/execution/getlimitedexecution.php create mode 100755 test/model/execution/gettaskgroupbyexecution.php diff --git a/test/class/execution.class.php b/test/class/execution.class.php index 8f79831e79..aebe19b01d 100644 --- a/test/class/execution.class.php +++ b/test/class/execution.class.php @@ -748,6 +748,18 @@ class executionTest } } + /** + * Check the privilege. + * + * @access public + * @return string|bool + */ + public function getLimitedExecutionTest() + { + $this->objectModel->getProductGroupList(); + return isset($_SESSION['limitedExecutions']) ? $_SESSION['limitedExecutions'] : true; + } + /** * function getProductGroupList test execution * @@ -812,6 +824,19 @@ class executionTest } } + /** + * Get the task data group by execution id list. + * + * @param array $executionIdList + * @access public + * @return int + */ + public function getTaskGroupByExecutionTest($executionIdList = array()) + { + $objects = $this->objectModel->getTaskGroupByExecution($executionIdList); + return count($objects); + } + /** * function getDefaultManagers test by execution * diff --git a/test/model/execution/getlimitedexecution.php b/test/model/execution/getlimitedexecution.php new file mode 100755 index 0000000000..a1e731eece --- /dev/null +++ b/test/model/execution/getlimitedexecution.php @@ -0,0 +1,19 @@ +#!/usr/bin/env php +getLimitedExecution(); +cid=1 +pid=1 + +获取所有受限制的执行ID >> 1 + +*/ + +$execution = new executionTest(); + +r($execution->getLimitedExecutionTest()) && p() && e('1'); // 获取所有受限制的执行ID diff --git a/test/model/execution/gettaskgroupbyexecution.php b/test/model/execution/gettaskgroupbyexecution.php new file mode 100755 index 0000000000..009da48eb8 --- /dev/null +++ b/test/model/execution/gettaskgroupbyexecution.php @@ -0,0 +1,23 @@ +#!/usr/bin/env php +getTaskGroupByExecution(); +cid=1 +pid=1 + +获取所有受限制的执行ID >> 1 + +*/ + + +$executionIdList = array(0, 1, 101, 131, 161); + +$execution = new executionTest(); + +r($execution->getTaskGroupByExecutionTest()) && p() && e('0'); // 测试空数据 +r($execution->getTaskGroupByExecutionTest($executionIdList)) && p() && e('3'); // 测试获取执行的任务