* Adjust unit test case data build.
This commit is contained in:
@@ -1,29 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/productplan.class.php';
|
||||
|
||||
/**
|
||||
|
||||
title=productpanModel->getGroupByProduct();
|
||||
timeout=0
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
传入正常product 1,2; >> 2
|
||||
传入部分不存在product; >> 1
|
||||
传入不存在product >> 0
|
||||
传入正常product 1,2;未过期param >> 0
|
||||
传入部分不存在product;未过期param >> 0
|
||||
传入不存在product; 未过期param >> 0
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/productplan.class.php';
|
||||
|
||||
zdTable('branch')->config('branch')->gen(10);
|
||||
zdTable('productplan')->config('productplan')->gen(10);
|
||||
|
||||
$plan = new productPlan('admin');
|
||||
|
||||
$products = array();
|
||||
$products[0] = array(1, 2);
|
||||
$products[1] = array(2, 10000);
|
||||
$products[2] = array(9999, 10000);
|
||||
|
||||
$param = array();
|
||||
$param[0] = 'skipParent';
|
||||
$param[1] = 'unexpired';
|
||||
@@ -31,7 +28,7 @@ $param[1] = 'unexpired';
|
||||
r($plan->getGroupByProduct($products[0], $param[0])) && p() && e('2'); //传入正常product 1,2;
|
||||
r($plan->getGroupByProduct($products[1], $param[0])) && p() && e('1'); //传入部分不存在product;
|
||||
r($plan->getGroupByProduct($products[2], $param[0])) && p() && e('0'); //传入不存在product
|
||||
r($plan->getGroupByProduct($products[0], $param[1])) && p() && e('0'); //传入正常product 1,2;未过期param
|
||||
r($plan->getGroupByProduct($products[1], $param[1])) && p() && e('0'); //传入部分不存在product;未过期param
|
||||
r($plan->getGroupByProduct($products[0], $param[1])) && p() && e('1'); //传入正常product 1,2;未过期param
|
||||
r($plan->getGroupByProduct($products[1], $param[1])) && p() && e('1'); //传入部分不存在product;未过期param
|
||||
r($plan->getGroupByProduct($products[2], $param[1])) && p() && e('0'); //传入不存在product; 未过期param
|
||||
?>
|
||||
?>
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
/**
|
||||
|
||||
title=productplanModel->relationBranch();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
*/
|
||||
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/productplan.class.php';
|
||||
|
||||
zdTable('branch')->config('relationbranch_branch')->gen(20);
|
||||
zdTable('productplan')->config('relationbranch_productplan')->gen(50);
|
||||
|
||||
/**
|
||||
|
||||
title=productplanModel->relationBranch();
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
*/
|
||||
|
||||
$plan = new productPlan('admin');
|
||||
|
||||
$planID = array();
|
||||
|
||||
@@ -113,9 +113,9 @@ class productPlan
|
||||
* @access public
|
||||
* @return count
|
||||
*/
|
||||
public function getGroupByProduct($products, $param, $field = 'name', $orderBy = 'id_desc')
|
||||
public function getGroupByProduct($products, $param, $orderBy = 'id_desc')
|
||||
{
|
||||
$productplans = $this->productplan->getGroupByProduct($products, $param, $field, $orderBy);
|
||||
$productplans = $this->productplan->getGroupByProduct($products, $param, $orderBy);
|
||||
if(dao::isError()) return dao::getError();
|
||||
return count($productplans);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user