diff --git a/module/execution/test/zen/buildexecutionforcreate.php b/module/execution/test/zen/buildexecutionforcreate.php new file mode 100755 index 0000000000..4b4a6a63e6 --- /dev/null +++ b/module/execution/test/zen/buildexecutionforcreate.php @@ -0,0 +1,71 @@ +#!/usr/bin/env php +loadYaml('project_buildexecutionforcreate', false, 2)->gen(10); +zenData('user')->gen(5); + +su('admin'); + +$executionzenTest = new executionZenTest(); + +unset($_POST); +r($executionzenTest->buildExecutionForCreateTest()) && p('project') && e('所属项目不能为空。'); + +$_POST['project'] = 1; +$_POST['name'] = '测试执行1'; +$_POST['code'] = 'TEST001'; +$_POST['begin'] = '2024-01-01'; +$_POST['end'] = '2024-06-30'; +$_POST['acl'] = 'private'; +$_POST['heightType'] = 'default'; +$_POST['displayCards'] = 5; +r($executionzenTest->buildExecutionForCreateTest()) && p('openedBy') && e('admin'); + +$_POST['project'] = 2; +$_POST['name'] = '测试执行2'; +$_POST['code'] = 'TEST002'; +$_POST['parent'] = 2; +$_POST['begin'] = '2024-02-01'; +$_POST['end'] = '2024-05-31'; +$_POST['acl'] = 'private'; +$_POST['heightType'] = 'default'; +$_POST['displayCards'] = 5; +r($executionzenTest->buildExecutionForCreateTest()) && p('parent') && e('2'); + +$_POST['project'] = 3; +$_POST['name'] = '测试执行3'; +$_POST['code'] = 'TEST003'; +$_POST['begin'] = '2024-03-01'; +$_POST['end'] = '2024-08-31'; +$_POST['acl'] = 'open'; +$_POST['heightType'] = 'default'; +$_POST['displayCards'] = 5; +unset($_POST['parent']); +r($executionzenTest->buildExecutionForCreateTest()) && p('whitelist') && e(''); + +$_POST['project'] = 4; +$_POST['name'] = '测试执行4'; +$_POST['code'] = 'TEST004'; +$_POST['begin'] = '2024-04-01'; +$_POST['end'] = '2024-09-30'; +$_POST['acl'] = 'private'; +$_POST['heightType'] = 'auto'; +$_POST['displayCards'] = 10; +r($executionzenTest->buildExecutionForCreateTest()) && p('displayCards') && e('0'); \ No newline at end of file