znt/module/tree/test/model/updateorder.php

39 lines
1.3 KiB
PHP
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env php
<?php
/**
title=测试 treeModel->updateOrder();
timeout=0
cid=19393
- 测试更新story模块顺序 @,12,32,16
- 测试更新task模块顺序 @,18,31,11
- 测试更新story不同分支模块顺序 @,2,32,12
- 测试更新task不同分支模块顺序 @,1,31,11
- 测试更新模块顺序 @,13,14,15
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
zenData('module')->loadYaml('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
$orders5 = array('13' => 8, '14' => 9, '15' => 10);
$tree = new treeModelTest();
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不同分支模块顺序
r($tree->updateOrderTest($orders5)) && p() && e(',13,14,15'); // 测试更新模块顺序