Add auto test of testsuite.
This commit is contained in:
@@ -0,0 +1,218 @@
|
||||
<?php
|
||||
class testsuiteTest
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
global $tester;
|
||||
$this->objectModel = $tester->loadModel('testsuite');
|
||||
}
|
||||
|
||||
public function selectTest($products, $productID, $currentModule, $currentMethod, $extra = '')
|
||||
{
|
||||
$objects = $this->objectModel->select($products, $productID, $currentModule, $currentMethod, $extra);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test create a test suite.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $name
|
||||
* @param string $type
|
||||
* @access public
|
||||
* @return array|int
|
||||
*/
|
||||
public function createTest($productID, $name, $type)
|
||||
{
|
||||
$_POST['name'] = $name;
|
||||
$_POST['desc'] = '';
|
||||
$_POST['type'] = $type;
|
||||
$_POST['uid'] = '62538b850bb9d';
|
||||
|
||||
$objects = $this->objectModel->create($productID);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get test suites of a product.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getSuitesTest($productID, $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$objects = $this->objectModel->getSuites($productID, $orderBy, $pager);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get unit suite.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUnitSuitesTest($productID, $orderBy = 'id_desc')
|
||||
{
|
||||
$objects = $this->objectModel->getUnitSuites($productID, $orderBy);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get test suite info by id.
|
||||
*
|
||||
* @param int $suiteID
|
||||
* @param bool $setImgSize
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getByIdTest($suiteID, $setImgSize = false)
|
||||
{
|
||||
$objects = $this->objectModel->getById($suiteID, $setImgSize);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test update a test suite.
|
||||
*
|
||||
* @param int $suiteID
|
||||
* @access public
|
||||
* @return bool|array
|
||||
*/
|
||||
public function updateTest($suiteID, $name, $type)
|
||||
{
|
||||
$_POST['name'] = $name;
|
||||
$_POST['desc'] = '';
|
||||
$_POST['type'] = $type;
|
||||
$_POST['uid'] = '62538b850bb9d';
|
||||
|
||||
$objects = $this->objectModel->update($suiteID);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test link cases.
|
||||
*
|
||||
* @param int $suiteID
|
||||
* @param array $cases
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function linkCaseTest($suiteID, $cases)
|
||||
{
|
||||
$_POST['cases'] = $cases;
|
||||
foreach($cases as $case)
|
||||
{
|
||||
$_POST['versions'][$case] = 1;
|
||||
}
|
||||
|
||||
$this->objectModel->linkCase($suiteID);
|
||||
unset($_POST);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
global $tester;
|
||||
$objects = $tester->dao->select('*')->from(TABLE_SUITECASE)->where('suite')->eq($suiteID)->andWhere('`case`')->in($cases)->fetchAll();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get linked cases for suite.
|
||||
*
|
||||
* @param int $suiteID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @param bool $append
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getLinkedCasesTest($suiteID, $orderBy = 'id_desc', $pager = null, $append = true)
|
||||
{
|
||||
$objects = $this->objectModel->getLinkedCases($suiteID, $orderBy, $pager, $append);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get unlinked cases for suite.
|
||||
*
|
||||
* @param int $suiteID
|
||||
* @param int $param
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getUnlinkedCasesTest($suiteID, $param = 0, $pager = null)
|
||||
{
|
||||
|
||||
$suite = $this->objectModel->getById($suiteID);
|
||||
$objects = $this->objectModel->getUnlinkedCases($suite, $param, $pager);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test delete suite and library.
|
||||
*
|
||||
* @param int $suiteID
|
||||
* @param string $table
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function deleteTest($suiteID, $table = '')
|
||||
{
|
||||
$objects = $this->objectModel->delete($suiteID, $table);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test get not imported cases.
|
||||
*
|
||||
* @param int $productID
|
||||
* @param int $libID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getNotImportedCasesTest($productID, $libID, $orderBy = 'id_desc', $pager = null, $browseType = '', $queryID = 0)
|
||||
{
|
||||
$objects = $this->objectModel->getNotImportedCases($productID, $libID, $orderBy, $pager, $browseType, $queryID);
|
||||
|
||||
if(dao::isError()) return dao::getError();
|
||||
|
||||
return $objects;
|
||||
}
|
||||
}
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->create();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试productID为1,name正常存在,type为private >> 202
|
||||
测试productID为1,name为空,type为private >> 『名称』不能为空。
|
||||
测试productID为1,name正常存在,type为public >> 203
|
||||
测试productID为1,name为空,type为public >> 『名称』不能为空。
|
||||
测试productID为1,name正常存在,type为空 >> 204
|
||||
测试productID为1,name为空,type为空 >> 『名称』不能为空。
|
||||
测试productID为0,name正常存在,type为private >> 205
|
||||
测试productID为0,name为空,type为private >> 『名称』不能为空。
|
||||
测试productID为0,name正常存在,type为public >> 206
|
||||
测试productID为0,name为空,type为public >> 『名称』不能为空。
|
||||
测试productID为0,name正常存在,type为空 >> 207
|
||||
测试productID为0,name为空,type为空 >> 『名称』不能为空。
|
||||
|
||||
*/
|
||||
$productID = array(1, 0);
|
||||
$name = array('这是测试套件名称1000', '');
|
||||
$type = array('private', 'public', '');
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->createTest($productID[0], $name[0], $type[0])) && p() && e('202'); //测试productID为1,name正常存在,type为private
|
||||
r($testsuite->createTest($productID[0], $name[1], $type[0])) && p('name:0') && e('『名称』不能为空。'); //测试productID为1,name为空,type为private
|
||||
r($testsuite->createTest($productID[0], $name[0], $type[1])) && p() && e('203'); //测试productID为1,name正常存在,type为public
|
||||
r($testsuite->createTest($productID[0], $name[1], $type[1])) && p('name:0') && e('『名称』不能为空。'); //测试productID为1,name为空,type为public
|
||||
r($testsuite->createTest($productID[0], $name[0], $type[2])) && p() && e('204'); //测试productID为1,name正常存在,type为空
|
||||
r($testsuite->createTest($productID[0], $name[1], $type[2])) && p('name:0') && e('『名称』不能为空。'); //测试productID为1,name为空,type为空
|
||||
r($testsuite->createTest($productID[1], $name[0], $type[0])) && p() && e('205'); //测试productID为0,name正常存在,type为private
|
||||
r($testsuite->createTest($productID[1], $name[1], $type[0])) && p('name:0') && e('『名称』不能为空。'); //测试productID为0,name为空,type为private
|
||||
r($testsuite->createTest($productID[1], $name[0], $type[1])) && p() && e('206'); //测试productID为0,name正常存在,type为public
|
||||
r($testsuite->createTest($productID[1], $name[1], $type[1])) && p('name:0') && e('『名称』不能为空。'); //测试productID为0,name为空,type为public
|
||||
r($testsuite->createTest($productID[1], $name[0], $type[2])) && p() && e('207'); //测试productID为0,name正常存在,type为空
|
||||
r($testsuite->createTest($productID[1], $name[1], $type[2])) && p('name:0') && e('『名称』不能为空。'); //测试productID为0,name为空,type为空
|
||||
system("./ztest init");
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->delete();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试suiteID值为1 >> 1
|
||||
测试suiteID值为1000 >> 1
|
||||
测试suiteID值为0 >> 1
|
||||
|
||||
*/
|
||||
$suiteID = array(1, 1000, 0);
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->deleteTest($suiteID[0])) && p() && e('1'); //测试suiteID值为1
|
||||
r($testsuite->deleteTest($suiteID[1])) && p() && e('1'); //测试suiteID值为1000
|
||||
r($testsuite->deleteTest($suiteID[2])) && p() && e('1'); //测试suiteID值为0
|
||||
system("./ztest init");
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->getById();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试suiteID值为0,setImgSize值为false >> 0
|
||||
测试suiteID值为1000,setImgSize值为false >> 0
|
||||
测试suiteID值为1,setImgSize值为true >> 1,这是测试套件的描述1
|
||||
测试suiteID值为1,setImgSize值为false >> 1,这是测试套件的描述1
|
||||
|
||||
*/
|
||||
$suiteID = array(0, 1, 1000);
|
||||
$setImgSize = array(true, false);
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->getByIdTest($suiteID[0], $setImgSize[1])) && p() && e('0'); //测试suiteID值为0,setImgSize值为false
|
||||
r($testsuite->getByIdTest($suiteID[2], $setImgSize[1])) && p() && e('0'); //测试suiteID值为1000,setImgSize值为false
|
||||
r($testsuite->getByIdTest($suiteID[1], $setImgSize[0])) && p('id,desc') && e('1,这是测试套件的描述1'); //测试suiteID值为1,setImgSize值为true
|
||||
r($testsuite->getByIdTest($suiteID[1], $setImgSize[1])) && p('id,desc') && e('1,这是测试套件的描述1'); //测试suiteID值为1,setImgSize值为false
|
||||
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->getLinkedCases();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试suiteID值正常存在,orderBy值为id_desc,append值为true >> 2,这个是测试用例2;1,这个是测试用例1
|
||||
测试suiteID值正常存在,orderBy值为id_desc,append值为false >> 2,这个是测试用例2;1,这个是测试用例1
|
||||
测试suiteID值正常存在,orderBy值为id_asc,append值为true >> 1,这个是测试用例1;2,这个是测试用例2
|
||||
测试suiteID值正常存在,orderBy值为id_asc,append值为false >> 1,这个是测试用例1;2,这个是测试用例2
|
||||
测试suiteID值正常存在,orderBy值为title_desc,id_desc,append值为true >> 2,这个是测试用例2;1,这个是测试用例1
|
||||
测试suiteID值正常存在,orderBy值为title_desc,id_desc,append值为false >> 2,这个是测试用例2;1,这个是测试用例1
|
||||
测试suiteID值正常存在,orderBy值为title_asc,id_desc,append值为true >> 1,这个是测试用例1;2,这个是测试用例2
|
||||
测试suiteID值正常存在,orderBy值为title_asc,id_desc,append值为false >> 1,这个是测试用例1;2,这个是测试用例2
|
||||
|
||||
*/
|
||||
$suiteID = 1;
|
||||
$orderBy = array('id_desc', 'id_asc', 'title_desc,id_desc', 'title_asc,id_desc');
|
||||
$append = array(true, false);
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->getLinkedCasesTest($suiteID, $orderBy[0], '', $append[0])) && p('2:id,title;1:id,title') && e('2,这个是测试用例2;1,这个是测试用例1'); //测试suiteID值正常存在,orderBy值为id_desc,append值为true
|
||||
r($testsuite->getLinkedCasesTest($suiteID, $orderBy[0], '', $append[1])) && p('2:id,title;1:id,title') && e('2,这个是测试用例2;1,这个是测试用例1'); //测试suiteID值正常存在,orderBy值为id_desc,append值为false
|
||||
r($testsuite->getLinkedCasesTest($suiteID, $orderBy[1], '', $append[0])) && p('1:id,title;2:id,title') && e('1,这个是测试用例1;2,这个是测试用例2'); //测试suiteID值正常存在,orderBy值为id_asc,append值为true
|
||||
r($testsuite->getLinkedCasesTest($suiteID, $orderBy[1], '', $append[1])) && p('1:id,title;2:id,title') && e('1,这个是测试用例1;2,这个是测试用例2'); //测试suiteID值正常存在,orderBy值为id_asc,append值为false
|
||||
r($testsuite->getLinkedCasesTest($suiteID, $orderBy[2], '', $append[0])) && p('2:id,title;1:id,title') && e('2,这个是测试用例2;1,这个是测试用例1'); //测试suiteID值正常存在,orderBy值为title_desc,id_desc,append值为true
|
||||
r($testsuite->getLinkedCasesTest($suiteID, $orderBy[2], '', $append[1])) && p('2:id,title;1:id,title') && e('2,这个是测试用例2;1,这个是测试用例1'); //测试suiteID值正常存在,orderBy值为title_desc,id_desc,append值为false
|
||||
r($testsuite->getLinkedCasesTest($suiteID, $orderBy[3], '', $append[0])) && p('1:id,title;2:id,title') && e('1,这个是测试用例1;2,这个是测试用例2'); //测试suiteID值正常存在,orderBy值为title_asc,id_desc,append值为true
|
||||
r($testsuite->getLinkedCasesTest($suiteID, $orderBy[3], '', $append[1])) && p('1:id,title;2:id,title') && e('1,这个是测试用例1;2,这个是测试用例2'); //测试suiteID值正常存在,orderBy值为title_asc,id_desc,append值为false
|
||||
Executable
+52
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->getNotImportedCases();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试productID值为1,libID值为0,orderBy值为id_desc >> 0
|
||||
测试productID值为1,libID值为0,orderBy值为id_asc >> 0
|
||||
测试productID值为1,libID值为0,orderBy值为title_desc,id_desc >> 0
|
||||
测试productID值为1,libID值为0,orderBy值为title_asc,id_desc >> 0
|
||||
测试productID值为0,libID值为0,orderBy值为id_desc >> 0
|
||||
测试productID值为0,libID值为0,orderBy值为id_asc >> 0
|
||||
测试productID值为0,libID值为0,orderBy值为title_desc,id_desc >> 0
|
||||
测试productID值为0,libID值为0,orderBy值为title_asc,id_desc >> 0
|
||||
测试productID值为1,libID值为201,orderBy值为id_desc >> 410,用例库用例10;409,用例库用例9
|
||||
测试productID值为1,libID值为201,orderBy值为id_asc >> 401,用例库用例1;402,用例库用例2
|
||||
测试productID值为1,libID值为201,orderBy值为title_desc,id_desc >> 409,用例库用例9;408,用例库用例8
|
||||
测试productID值为1,libID值为201,orderBy值为title_asc,id_desc >> 401,用例库用例1;410,用例库用例10
|
||||
测试productID值为0,libID值为201,orderBy值为id_desc >> 410,用例库用例10;409,用例库用例9
|
||||
测试productID值为0,libID值为201,orderBy值为id_asc >> 401,用例库用例1;402,用例库用例2
|
||||
测试productID值为0,libID值为201,orderBy值为title_desc,id_desc >> 409,用例库用例9;408,用例库用例8
|
||||
测试productID值为0,libID值为201,orderBy值为title_asc,id_desc >> 401,用例库用例1;410,用例库用例10
|
||||
|
||||
*/
|
||||
$productID = array(1, 0);
|
||||
$libID = array(201, 0);
|
||||
$orderBy = array('id_desc', 'id_asc', 'title_desc,id_desc', 'title_asc,id_desc');
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->getNotImportedCasesTest($productID[0], $libID[1], $orderBy[0])) && p() && e('0'); //测试productID值为1,libID值为0,orderBy值为id_desc
|
||||
r($testsuite->getNotImportedCasesTest($productID[0], $libID[1], $orderBy[1])) && p() && e('0'); //测试productID值为1,libID值为0,orderBy值为id_asc
|
||||
r($testsuite->getNotImportedCasesTest($productID[0], $libID[1], $orderBy[2])) && p() && e('0'); //测试productID值为1,libID值为0,orderBy值为title_desc,id_desc
|
||||
r($testsuite->getNotImportedCasesTest($productID[0], $libID[1], $orderBy[3])) && p() && e('0'); //测试productID值为1,libID值为0,orderBy值为title_asc,id_desc
|
||||
r($testsuite->getNotImportedCasesTest($productID[1], $libID[1], $orderBy[0])) && p() && e('0'); //测试productID值为0,libID值为0,orderBy值为id_desc
|
||||
r($testsuite->getNotImportedCasesTest($productID[1], $libID[1], $orderBy[1])) && p() && e('0'); //测试productID值为0,libID值为0,orderBy值为id_asc
|
||||
r($testsuite->getNotImportedCasesTest($productID[1], $libID[1], $orderBy[2])) && p() && e('0'); //测试productID值为0,libID值为0,orderBy值为title_desc,id_desc
|
||||
r($testsuite->getNotImportedCasesTest($productID[1], $libID[1], $orderBy[3])) && p() && e('0'); //测试productID值为0,libID值为0,orderBy值为title_asc,id_desc
|
||||
r($testsuite->getNotImportedCasesTest($productID[0], $libID[0], $orderBy[0])) && p('410:id,title;409:id,title') && e('410,用例库用例10;409,用例库用例9'); //测试productID值为1,libID值为201,orderBy值为id_desc
|
||||
r($testsuite->getNotImportedCasesTest($productID[0], $libID[0], $orderBy[1])) && p('401:id,title;402:id,title') && e('401,用例库用例1;402,用例库用例2'); //测试productID值为1,libID值为201,orderBy值为id_asc
|
||||
r($testsuite->getNotImportedCasesTest($productID[0], $libID[0], $orderBy[2])) && p('409:id,title;408:id,title') && e('409,用例库用例9;408,用例库用例8'); //测试productID值为1,libID值为201,orderBy值为title_desc,id_desc
|
||||
r($testsuite->getNotImportedCasesTest($productID[0], $libID[0], $orderBy[3])) && p('401:id,title;410:id,title') && e('401,用例库用例1;410,用例库用例10'); //测试productID值为1,libID值为201,orderBy值为title_asc,id_desc
|
||||
r($testsuite->getNotImportedCasesTest($productID[1], $libID[0], $orderBy[0])) && p('410:id,title;409:id,title') && e('410,用例库用例10;409,用例库用例9'); //测试productID值为0,libID值为201,orderBy值为id_desc
|
||||
r($testsuite->getNotImportedCasesTest($productID[1], $libID[0], $orderBy[1])) && p('401:id,title;402:id,title') && e('401,用例库用例1;402,用例库用例2'); //测试productID值为0,libID值为201,orderBy值为id_asc
|
||||
r($testsuite->getNotImportedCasesTest($productID[1], $libID[0], $orderBy[2])) && p('409:id,title;408:id,title') && e('409,用例库用例9;408,用例库用例8'); //测试productID值为0,libID值为201,orderBy值为title_desc,id_desc
|
||||
r($testsuite->getNotImportedCasesTest($productID[1], $libID[0], $orderBy[3])) && p('401:id,title;410:id,title') && e('401,用例库用例1;410,用例库用例10'); //测试productID值为0,libID值为201,orderBy值为title_asc,id_desc
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->getSuites();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试productID值为1,orderBy为id_desc >> 这是测试套件名称2;这是测试套件名称1
|
||||
测试productID值为1,orderBy为id_asc >> 这是测试套件名称1;这是测试套件名称2
|
||||
测试productID值为1,orderBy为name_desc,id_desc >> 这是测试套件名称2;这是测试套件名称1
|
||||
测试productID值为1,orderBy为name_asc,id_desc >> 这是测试套件名称1;这是测试套件名称2
|
||||
测试productID值为1,orderBy为id_desc >> 0
|
||||
测试productID值为1,orderBy为id_asc >> 0
|
||||
测试productID值为1,orderBy为name_desc,id_desc >> 0
|
||||
测试productID值为1,orderBy为name_asc,id_desc >> 0
|
||||
|
||||
*/
|
||||
$productID = array(1, 0);
|
||||
$orderBy = array('id_desc', 'id_asc', 'name_desc,id_desc', 'name_asc,id_desc');
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->getSuitesTest($productID[0], $orderBy[0])) && p('2:name;1:name') && e('这是测试套件名称2;这是测试套件名称1'); //测试productID值为1,orderBy为id_desc
|
||||
r($testsuite->getSuitesTest($productID[0], $orderBy[1])) && p('1:name;2:name') && e('这是测试套件名称1;这是测试套件名称2'); //测试productID值为1,orderBy为id_asc
|
||||
r($testsuite->getSuitesTest($productID[0], $orderBy[2])) && p('2:name;1:name') && e('这是测试套件名称2;这是测试套件名称1'); //测试productID值为1,orderBy为name_desc,id_desc
|
||||
r($testsuite->getSuitesTest($productID[0], $orderBy[3])) && p('1:name;2:name') && e('这是测试套件名称1;这是测试套件名称2'); //测试productID值为1,orderBy为name_asc,id_desc
|
||||
r($testsuite->getSuitesTest($productID[1], $orderBy[0])) && p() && e('0'); //测试productID值为1,orderBy为id_desc
|
||||
r($testsuite->getSuitesTest($productID[1], $orderBy[1])) && p() && e('0'); //测试productID值为1,orderBy为id_asc
|
||||
r($testsuite->getSuitesTest($productID[1], $orderBy[2])) && p() && e('0'); //测试productID值为1,orderBy为name_desc,id_desc
|
||||
r($testsuite->getSuitesTest($productID[1], $orderBy[3])) && p() && e('0'); //测试productID值为1,orderBy为name_asc,id_desc
|
||||
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->getUnitSuites();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试productID值为1,orderBy为id_desc >> 0
|
||||
测试productID值为1,orderBy为id_asc >> 0
|
||||
测试productID值为1,orderBy为name_desc,id_desc >> 0
|
||||
测试productID值为1,orderBy为name_asc,id_desc >> 0
|
||||
测试productID值为1,orderBy为id_desc >> 0
|
||||
测试productID值为1,orderBy为id_asc >> 0
|
||||
测试productID值为1,orderBy为name_desc,id_desc >> 0
|
||||
测试productID值为1,orderBy为name_asc,id_desc >> 0
|
||||
|
||||
*/
|
||||
$productID = array(1, 0);
|
||||
$orderBy = array('id_desc', 'id_asc', 'name_desc,id_desc', 'name_asc,id_desc');
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->getUnitSuitesTest($productID[0], $orderBy[0])) && p() && e('0'); //测试productID值为1,orderBy为id_desc
|
||||
r($testsuite->getUnitSuitesTest($productID[0], $orderBy[1])) && p() && e('0'); //测试productID值为1,orderBy为id_asc
|
||||
r($testsuite->getUnitSuitesTest($productID[0], $orderBy[2])) && p() && e('0'); //测试productID值为1,orderBy为name_desc,id_desc
|
||||
r($testsuite->getUnitSuitesTest($productID[0], $orderBy[3])) && p() && e('0'); //测试productID值为1,orderBy为name_asc,id_desc
|
||||
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[0])) && p() && e('0'); //测试productID值为1,orderBy为id_desc
|
||||
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[1])) && p() && e('0'); //测试productID值为1,orderBy为id_asc
|
||||
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[2])) && p() && e('0'); //测试productID值为1,orderBy为name_desc,id_desc
|
||||
r($testsuite->getUnitSuitesTest($productID[1], $orderBy[3])) && p() && e('0'); //测试productID值为1,orderBy为name_asc,id_desc
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->getUnlinkedCases();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试suiteID值为1,param值为0 >> 4,这个是测试用例4;3,这个是测试用例3
|
||||
测试suiteID值为1,param值为myQueryID >> 4,这个是测试用例4;3,这个是测试用例3
|
||||
测试suiteID值为2,param值为0 >> 2,这个是测试用例2;1,这个是测试用例1
|
||||
测试suiteID值为2,param值为myQueryID >> 2,这个是测试用例2;1,这个是测试用例1
|
||||
|
||||
*/
|
||||
$suiteID = array(1, 2);
|
||||
$param = array(0, 'myQueryID');
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->getUnlinkedCasesTest($suiteID[0], $param[0])) && p('0:id,title;1:id,title') && e('4,这个是测试用例4;3,这个是测试用例3'); //测试suiteID值为1,param值为0
|
||||
r($testsuite->getUnlinkedCasesTest($suiteID[0], $param[1])) && p('0:id,title;1:id,title') && e('4,这个是测试用例4;3,这个是测试用例3'); //测试suiteID值为1,param值为myQueryID
|
||||
r($testsuite->getUnlinkedCasesTest($suiteID[1], $param[0])) && p('0:id,title;1:id,title') && e('2,这个是测试用例2;1,这个是测试用例1'); //测试suiteID值为2,param值为0
|
||||
r($testsuite->getUnlinkedCasesTest($suiteID[1], $param[1])) && p('0:id,title;1:id,title') && e('2,这个是测试用例2;1,这个是测试用例1'); //测试suiteID值为2,param值为myQueryID
|
||||
Executable
+38
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->linkCase();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试存在的suiteID值为1,cases值为空 >> 0
|
||||
测试存在的suiteID值为1,cases值为一个 >> 1,1
|
||||
测试存在的suiteID值为1,cases值为多个 >> 1,2;1,3
|
||||
测试不存在的suiteID值为1000,cases值为空 >> 0
|
||||
测试不存在的suiteID值为1000,cases值为一个 >> 1000,1
|
||||
测试不存在的suiteID值为1000,cases值为多个 >> 1000,2;1000,3
|
||||
测试不存在的suiteID值为0,cases值为空 >> 0
|
||||
测试不存在的suiteID值为0,cases值为一个 >> 0,1
|
||||
测试不存在的suiteID值为0,cases值为多个 >> 0,2;0,3
|
||||
|
||||
*/
|
||||
$suiteID = array(1, 1000, 0);
|
||||
$cases = array(array(), array(1), array(2, 3));
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->linkCaseTest($suiteID[0], $cases[0])) && p() && e('0'); //测试存在的suiteID值为1,cases值为空
|
||||
r($testsuite->linkCaseTest($suiteID[0], $cases[1])) && p('0:suite,case') && e('1,1'); //测试存在的suiteID值为1,cases值为一个
|
||||
r($testsuite->linkCaseTest($suiteID[0], $cases[2])) && p('0:suite,case;1:suite,case') && e('1,2;1,3'); //测试存在的suiteID值为1,cases值为多个
|
||||
r($testsuite->linkCaseTest($suiteID[1], $cases[0])) && p() && e('0'); //测试不存在的suiteID值为1000,cases值为空
|
||||
r($testsuite->linkCaseTest($suiteID[1], $cases[1])) && p('0:suite,case') && e('1000,1'); //测试不存在的suiteID值为1000,cases值为一个
|
||||
r($testsuite->linkCaseTest($suiteID[1], $cases[2])) && p('0:suite,case;1:suite,case') && e('1000,2;1000,3'); //测试不存在的suiteID值为1000,cases值为多个
|
||||
r($testsuite->linkCaseTest($suiteID[2], $cases[0])) && p() && e('0'); //测试不存在的suiteID值为0,cases值为空
|
||||
r($testsuite->linkCaseTest($suiteID[2], $cases[1])) && p('0:suite,case') && e('0,1'); //测试不存在的suiteID值为0,cases值为一个
|
||||
r($testsuite->linkCaseTest($suiteID[2], $cases[2])) && p('0:suite,case;1:suite,case') && e('0,2;0,3'); //测试不存在的suiteID值为0,cases值为多个
|
||||
system("./ztest init");
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->select();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->selectTest()) && p() && e();
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
|
||||
include dirname(dirname(dirname(__FILE__))) . '/class/testsuite.class.php';
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 testsuiteModel->update();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试productID为1,name正常存在,type为private >> type,public,private
|
||||
测试productID为1,name为空,type为private >> 『名称』不能为空。
|
||||
测试productID为1,name正常存在,type为public >> type,private,public
|
||||
测试productID为1,name为空,type为public >> 『名称』不能为空。
|
||||
测试productID为1,name正常存在,type为空 >> type,public,
|
||||
测试productID为1,name为空,type为空 >> 『名称』不能为空。
|
||||
测试productID为0,name正常存在,type为private >> 0
|
||||
测试productID为0,name为空,type为private >> 『名称』不能为空。
|
||||
测试productID为0,name正常存在,type为public >> 0
|
||||
测试productID为0,name为空,type为public >> 『名称』不能为空。
|
||||
测试productID为0,name正常存在,type为空 >> 0
|
||||
测试productID为0,name为空,type为空 >> 『名称』不能为空。
|
||||
|
||||
*/
|
||||
$productID = array(1, 0);
|
||||
$name = array('这是测试套件名称1000', '');
|
||||
$type = array('private', 'public', '');
|
||||
|
||||
$testsuite = new testsuiteTest();
|
||||
|
||||
r($testsuite->updateTest($productID[0], $name[0], $type[0])) && p('2:field,old,new') && e('type,public,private'); //测试productID为1,name正常存在,type为private
|
||||
r($testsuite->updateTest($productID[0], $name[1], $type[0])) && p('name:0') && e('『名称』不能为空。'); //测试productID为1,name为空,type为private
|
||||
r($testsuite->updateTest($productID[0], $name[0], $type[1])) && p('0:field,old,new') && e('type,private,public'); //测试productID为1,name正常存在,type为public
|
||||
r($testsuite->updateTest($productID[0], $name[1], $type[1])) && p('name:0') && e('『名称』不能为空。'); //测试productID为1,name为空,type为public
|
||||
r($testsuite->updateTest($productID[0], $name[0], $type[2])) && p('0:field,old,new') && e('type,public,'); //测试productID为1,name正常存在,type为空
|
||||
r($testsuite->updateTest($productID[0], $name[1], $type[2])) && p('name:0') && e('『名称』不能为空。'); //测试productID为1,name为空,type为空
|
||||
r($testsuite->updateTest($productID[1], $name[0], $type[0])) && p() && e('0'); //测试productID为0,name正常存在,type为private
|
||||
r($testsuite->updateTest($productID[1], $name[1], $type[0])) && p('name:0') && e('『名称』不能为空。'); //测试productID为0,name为空,type为private
|
||||
r($testsuite->updateTest($productID[1], $name[0], $type[1])) && p() && e('0'); //测试productID为0,name正常存在,type为public
|
||||
r($testsuite->updateTest($productID[1], $name[1], $type[1])) && p('name:0') && e('『名称』不能为空。'); //测试productID为0,name为空,type为public
|
||||
r($testsuite->updateTest($productID[1], $name[0], $type[2])) && p() && e('0'); //测试productID为0,name正常存在,type为空
|
||||
r($testsuite->updateTest($productID[1], $name[1], $type[2])) && p('name:0') && e('『名称』不能为空。'); //测试productID为0,name为空,type为空
|
||||
system("./ztest init");
|
||||
Reference in New Issue
Block a user