* Fix failed testcases of tree.

This commit is contained in:
朱金勇
2023-12-28 11:57:13 +08:00
parent 913319f526
commit 4e5d420e0f
41 changed files with 734 additions and 742 deletions
+22 -16
View File
@@ -1,29 +1,35 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/tree.class.php';
su('admin');
/**
title=测试 treeModel->updateOrder();
timeout=0
cid=1
pid=1
测试更新模块顺序 1 >> ,2221,2821,1822,2822,1823,2222,2223,1824,2224
测试更新模块顺序 2 >> ,2221,2821,1822,2822,1823,1824,2222,2223,2224
测试更新模块顺序 3 >> ,2221,2822,1822,2821,1823,1824,2222,2223,2224
测试更新模块顺序 4 >> ,1984,2901,2381,2902,2382,2383,2384
- 测试更新story模块顺序 @,12,32,16
- 测试更新task模块顺序 @,18,31,11
- 测试更新story不同分支模块顺序 @,2,32,12
- 测试更新task不同分支模块顺序 @,1,31,11
*/
$orders1 = array('2221' => 0, '2821' => 1, '2822' => 2, '1822' => 3, '1823' => 4, '2222' => 5, '2223' => 6, '1824' => 7, '2224' => 8);
$orders2 = array('2221' => 0, '2821' => 1, '2822' => 2, '1822' => 3, '1823' => 4, '1824' => 5, '2222' => 6, '2223' => 7, '2224' => 8);
$orders3 = array('2221' => 0, '2822' => 1, '2821' => 2, '1822' => 3, '1823' => 4, '1824' => 5, '2222' => 6, '2223' => 7, '2224' => 8);
$orders4 = array('1984' => 0, '2381' => 1, '2901' => 2, '2902' => 3, '2382' => 4, '2383' => 5, '2384' => 6);
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/tree.class.php';
su('admin');
zdTable('module')->config('module')->gen(100);
$orders1 = array('12' => 1, '16' => 4, '32' => 2);
$orders2 = array('11' => 7, '18' => 2, '31' => 5);
$orders3 = array('12' => 7, '2' => 6, '32' => 5); // 2是branch0, 12 32是分支1
$orders4 = array('11' => 7, '1' => 6, '31' => 5); // 1是branch0, 11 31是分支1
$tree = new treeTest();
r($tree->updateOrderTest($orders1)) && p() && e(',2221,2821,1822,2822,1823,2222,2223,1824,2224'); // 测试更新模块顺序 1
r($tree->updateOrderTest($orders2)) && p() && e(',2221,2821,1822,2822,1823,1824,2222,2223,2224'); // 测试更新模块顺序 2
r($tree->updateOrderTest($orders3)) && p() && e(',2221,2822,1822,2821,1823,1824,2222,2223,2224'); // 测试更新模块顺序 3
r($tree->updateOrderTest($orders4)) && p() && e(',1984,2901,2381,2902,2382,2383,2384'); // 测试更新模块顺序 4
r($tree->updateOrderTest($orders1)) && p() && e(',12,32,16'); // 测试更新story模块顺序
r($tree->updateOrderTest($orders2)) && p() && e(',18,31,11'); // 测试更新task模块顺序
r($tree->updateOrderTest($orders3)) && p() && e(',2,32,12'); // 测试更新story不同分支模块顺序
r($tree->updateOrderTest($orders4)) && p() && e(',1,31,11'); // 测试更新task不同分支模块顺序