znt/module/story/test/model/relievetwins.php

37 lines
1.1 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=测试 storyModel::relieveTwins();
timeout=0
cid=18579
- 执行storyTest模块的relieveTwinsTest方法参数是1, 2 @1
- 执行storyTest模块的relieveTwinsTest方法参数是999, 2 @1
- 执行storyTest模块的relieveTwinsTest方法参数是1, 999 @1
- 执行storyTest模块的relieveTwinsTest方法参数是0, 0 @1
- 执行storyTest模块的relieveTwinsTest方法参数是-1, -1 @1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
$table = zenData('story');
$table->id->range('1-10');
$table->product->range('1-3');
$table->title->range('需求标题1,需求标题2,需求标题3');
$table->twins->range(',2,3,,4,5,,,1,2,3,');
$table->status->range('active{5},closed{3},draft{2}');
$table->gen(10);
su('admin');
$storyTest = new storyModelTest();
r($storyTest->relieveTwinsTest(1, 2)) && p() && e('1');
r($storyTest->relieveTwinsTest(999, 2)) && p() && e('1');
r($storyTest->relieveTwinsTest(1, 999)) && p() && e('1');
r($storyTest->relieveTwinsTest(0, 0)) && p() && e('1');
r($storyTest->relieveTwinsTest(-1, -1)) && p() && e('1');