znt/module/my/test/tao/fetchstoriesbysearch.php

40 lines
1.7 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=测试 myTao::fetchStoriesBySearch();
timeout=0
cid=17309
- 步骤1contribute类型搜索包含指定的需求 @0
- 步骤2assigned类型搜索当前用户指派的需求 @0
- 步骤3contribute类型活跃状态 @0
- 步骤4contribute类型ID条件查询 @0
- 步骤5assigned类型ID条件查询 @0
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/tao.class.php';
// 2. zendata数据准备根据需要配置
zenData('story')->gen(0);
zenData('product')->gen(0);
zenData('planstory')->gen(0);
zenData('productplan')->gen(0);
zenData('storyreview')->gen(0);
// 3. 用户登录(选择合适角色)
su('admin');
// 4. 创建测试实例(变量名与模块名一致)
$myTest = new myTaoTest();
// 5. 🔴 强制要求必须包含至少5个测试步骤
r($myTest->fetchStoriesBySearchTest('t1.deleted = 0', 'contribute', 'id_desc', null, array(1 => 1, 2 => 2))) && p() && e('0'); // 步骤1contribute类型搜索包含指定的需求
r($myTest->fetchStoriesBySearchTest('t1.deleted = 0', 'assigned', 'id_desc', null, array())) && p() && e('0'); // 步骤2assigned类型搜索当前用户指派的需求
r($myTest->fetchStoriesBySearchTest('t1.status = "active"', 'contribute', 'id_asc', null, array())) && p() && e('0'); // 步骤3contribute类型活跃状态
r($myTest->fetchStoriesBySearchTest('t1.deleted = 0 AND t1.id > 0', 'contribute', 'pri_desc', null, array())) && p() && e('0'); // 步骤4contribute类型ID条件查询
r($myTest->fetchStoriesBySearchTest('t1.deleted = 0 AND t1.id > 0', 'assigned', 'title_asc', null, array())) && p() && e('0'); // 步骤5assigned类型ID条件查询