* Add switchDB by tests.

This commit is contained in:
liyang
2022-08-09 14:11:38 +08:00
parent 40ba4c8a9e
commit 3bd5ccc13f
881 changed files with 3058 additions and 1826 deletions
+4 -4
View File
@@ -2,6 +2,7 @@
<?php
include dirname(dirname(dirname(__FILE__))) . '/lib/init.php';
include dirname(dirname(dirname(__FILE__))) . '/class/todo.class.php';
$db->switchDB();
su('admin');
/**
@@ -10,8 +11,8 @@ title=测试 todoModel->update();
cid=1
pid=1
测试更新todo名称 >> name,自定义1的待办,john
测试更新todo类型 >> type,custom,bug
测试更新todo名称 >> name,自定义1的待办,john
测试更新todo类型 >> type,custom,bug
测试更新todo名称和类型 >> type,bug,custom;name,BUG2的待办,jack
测试不更新todo任何数据 >> 没有数据更新
@@ -24,11 +25,10 @@ $t_uptype = array('type' => 'bug', 'idvalue' => '1');
$t_typename = array('name' => 'jack', 'type' => 'custom');
$t_unname = array('name' => 'john');
$todo = new todoTest();
r($todo->updateTest($todoIDList[0], $t_upname)) && p('0:field,old,new') && e('name,自定义1的待办,john'); // 测试更新todo名称
r($todo->updateTest($todoIDList[0], $t_uptype)) && p('0:field,old,new') && e('type,custom,bug'); // 测试更新todo类型
r($todo->updateTest($todoIDList[1], $t_typename)) && p('0:field,old,new;1:field,old,new') && e('type,bug,custom;name,BUG2的待办,jack'); // 测试更新todo名称和类型
r($todo->updateTest($todoIDList[0], $t_unname)) && p() && e('没有数据更新'); // 测试不更新todo任何数据
system("./ztest init");
$db->restoreDB();