Files
EasySoft-ZenTaoPMS/module/build/test/model/batchunlinkbug.php
T

30 lines
1.0 KiB
PHP
Executable File
Raw 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=测试 buildModel->batchUnlinkBug();
timeout=0
cid=1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/build.class.php';
$build = zdTable('build')->config('build');
$build->bugs->range('`1,2,3`,`4,5,6`');
$build->gen(5);
zdTable('user')->gen(5);
su('admin');
$buildIdList = array(0, 1, 2, 6);
$bugIdList[0] = array();
$bugIdList[1] = array(1, 2);
$bugIdList[2] = array(4, 5);
$buildTester = new buildTest();
r($buildTester->batchUnlinkBugTest($buildIdList[0], $bugIdList[0])) && p() && e('0'); // 测试buildID=0bug ID 列表为空
r($buildTester->batchUnlinkBugTest($buildIdList[1], $bugIdList[1])) && p('1:id,bugs') && e('1,3'); // 测试buildID=1bug ID 列表为1,2
r($buildTester->batchUnlinkBugTest($buildIdList[2], $bugIdList[2])) && p('2:id,bugs') && e('2,6'); // 测试buildID=2bug ID 列表为4,5
r($buildTester->batchUnlinkBugTest($buildIdList[3], $bugIdList[1])) && p() && e('0'); // 测试buildID不存在,bug ID 列表为1,2