本文整理匯總了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'));
}