diff --git a/test/class/misc.class.php b/test/class/misc.class.php new file mode 100644 index 0000000000..1346917bc0 --- /dev/null +++ b/test/class/misc.class.php @@ -0,0 +1,60 @@ +misc = $tester->loadModel('misc'); + } + + /** + * hello + * + * @access public + * @return void + */ + public function hello() + { + $miscs = $this->misc->hello(); + return $miscs; + } + + /** + * getTableAndStatus + * 传入参数来获取表状态 + * @param string $type + * @access public + * @return void + */ + public function getTableAndStatus($type = 'check') + { + $miscs = $this->misc->getTableAndStatus($type = 'check'); + return $miscs; + } + + /** + * getRemind + * + * @access public + * @return void + */ + public function getRemind() + { + $miscs = $this->misc->getRemind(); + return $miscs; + } + + /** + * checkOneClickPackage + * + * @access public + * @return void + */ + public function checkOneClickPackage() + { + $miscs = $this->misc->checkOneClickPackage(); + return $miscs; + } +} +?> diff --git a/test/class/productplan.class.php b/test/class/productplan.class.php new file mode 100644 index 0000000000..dbc5f8cbd0 --- /dev/null +++ b/test/class/productplan.class.php @@ -0,0 +1,79 @@ +productplan = $tester->loadModel('productplan'); + } + + /** + * getByIDPlan + * + * @param int mixed $planID + * @param bool mixed $setImgSize + * @access public + * @return void + */ + public function getByIDPlan($planID, $setImgSize = false) + { + $productplans = $this->productplan->getByID($planID, $setImgSize = false); + return $productplans; + } + + /** + * getByIDList + * + * @param array(int) mixed $planIDList + * @access public + * @return void + */ + public function getByIDList($planIDList) + { + $productplans = $this->productplan->getByIDList($planIDList); + return $productplans; + } + + /** + * getLast + * + * @param int mixed $productID + * @param int $branch + * @param int $parent + * @access public + * @return void + */ + public function getLast($productID, $branch = 0, $parent = 0) + { + $productplans = $this->productplan->getLast($productID, $branch = 0, $parent = 0); + return $productplans; + } + + /** + * getList + * + * @param int $product + * @param int $branch + * @param string $browseType + * @param mixed $pager + * @param string $orderBy + * @param string $param + * @access public + * @return void + */ + public function getList($product = 0, $branch = 0, $browseType = 'doing', $pager = null, $orderBy = 'begin_desc', $param = '') + { + $productplans = $this->productplan->getList($product = 0, $branch = 0, $browseType = 'doing', $pager = null, $orderBy = 'begin_desc', $param = ''); + return $productplans; + } + + public function getPairs($product = 0, $branch = '', $expired = '', $skipParent = false) + { + $productplans = $this->productplan->getPairs($product = 0, $branch = '', $expired = '', $skipParent = false); + return $productplans; + } + +} + +?> diff --git a/test/model/misc/checkoneclickpackage.php b/test/model/misc/checkoneclickpackage.php new file mode 100755 index 0000000000..e0530d012b --- /dev/null +++ b/test/model/misc/checkoneclickpackage.php @@ -0,0 +1,9 @@ +#!/usr/bin/env php +checkOneClickPackage()) && p() && e(''); +?> diff --git a/test/model/misc/getremind.php b/test/model/misc/getremind.php new file mode 100755 index 0000000000..4293172f90 --- /dev/null +++ b/test/model/misc/getremind.php @@ -0,0 +1,9 @@ +#!/usr/bin/env php +getRemind()) && p() && e('0'); //调用方法返回值 +?> diff --git a/test/model/misc/gettableandstatus.php b/test/model/misc/gettableandstatus.php new file mode 100755 index 0000000000..b8e5a7e54a --- /dev/null +++ b/test/model/misc/gettableandstatus.php @@ -0,0 +1,12 @@ +#!/usr/bin/env php +getTableAndStatus('check')) && p('zt_account') && e('ok'); //输入表名,查看数据库表状态使用情况等,正常输出ok +r($misc->getTableAndStatus('check')) && p('zt_zoutput') && e('ok'); //如被占用返回:1 client is using or hasn't closed the table properly(由于动态更新,此处断言两张表正常状态) +r($misc->getTableAndStatus('repair')) && p('zt_webhook') && e('ok'); //可以传入repair参数,状态与上述一致 +r($misc->getTableAndStatus('aaaaa')) && p('zt_account') && e('ok'); //这里测试传入不同参数||返回值相同 +?> diff --git a/test/model/misc/hello.php b/test/model/misc/hello.php new file mode 100755 index 0000000000..3e1fea7acf --- /dev/null +++ b/test/model/misc/hello.php @@ -0,0 +1,9 @@ +#!/usr/bin/env php +hello()) && p() && e('hello world from hello()
'); //简单打印,maybe test function。 +?> diff --git a/test/model/productplan/getbyidlist.php b/test/model/productplan/getbyidlist.php new file mode 100755 index 0000000000..41047865e6 --- /dev/null +++ b/test/model/productplan/getbyidlist.php @@ -0,0 +1,17 @@ +#!/usr/bin/env php +getByIDList($IDlist)) && p('3:id') && e('3'); //传入一个数组,取值id为3的数据 +r($productplan->getByIDList($IDlist)) && p('1:id') && e('1'); //传入一个数组,取值id为1的数据 +r($productplan->getByIDList($IDlist[0])) && p('1:id') && e('1'); //传入一个数值,正常取值 +r($productplan->getByIDList($IDlist[1])) && p() && e('0'); //传入一个不存在的值返回布尔值 +?> diff --git a/test/model/productplan/getbyidplan.php b/test/model/productplan/getbyidplan.php new file mode 100755 index 0000000000..3303c95f2b --- /dev/null +++ b/test/model/productplan/getbyidplan.php @@ -0,0 +1,16 @@ +#!/usr/bin/env php +getByIDPlan($planID[0])) && p('status') && e('wait'); //如果存在,返回数组类型数据 +r($productplan->getByIDPlan($planID[0])) && p('begin') && e('2021-06-13'); //取出开始时间 +r($productplan->getByIDPlan($planID[0])) && p('end') && e('2021-10-14'); //取出结束时间 +r($productplan->getByIDPlan($planID[1])) && p() && e('0'); //如不存在,返回布尔值 +?> diff --git a/test/model/productplan/getlast.php b/test/model/productplan/getlast.php new file mode 100755 index 0000000000..ce1970c467 --- /dev/null +++ b/test/model/productplan/getlast.php @@ -0,0 +1,16 @@ +#!/usr/bin/env php +getLast($getLast[0])) && p('id') && e('3'); //获取id为1的最后一个产品 +r($productplan->getLast($getLast[1])) && p('id') && e('6'); //获取id为2的最后一个产品 +r($productplan->getLast($getLast[2])) && p('id') && e('0'); //获取不存在的id返回布尔值 +?> diff --git a/test/model/productplan/getlist.php b/test/model/productplan/getlist.php new file mode 100755 index 0000000000..321dd8833b --- /dev/null +++ b/test/model/productplan/getlist.php @@ -0,0 +1,12 @@ +#!/usr/bin/env php +getList(1, 0, 'all', null, 'begin_desc', 'kipparent')) && p('') && e('0'); //返回空数组 +?> diff --git a/test/model/productplan/getpairs.php b/test/model/productplan/getpairs.php new file mode 100755 index 0000000000..98952f86e4 --- /dev/null +++ b/test/model/productplan/getpairs.php @@ -0,0 +1,8 @@ +#!/usr/bin/env php +