本文整理汇总了PHP中dm::getVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP dm::getVersion方法的具体用法?PHP dm::getVersion怎么用?PHP dm::getVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dm
的用法示例。
在下文中一共展示了dm::getVersion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
require_once dirname(__FILE__) . '/helper/dmUnitTestHelper.php';
$helper = new dmUnitTestHelper();
$helper->boot();
$t = new lime_test(12);
$t->comment('Weird version numbers will be shown during this test.');
$t->comment('Diem real version number is ' . DIEM_VERSION);
dm::setVersion('5.2.14');
$t->is(dm::getVersion(), '5.2.14', 'Diem version is 5.2.14');
$t->is(dm::getVersionMajor(), '5', 'Diem version major is 5');
$t->is(dm::getVersionMinor(), '2', 'Diem version minor is 2');
$t->is(dm::getVersionMaintenance(), '14', 'Diem version maintenance is 14');
$t->is(dm::getVersionBranch(), '5.2', 'Diem version branch is 5.2');
dm::setVersion('5.0.0-BETA4_DEV');
$t->is(dm::getVersion(), '5.0.0-BETA4_DEV', 'Diem version is 5.0.0-BETA4_DEV');
$t->is(dm::getVersionMajor(), '5', 'Diem version major is 5');
$t->is(dm::getVersionMinor(), '0', 'Diem version minor is 0');
$t->is(dm::getVersionMaintenance(), '0-BETA4_DEV', 'Diem version maintenance is 0-BETA4_DEV');
$t->is(dm::getVersionBranch(), '5.0', 'Diem version branch is 5.0');
dm::setVersion(DIEM_VERSION);
$t->is(version_compare('5.0.0-BETA4_DEV', '5.0.0'), -1, '5.0.0-BETA4_DEV < 5.0.0');
$t->is(version_compare('5.0.0', '5.0.1'), -1, '5.0.0 < 5.0.1');
示例2: isUpToDate
public function isUpToDate()
{
$this->getService('user')->setAttribute('version_check', true, 'dm');
$serverVersion = $this->getLatestServerVersionForBranch(dm::getVersionBranch());
return $this->versionCompare(dm::getVersion(), $serverVersion) >= 0;
}
示例3: initialize
class dmDiemVersionCheckMock extends dmDiemVersionCheck
{
protected function initialize(array $options)
{
parent::initialize($options);
$this->cache = array('5.0' => '5.0.4', '5.1' => '5.1.0-BETA2');
}
}
$versionCheck = $helper->get('diem_version_check', 'dmDiemVersionCheckMock');
dm::setVersion('5.0.0-BETA1');
$t->is(dm::getVersion(), '5.0.0-BETA1', 'Diem version is 5.0.0-BETA1');
$t->ok($versionCheck->shouldCheck(), 'versionCheck should check');
$t->is($versionCheck->getLatestServerVersionForBranch('5.0'), '5.0.4', 'Latest version for 5.0 is 5.0.4');
$t->is($versionCheck->getLatestServerVersionForBranch('5.1'), '5.1.0-BETA2', 'Latest version for 5.1 is 5.1.0-BETA2');
$t->is($versionCheck->isUpToDate(), false, 'Diem is not up to date');
$t->is($versionCheck->getRecommendedUpgrade(), '5.0.4', 'Recommended upgrade is 5.0.4');
dm::setVersion('5.0.4');
$t->is(dm::getVersion(), '5.0.4', 'Diem version is 5.0.4');
$t->ok(!$versionCheck->shouldCheck(), 'versionCheck should not check');
$t->is($versionCheck->getLatestServerVersionForBranch('5.0'), '5.0.4', 'Latest version for 5.0 is 5.0.4');
$t->is($versionCheck->getLatestServerVersionForBranch('5.1'), '5.1.0-BETA2', 'Latest version for 5.1 is 5.1.0-BETA2');
$t->is($versionCheck->isUpToDate(), true, 'Diem is up to date');
$t->is($versionCheck->getRecommendedUpgrade(), null, 'Recommended upgrade is null');
dm::setVersion('5.1.0-ALPHA4');
$t->is(dm::getVersion(), '5.1.0-ALPHA4', 'Diem version is 5.1.0-ALPHA4');
$t->ok(!$versionCheck->shouldCheck(), 'versionCheck should not check');
$t->is($versionCheck->getLatestServerVersionForBranch('5.0'), '5.0.4', 'Latest version for 5.0 is 5.0.4');
$t->is($versionCheck->getLatestServerVersionForBranch('5.1'), '5.1.0-BETA2', 'Latest version for 5.1 is 5.1.0-BETA2');
$t->is($versionCheck->isUpToDate(), false, 'Diem is not up to date');
$t->is($versionCheck->getRecommendedUpgrade(), '5.1.0-BETA2', 'Recommended upgrade is 5.1.0-BETA2');
dm::setVersion(DIEM_VERSION);