* Adjust unit test yaml and check rule.

This commit is contained in:
caoyanyi
2023-09-21 14:39:44 +08:00
parent 0e32876039
commit 8d55e5bf42
5 changed files with 16 additions and 28 deletions
+2 -3
View File
@@ -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);
+4 -8
View File
@@ -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
*/
+4 -9
View File
@@ -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);
+5 -7
View File
@@ -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();
+1 -1
View File
@@ -10,4 +10,4 @@ fields:
- field: product
range: 6-10{3}
- field: status
range: 'active{20},closed{10}'
range: 'active{2},closed{1}'