Files
EasySoft-ZenTaoPMS/module/custom/test/model/computefeatures.php
T

90 lines
4.4 KiB
PHP

#!/usr/bin/env php
<?php
/**
title=测试 customModel->computeFeatures();
timeout=0
cid=1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/custom.class.php';
zdTable('user')->gen(5);
su('admin');
$projectTable = zdTable('project');
$projectTable->id->range('1-15');
$projectTable->model->range('scrum{5},waterfall{5},waterfallplus{5}');
$projectTable->deleted->range('0');
$projectTable->gen(15);
$storyTable = zdTable('story');
$storyTable->type->range('requirement');
$storyTable->deleted->range('0');
$storyTable->gen(5);
$issueTable = zdTable('issue');
$issueTable->deleted->range('0');
$issueTable->project->range('1-5');
$issueTable->gen(5);
$meetingTable = zdTable('meeting');
$meetingTable->deleted->range('0');
$meetingTable->project->range('1-5');
$meetingTable->gen(5);
$opportunityTable = zdTable('opportunity');
$opportunityTable->execution->range('1-5');
$opportunityTable->deleted->range('0');
$opportunityTable->gen(5);
$programactivityTable = zdTable('programactivity');
$programactivityTable->execution->range('1-5');
$programactivityTable->deleted->range('0');
$programactivityTable->gen(5);
$assetlibTable = zdTable('assetlib');
$assetlibTable->deleted->range('0');
$assetlibTable->gen(5);
$editionList = array('open', 'ipd', 'max');
$customTester = new customTest();
$openFeatures = $customTester->computeFeaturesTest($editionList[0]);
$ipdFeatures = $customTester->computeFeaturesTest($editionList[1]);
$maxFeatures = $customTester->computeFeaturesTest($editionList[2]);
r($openFeatures[0]) && p('0,1') && e('program,productLine'); // 计算开源版不启用的功能
r($openFeatures[1]) && p() && e('0'); // 计算开源版敏捷项目启用的功能
r($openFeatures[2]) && p() && e('0'); // 计算开源版敏捷项目不启用的功能
r($ipdFeatures[0]) && p('0,1') && e('program,productLine'); // 计算ipd版不启用的功能
r($ipdFeatures[1]) && p() && e('0'); // 计算ipd版敏捷项目启用的功能
r($ipdFeatures[2]) && p() && e('0'); // 计算ipd版敏捷项目不启用的功能
r($maxFeatures[0]) && p('0,1') && e('program,productLine'); // 计算旗舰版不启用的功能
r($maxFeatures[1]) && p() && e('0'); // 计算旗舰版敏捷项目启用的功能
r($maxFeatures[2]) && p() && e('0'); // 计算旗舰版敏捷项目不启用的功能
zdTable('project')->gen(0);
zdTable('story')->gen(0);
zdTable('issue')->gen(0);
zdTable('meeting')->gen(0);
zdTable('opportunity')->gen(0);
zdTable('programactivity')->gen(0);
zdTable('assetlib')->gen(0);
$openFeatures = $customTester->computeFeaturesTest($editionList[0]);
$ipdFeatures = $customTester->computeFeaturesTest($editionList[1]);
$maxFeatures = $customTester->computeFeaturesTest($editionList[2]);
r($openFeatures[0]) && p('0,1,2,3,4') && e('program,productLine,productUR,projectWaterfall,projectWaterfallplus'); // 计算无相关数据时,开源版不启用的功能
r($openFeatures[1]) && p() && e('0'); // 计算无相关数据时,开源版敏捷项目启用的功能
r($openFeatures[2]) && p() && e('0'); // 计算无相关数据时,开源版敏捷项目不启用的功能
r($ipdFeatures[0]) && p('0,1,2,3,4') && e('program,productLine,productUR,projectWaterfall,projectWaterfallplus'); // 计算无相关数据时,ipd版不启用的功能
r($ipdFeatures[1]) && p() && e('0'); // 计算无相关数据时,ipd版敏捷项目启用的功能
r($ipdFeatures[2]) && p() && e('0'); // 计算无相关数据时,ipd版敏捷项目不启用的功能
r($maxFeatures[0]) && p('0,1,2,3,4') && e('program,productLine,productUR,projectWaterfall,projectWaterfallplus'); // 计算无相关数据时,旗舰版不启用的功能
r($maxFeatures[1]) && p() && e('0'); // 计算无相关数据时,旗舰版敏捷项目启用的功能
r($maxFeatures[2]) && p() && e('0'); // 计算无相关数据时,旗舰版敏捷项目不启用的功能