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

32 lines
1.3 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::genMetricComponent();
timeout=0
cid=18230
- 执行screenTest模块的genMetricComponentTest方法参数是1 属性hasComponent @1
- 执行screenTest模块的genMetricComponentTest方法参数是2 属性isDeleted @1
- 执行screenTest模块的genMetricComponentTest方法参数是3 属性isWaiting @1
- 执行screenTest模块的genMetricComponentTest方法参数是4, null 属性hasComponent @1
- 执行screenTest模块的genMetricComponentTest方法参数是5, null, array 属性hasComponent @1
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
zenData('metric')->loadYaml('metric_genmetriccomponent', false, 2)->gen(10);
zenData('metriclib')->loadYaml('metriclib_genmetriccomponent', false, 2)->gen(50);
su('admin');
$screenTest = new screenModelTest();
r($screenTest->genMetricComponentTest(1)) && p('hasComponent') && e('1');
r($screenTest->genMetricComponentTest(2)) && p('isDeleted') && e('1');
r($screenTest->genMetricComponentTest(3)) && p('isWaiting') && e('1');
r($screenTest->genMetricComponentTest(4, null)) && p('hasComponent') && e('1');
r($screenTest->genMetricComponentTest(5, null, array('dateString' => '2023-01-01'))) && p('hasComponent') && e('1');