本文整理汇总了PHP中Rule::isVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Rule::isVersion方法的具体用法?PHP Rule::isVersion怎么用?PHP Rule::isVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rule
的用法示例。
在下文中一共展示了Rule::isVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testAboveVersion
/**
* Test the version evaluation
*
* @covers \Psecio\Iniscan\Rule::isVersion
*/
public function testAboveVersion()
{
// a very old PHP release...please tell me you're not using it
$phpVersion = '3.0';
$rule = new Rule(array(), 'testing');
// Ensure that the running version is fine
$this->assertTrue($rule->isVersion($phpVersion));
// Assume we're using 5.6 for now
$rule->setVersion('5.6');
// 5.6 > 3.0, so we get true
$this->assertTrue($rule->isVersion($phpVersion));
// Newer flavourful versions
$phpVersion = '7.0';
// 5.6 < 7.0, so we get false
$this->assertNotTrue($rule->isVersion($phpVersion));
}
示例2: testAboveVersion
/**
* Test the version evaluation
*
* @covers \Psecio\Iniscan\Rule::isVersion
*/
public function testAboveVersion()
{
// a very old PHP release...please tell me you're not using it
$phpVersion = '3.0';
$rule = new Rule(array(), 'testing');
$this->assertTrue($rule->isVersion($phpVersion));
}