znt/module/metric/test/model/getdatasetpath.php

29 lines
1.1 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=测试 metricModel::getDatasetPath();
timeout=0
cid=17088
- 步骤1正常获取dataset路径 @dataset.php
- 步骤2验证文件扩展名 @.php
- 步骤3验证包含metric模块名 @1
- 步骤4验证包含dataset文件名 @1
- 步骤5验证完整路径格式 @module/metric/dataset.php
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
su('admin');
$metricTest = new metricModelTest();
r(substr($metricTest->getDatasetPathTest(), -11)) && p() && e('dataset.php'); // 步骤1正常获取dataset路径
r(substr($metricTest->getDatasetPathTest(), -4)) && p() && e('.php'); // 步骤2验证文件扩展名
r(strpos($metricTest->getDatasetPathTest(), 'metric') !== false ? '1' : '0') && p() && e('1'); // 步骤3验证包含metric模块名
r(strpos($metricTest->getDatasetPathTest(), 'dataset.php') !== false ? '1' : '0') && p() && e('1'); // 步骤4验证包含dataset文件名
r(substr($metricTest->getDatasetPathTest(), -25)) && p() && e('module/metric/dataset.php'); // 步骤5验证完整路径格式