* Modify the test file of createTwins and updateTwins.

This commit is contained in:
xieqiyu
2024-01-25 14:34:13 +08:00
parent 80c6e7c497
commit 3c8ee099ad
2 changed files with 24 additions and 18 deletions
+11 -9
View File
@@ -1,5 +1,15 @@
#!/usr/bin/env php
<?php
/**
title=测试 storyModel->create();
cid=1
- 检查创建后的数据。
- 属性id @5
- 属性twins @,6,
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/story.class.php';
su('admin');
@@ -22,14 +32,6 @@ $storySpec = zdTable('storyspec');
$storySpec->story->range('1-6');
$storySpec->gen(4);
/**
title=测试 storyModel->create();
cid=1
pid=1
*/
$data = new stdclass();
$data->product = 1;
$data->module = 0;
@@ -63,4 +65,4 @@ $data->reviewer[] = 'admin';
$story = new storyTest();
$test1 = $story->createTwinsTest($data);
r((array)$test1) && p('id,twins') && e('5,6'); //检查创建后的数据。
r((array)$test1) && p('id-twins', '-') && e('5-,6,'); //检查创建后的数据。
+13 -9
View File
@@ -1,19 +1,23 @@
#!/usr/bin/env php
<?php
/**
title=测试 storyModel->updateTwins();
cid=1
- 不传入需求,也不传入产品。 @0
- 传入需求列表,检查twins字段。
- 属性1 @:2:3:
- 属性2 @:1:3:
- 属性3 @:1:2:
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/story.class.php';
zdTable('story')->gen(5);
/**
title=测试 storyModel->updateTwins();
cid=1
pid=1
*/
$storyTest = new storyTest();
r($storyTest->updateTwinsTest(array())) && p() && e('0'); //不传入需求,也不传入产品。
r($storyTest->updateTwinsTest(array(1 => 1, 2 => 2, 3 => 3))) && p('1,2,3') && e('2:3,1:3,1:2'); //传入需求列表,检查twins字段。
r($storyTest->updateTwinsTest(array(1 => 1, 2 => 2, 3 => 3))) && p('1,2,3') && e(':2:3:,:1:3:,:1:2:'); //传入需求列表,检查twins字段。