+ Add unit test for task #118308.

This commit is contained in:
wangyidong
2024-05-20 14:52:31 +08:00
parent 695aaf2861
commit cff7b5bd19
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env php
<?php
/**
title=测试 storyModel->buildTrackLanes();
timeout=0
cid=0
- 传入空参数。 @0
- 检查泳道数。 @4
- 检查第一个泳道的name参数。 @lane_1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
global $tester;
$tester->loadModel('story');
$lastNodes = array();
foreach(array(1,2,3,4) as $storyID)
{
$story = new stdclass();
$story->id = $storyID;
$lastNodes[$storyID] = $story;
}
r(count($tester->story->buildTrackLanes(array()))) && p() && e('0'); //传入空参数。
$lanes = $tester->story->buildTrackLanes($lastNodes);
r(count($lanes)) && p() && e('4'); //检查泳道数。
r($lanes[0]['name']) && p() && e('lane_1'); //检查第一个泳道的name参数。