znt/module/webhook/test/model/getviewlink.php

44 lines
1.5 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=测试 webhookModel::getViewLink();
timeout=0
cid=19701
- 执行webhookTest模块的getViewLinkTest方法参数是'product', 1 @product-view-1.html
- 执行webhookTest模块的getViewLinkTest方法参数是'case', 1 @testcase-view-1.html
- 执行webhookTest模块的getViewLinkTest方法参数是'kanbancard', 1 @kanban-view-1.html
- 执行webhookTest模块的getViewLinkTest方法参数是'meeting', 1 @meeting-view-1.html#app=project
- 执行webhookTest模块的getViewLinkTest方法参数是'', 0 @-view-0.html
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
// 准备测试数据
$kanbanTable = zenData('kanbancard');
$kanbanTable->id->range('1-10');
$kanbanTable->kanban->range('1-5');
$kanbanTable->gen(5);
$meetingTable = zenData('meeting');
$meetingTable->id->range('1-10');
$meetingTable->project->range('1-3,0{3}');
$meetingTable->gen(5);
su('admin');
$webhookTest = new webhookModelTest();
global $tester;
$tester->config->requestType = 'PATH_INFO';
r($webhookTest->getViewLinkTest('product', 1)) && p() && e('product-view-1.html');
r($webhookTest->getViewLinkTest('case', 1)) && p() && e('testcase-view-1.html');
r($webhookTest->getViewLinkTest('kanbancard', 1)) && p() && e('kanban-view-1.html');
r($webhookTest->getViewLinkTest('meeting', 1)) && p() && e('meeting-view-1.html#app=project');
r($webhookTest->getViewLinkTest('', 0)) && p() && e('-view-0.html');