本文整理汇总了PHP中PHPUnit_Util_Test::getRequirements方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Util_Test::getRequirements方法的具体用法?PHP PHPUnit_Util_Test::getRequirements怎么用?PHP PHPUnit_Util_Test::getRequirements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Util_Test
的用法示例。
在下文中一共展示了PHPUnit_Util_Test::getRequirements方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetRequirements
public function testGetRequirements()
{
$this->assertEquals(array(), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testOne'));
$this->assertEquals(array('PHPUnit' => '1.0'), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testTwo'));
$this->assertEquals(array('PHP' => '2.0'), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testThree'));
$this->assertEquals(array('PHPUnit' => '2.0', 'PHP' => '1.0'), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testFour'));
}
示例2: testGetRequirements
public function testGetRequirements()
{
$this->assertEquals(array(), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testOne'));
$this->assertEquals(array('PHPUnit' => '1.0'), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testTwo'));
$this->assertEquals(array('PHP' => '2.0'), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testThree'));
$this->assertEquals(array('PHPUnit' => '2.0', 'PHP' => '1.0'), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testFour'));
$this->assertEquals(array('PHP' => '5.4.0RC6'), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testFive'));
$this->assertEquals(array('PHP' => '5.4.0-alpha1'), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testSix'));
$this->assertEquals(array('PHP' => '5.4.0beta2'), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testSeven'));
$this->assertEquals(array('PHP' => '5.4-dev'), PHPUnit_Util_Test::getRequirements('RequirementsTest', 'testEight'));
}
示例3: setRequirementsFromAnnotation
/**
* @since Method available since Release 3.6.0
*/
protected function setRequirementsFromAnnotation()
{
try {
$requirements = PHPUnit_Util_Test::getRequirements(get_class($this), $this->name);
if (isset($requirements['PHP'])) {
$this->required['PHP'] = $requirements['PHP'];
}
if (isset($requirements['PHPUnit'])) {
$this->required['PHPUnit'] = $requirements['PHPUnit'];
}
if (isset($requirements['extensions'])) {
$this->required['extensions'] = $requirements['extensions'];
}
if (isset($requirements['functions'])) {
$this->required['functions'] = $requirements['functions'];
}
} catch (ReflectionException $e) {
}
}
示例4: testGetRequirementsMergesClassAndMethodDocBlocks
/**
* @covers PHPUnit_Util_Test::getRequirements
*/
public function testGetRequirementsMergesClassAndMethodDocBlocks()
{
$expectedAnnotations = array('PHP' => '5.4', 'PHPUnit' => '3.7', 'OS' => '/WINNT/i', 'functions' => array('testFuncClass', 'testFuncMethod'), 'extensions' => array('testExtClass', 'testExtMethod'));
$this->assertEquals($expectedAnnotations, PHPUnit_Util_Test::getRequirements('RequirementsClassDocBlockTest', 'testMethod'));
}