znt/module/convert/test/model/getjiraworkflowactions.php

50 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=测试 convertModel::getJiraWorkflowActions();
timeout=0
cid=15785
- 执行convertTest模块的getJiraWorkflowActionsTest方法 @0
- 执行$result, 'error') !== false @1
- 执行convertTest模块的getJiraWorkflowActionsTest方法 @0
- 执行$result, 'error') !== false || is_array($result @1
- 执行$config->edition == $originalEdition @1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$convertTest = new convertModelTest();
// 步骤1测试开源版本返回空数组
global $config;
$originalEdition = $config->edition;
$config->edition = 'open';
r($convertTest->getJiraWorkflowActionsTest()) && p() && e('0');
// 步骤2测试企业版无session数据产生错误
$config->edition = 'biz';
unset($_SESSION['jiraMethod']);
$result = $convertTest->getJiraWorkflowActionsTest();
r(strpos($result, 'error') !== false) && p() && e('1');
// 步骤3企业版有效session但无工作流数据返回空数组
$_SESSION['jiraMethod'] = 'file';
r($convertTest->getJiraWorkflowActionsTest()) && p() && e('0');
// 步骤4测试企业版DB方法调用产生错误
$_SESSION['jiraMethod'] = 'db';
$_SESSION['jiraDB'] = 'test';
$result = $convertTest->getJiraWorkflowActionsTest();
r(strpos($result, 'error') !== false || is_array($result)) && p() && e('1');
// 步骤5测试配置恢复
$config->edition = $originalEdition;
r($config->edition == $originalEdition) && p() && e('1');