Files
2025-11-14 13:05:25 +08:00

27 lines
1.0 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=测试 fileModel::setWebPath();
timeout=0
cid=16536
- 测试默认公司ID1)的webPath设置 @/data/upload/1/
- 测试自定义公司ID5)的webPath设置 @/data/upload/5/
- 测试公司ID为0的边界情况 @/data/upload/0/
- 测试公司ID未设置时的默认值 @/data/upload/1/
- 测试webRoot为空字符串的情况 @data/upload/1/
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/file.unittest.class.php';
su('admin');
$file = new fileTest();
r($file->setWebPathTest()) && p() && e('/data/upload/1/'); // 测试默认公司ID1)的webPath设置
r($file->setWebPathTest(5)) && p() && e('/data/upload/5/'); // 测试自定义公司ID5)的webPath设置
r($file->setWebPathTest(0)) && p() && e('/data/upload/0/'); // 测试公司ID为0的边界情况
r($file->setWebPathTest(null)) && p() && e('/data/upload/1/'); // 测试公司ID未设置时的默认值
r($file->setWebPathTest(1, '')) && p() && e('data/upload/1/'); // 测试webRoot为空字符串的情况