本文整理汇总了PHP中Composer\Package\Version\VersionParser::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP VersionParser::expects方法的具体用法?PHP VersionParser::expects怎么用?PHP VersionParser::expects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Package\Version\VersionParser
的用法示例。
在下文中一共展示了VersionParser::expects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testCheckPhpVersionFailed
public function testCheckPhpVersionFailed()
{
$this->composerInfo->expects($this->once())->method('getRequiredPhpVersion')->willReturn('1.0');
$multipleConstraints = $this->getMockForAbstractClass('Composer\\Package\\LinkConstraint\\LinkConstraintInterface', [], '', false);
$this->versionParser->expects($this->at(0))->method('parseConstraints')->willReturn($multipleConstraints);
$this->versionParser->expects($this->at(1))->method('normalize')->willReturn('1.0');
$currentPhpVersion = $this->getMockForAbstractClass('Composer\\Package\\LinkConstraint\\LinkConstraintInterface', [], '', false);
$this->versionParser->expects($this->at(2))->method('parseConstraints')->willReturn($currentPhpVersion);
$multipleConstraints->expects($this->once())->method('matches')->willReturn(false);
$expected = ['responseType' => ResponseTypeInterface::RESPONSE_TYPE_ERROR, 'data' => ['required' => 1.0, 'current' => PHP_VERSION]];
$this->assertEquals($expected, $this->phpReadinessCheck->checkPhpVersion());
}