znt/module/testtask/test/zen/buildtaskforimportunitresult.php

30 lines
1.2 KiB
PHP
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env php
<?php
/**
title=测试 testtaskZen::buildTaskForImportUnitResult();
cid=19230
- 测试步骤1正常产品ID测试 >> 期望返回构建的任务对象
- 测试步骤2空产品ID测试 >> 期望返回构建的任务对象
- 测试步骤3不存在的产品ID测试 >> 期望返回构建的任务对象
- 测试步骤4大产品ID测试 >> 期望返回构建的任务对象
- 测试步骤5验证必须字段设置 >> 期望product、auto字段正确设置
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/testtaskzen.unittest.class.php';
zenData('product')->loadYaml('product', false, 2)->gen(10);
su('admin');
$testtaskZenTest = new testtaskZenTest();
r($testtaskZenTest->buildTaskForImportUnitResultTest(1)) && p('product,auto') && e('1,unit');
r($testtaskZenTest->buildTaskForImportUnitResultTest(0)) && p('product,auto') && e('0,unit');
r($testtaskZenTest->buildTaskForImportUnitResultTest(999)) && p('product,auto') && e('999,unit');
r($testtaskZenTest->buildTaskForImportUnitResultTest(5)) && p('product,auto,name') && e('5,unit,JUnit测试导入');
r($testtaskZenTest->buildTaskForImportUnitResultTest(1)) && p('product,auto') && e('1,unit');