* Add New unit testing module, method deletecasebysuiteid.
This commit is contained in:
@@ -415,6 +415,6 @@ class testsuiteModel extends model
|
||||
*/
|
||||
public function deleteCaseBySuiteID(array $cases, int $suiteID)
|
||||
{
|
||||
$this->dao->delete()->from(TABLE_SUITECASE)->where('`case`')->in($cases)->andWhere('`suite`')->eq($suiteID)->exec();
|
||||
return $this->dao->delete()->from(TABLE_SUITECASE)->where('`case`')->in($cases)->andWhere('`suite`')->eq($suiteID)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
zdTable('suitecase')->gen(3);
|
||||
zdTable('testsuite')->gen(1);
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->deleteCaseBySuiteIDTest();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试suiteID值为1,$cases=array(1, 2) >> 2
|
||||
|
||||
*/
|
||||
$suiteID = 1;
|
||||
$cases = array(1, 2);
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->deleteCaseBySuiteIDTest($cases, $suiteID)) && p() && e('2'); //测试suiteID值为1
|
||||
@@ -8,7 +8,7 @@ zdTable('testsuite')->gen(1);
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->delete();
|
||||
title=测试 testsuiteModel->deleteSuiteByID();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
@@ -12,17 +12,17 @@ cid=1
|
||||
pid=1
|
||||
|
||||
测试productID为1,name正常存在,type为private >> type,public,private
|
||||
测试productID为1,name为空,type为private >> 『名称』不能为空。
|
||||
测试productID为1,name为空,type为private >> 『套件名称』不能为空。
|
||||
测试productID为1,name正常存在,type为public >> type,private,public
|
||||
测试productID为1,name为空,type为public >> 『名称』不能为空。
|
||||
测试productID为1,name为空,type为public >> 『套件名称』不能为空。
|
||||
测试productID为1,name正常存在,type为空 >> type,public,
|
||||
测试productID为1,name为空,type为空 >> 『名称』不能为空。
|
||||
测试productID为1,name为空,type为空 >> 『套件名称』不能为空。
|
||||
测试productID为0,name正常存在,type为private >> 0
|
||||
测试productID为0,name为空,type为private >> 『名称』不能为空。
|
||||
测试productID为0,name为空,type为private >> 『套件名称』不能为空。
|
||||
测试productID为0,name正常存在,type为public >> 0
|
||||
测试productID为0,name为空,type为public >> 『名称』不能为空。
|
||||
测试productID为0,name为空,type为public >> 『套件名称』不能为空。
|
||||
测试productID为0,name正常存在,type为空 >> 0
|
||||
测试productID为0,name为空,type为空 >> 『名称』不能为空。
|
||||
测试productID为0,name为空,type为空 >> 『套件名称』不能为空。
|
||||
|
||||
*/
|
||||
$productID = array(1, 0);
|
||||
|
||||
@@ -245,4 +245,18 @@ class testsuiteTest
|
||||
if(dao::isError()) return dao::getError();
|
||||
return $isClickable ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试根据套件id删除关联的用例。
|
||||
* Test delete case by suiteID.
|
||||
*
|
||||
* @param int $cases
|
||||
* @param int $suiteID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function deleteCaseBySuiteIDTest($cases, $suiteID)
|
||||
{
|
||||
return $this->objectModel->deleteCaseBySuiteID($cases, $suiteID);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user