* Adjust unit test yaml and check rule.
This commit is contained in:
@@ -111,8 +111,7 @@ class branchTest
|
||||
public function updateTest($param)
|
||||
{
|
||||
$branchID = 1;
|
||||
|
||||
$branch = $this->objectModel->getByID($branchID, 0, '');
|
||||
$branch = $this->objectModel->getByID((string)$branchID, 0, '');
|
||||
|
||||
$newBranch = new stdclass();
|
||||
$newBranch->name = $branch->name;
|
||||
@@ -330,7 +329,7 @@ class branchTest
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function setDefaultTest($productID, $branchID)
|
||||
public function setDefaultTest(int $productID, int $branchID)
|
||||
{
|
||||
$this->objectModel->setDefault($productID, $branchID);
|
||||
|
||||
|
||||
@@ -2,20 +2,16 @@
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/branch.class.php';
|
||||
|
||||
zdTable('product')->config('product')->gen(10);
|
||||
zdTable('branch')->config('branch')->gen(10);
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 branchModel->activate();
|
||||
timeout=0
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试激活分支 2 >> 2,active
|
||||
测试激活分支 4 >> 4,active
|
||||
测试激活分支 6 >> 6,active
|
||||
测试激活分支 8 >> 8,active
|
||||
测试激活分支 10 >> 10,active
|
||||
测试激活分支 1 >> 1,active
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,21 +2,16 @@
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/branch.class.php';
|
||||
|
||||
zdTable('product')->config('product')->gen(10);
|
||||
zdTable('branch')->config('branch')->gen(10);
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 branchModel->close();
|
||||
timeout=0
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试关闭branchID 1 >> 1,closed
|
||||
测试关闭branchID 2 >> 2,closed
|
||||
测试关闭branchID 3 >> 3,closed
|
||||
测试关闭branchID 4 >> 4,closed
|
||||
测试关闭branchID 5 >> 5,closed
|
||||
测试关闭branchID 6 >> 6,closed
|
||||
测试重复关闭branchID 1 >> 1,closed
|
||||
|
||||
*/
|
||||
$branchID = array(1, 2, 3, 4, 5, 6);
|
||||
|
||||
@@ -2,22 +2,20 @@
|
||||
<?php
|
||||
include dirname(__FILE__, 5) . '/test/lib/init.php';
|
||||
include dirname(__FILE__, 2) . '/branch.class.php';
|
||||
|
||||
zdTable('product')->config('product')->gen(10);
|
||||
zdTable('branch')->config('branch')->gen(10);
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
|
||||
title=测试 branchModel->setDefault();
|
||||
timeout=0
|
||||
cid=1
|
||||
pid=1
|
||||
|
||||
测试将productID 0, branchID 0的分支设为默认分支 >> 0
|
||||
测试将productID 0, branchID 1的分支设为默认分支 >> 分支1,1
|
||||
测试将productID 41, branchID 0的分支设为默认分支 >> 主干
|
||||
测试将productID 41, branchID 0的分支设为默认分支 >> 分支1,1
|
||||
|
||||
*/
|
||||
|
||||
$productIdList = array(0, 41);
|
||||
$productIdList = array(0, 6);
|
||||
$branchIdList = array(0, 1);
|
||||
|
||||
$branch = new branchTest();
|
||||
|
||||
@@ -10,4 +10,4 @@ fields:
|
||||
- field: product
|
||||
range: 6-10{3}
|
||||
- field: status
|
||||
range: 'active{20},closed{10}'
|
||||
range: 'active{2},closed{1}'
|
||||
|
||||
Reference in New Issue
Block a user