znt/module/setting/test/model/getversion.php

31 lines
1,016 B
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=测试 settingModel::getVersion();
timeout=0
cid=18364
- 步骤1无版本配置时返回默认版本 @0.3.beta
- 步骤2正常版本号配置 @10.0
- 步骤33.0.stable特殊转换 @3.0
- 步骤4其他稳定版本号 @8.5
- 步骤5空字符串版本配置 @0
*/
include dirname(__FILE__, 5) . '/test/lib/init.php';
include dirname(__FILE__, 2) . '/lib/model.class.php';
zenData('config')->gen(0);
su('admin');
$setting = new settingModelTest();
r($setting->getVersionTest()) && p() && e('0.3.beta'); // 步骤1无版本配置时返回默认版本
r($setting->getVersionTest('10.0')) && p() && e('10.0'); // 步骤2正常版本号配置
r($setting->getVersionTest('3.0.stable')) && p() && e('3.0'); // 步骤33.0.stable特殊转换
r($setting->getVersionTest('8.5')) && p() && e('8.5'); // 步骤4其他稳定版本号
r($setting->getVersionTest('')) && p() && e('0'); // 步骤5空字符串版本配置