diff --git a/module/block/test/zen/printplanblock.php b/module/block/test/zen/printplanblock.php new file mode 100755 index 0000000000..f4353dce83 --- /dev/null +++ b/module/block/test/zen/printplanblock.php @@ -0,0 +1,75 @@ +#!/usr/bin/env php +dashboard = 'my'; +$defaultBlock->params = new stdclass(); +$defaultBlock->params->type = ''; +$defaultBlock->params->count = 15; + +r($blockTest->printPlanBlockTest($defaultBlock)) && p('plansCount') && e('1'); // 步骤1:默认参数测试 + +// 测试type为all的情况 +$allBlock = new stdclass(); +$allBlock->dashboard = 'my'; +$allBlock->params = new stdclass(); +$allBlock->params->type = 'all'; +$allBlock->params->count = 15; + +r($blockTest->printPlanBlockTest($allBlock)) && p('plansCount') && e('1'); // 步骤2:type为all类型测试 + +// 测试count限制为5 +$limit5Block = new stdclass(); +$limit5Block->dashboard = 'my'; +$limit5Block->params = new stdclass(); +$limit5Block->params->type = ''; +$limit5Block->params->count = 5; + +r($blockTest->printPlanBlockTest($limit5Block)) && p('plansCount') && e('1'); // 步骤3:count限制为5测试 + +// 测试count限制为10 +$limit10Block = new stdclass(); +$limit10Block->dashboard = 'my'; +$limit10Block->params = new stdclass(); +$limit10Block->params->type = ''; +$limit10Block->params->count = 10; + +r($blockTest->printPlanBlockTest($limit10Block)) && p('plansCount') && e('1'); // 步骤4:count限制为10测试 + +// 测试type为noproduct的情况 +$noproductBlock = new stdclass(); +$noproductBlock->dashboard = 'my'; +$noproductBlock->params = new stdclass(); +$noproductBlock->params->type = 'noproduct'; +$noproductBlock->params->count = 15; + +r($blockTest->printPlanBlockTest($noproductBlock)) && p('plansCount') && e('1'); // 步骤5:type为noproduct测试 \ No newline at end of file