znt/module/screen/test/model/getdatasetforusagereport.php

39 lines
1.6 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=测试 screenModel::getDatasetForUsageReport();
timeout=0
cid=18241
- 步骤1chartID 20002(活跃用户表格) @0
- 步骤2chartID 20004(活跃产品卡片)第0条的count属性 @0
- 步骤3chartID 20007(活跃项目卡片)第0条的count属性 @0
- 步骤4chartID 20010(项目任务表格) @0
- 步骤5不存在的chartID @0
*/
// 1. 导入依赖(路径固定,不可修改)
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
// 2. zendata数据准备根据需要配置
// 由于数据复杂性,先不设置过多测试数据,主要测试方法逻辑
// 3. 用户登录(选择合适角色)
su('admin');
// 4. 创建测试实例(变量名与模块名一致)
$screenTest = new screenModelTest();
$screenTest->objectModel->filter = new stdclass();
$screenTest->objectModel->filter->year = '2024';
$screenTest->objectModel->filter->month = '01';
// 5. 🔴 强制要求必须包含至少5个测试步骤
r($screenTest->getDatasetForUsageReportTest(20002)) && p() && e('0'); // 步骤1chartID 20002(活跃用户表格)
r($screenTest->getDatasetForUsageReportTest(20004)) && p('0:count') && e('0'); // 步骤2chartID 20004(活跃产品卡片)
r($screenTest->getDatasetForUsageReportTest(20007)) && p('0:count') && e('0'); // 步骤3chartID 20007(活跃项目卡片)
r($screenTest->getDatasetForUsageReportTest(20010)) && p() && e('0'); // 步骤4chartID 20010(项目任务表格)
r($screenTest->getDatasetForUsageReportTest(99999)) && p() && e('0'); // 步骤5不存在的chartID