本文整理汇总了PHP中PHPUnit_Framework_Test::getAnnotations方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_Test::getAnnotations方法的具体用法?PHP PHPUnit_Framework_Test::getAnnotations怎么用?PHP PHPUnit_Framework_Test::getAnnotations使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_Test
的用法示例。
在下文中一共展示了PHPUnit_Framework_Test::getAnnotations方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: startTest
/**
* @param \PHPUnit_Framework_Test $test
*/
public function startTest(\PHPUnit_Framework_Test $test)
{
$annotations = $test->getAnnotations();
// Intercept a single request per test.
if (\array_key_exists($this->singleIntercept, $annotations['method'])) {
$filename = $annotations['method'][$this->singleIntercept][0];
Http::setSaveFilename($filename);
}
// Intercept multiple request per test.
if (\array_key_exists($this->multiIntercept, $annotations['method'])) {
$filename = $annotations['method'][$this->multiIntercept][0];
Http::persistSaveFile($filename);
}
}
示例2: startTest
/**
* Listener for the start of a test.
*
* @param \PHPUnit_Framework_Test $test
*/
public function startTest(\PHPUnit_Framework_Test $test)
{
$this->timeFrozen = false;
if (!$test instanceof \PHPUnit_Framework_TestCase) {
return;
}
$annotations = $test->getAnnotations();
foreach (['method', 'class'] as $context) {
if (!isset($annotations[$context][$this->annotation])) {
continue;
}
list($time, ) = $annotations[$context][$this->annotation];
$this->freezeTime($time);
break;
}
}
示例3: startTest
/**
* {@inheritdoc}
* @param \PHPUnit_Framework_Test|\PHPUnit_Framework_TestCase $test
*/
public function startTest(\PHPUnit_Framework_Test $test)
{
$this->helper->loadFixture($test->getAnnotations());
}
示例4: endTest
/**
* A test ended.
*
* @param PHPUnit_Framework_Test $test Test case
* @param float $time Time taken
*
* @return void
*/
public function endTest(PHPUnit_Framework_Test $test, $time)
{
$this->runs[] = array('name' => $test->getName(), 'size' => $test->getSize(), 'status' => $test->getStatus(), 'statusMessage' => $test->getStatusMessage(), 'assertions' => $test->getNumAssertions(), 'result' => $test->getResult(), 'annotations' => $test->getAnnotations(), 'timeTaken' => $time, 'output' => $test->getActualOutput());
}
示例5: startTest
/**
* A test started.
*
* @param PHPUnit_Framework_Test $test
*/
public function startTest(PHPUnit_Framework_Test $test)
{
if ($test instanceof \PHPUnit_Framework_TestCase) {
$annotations = $test->getAnnotations();
if (isset($annotations['method'][$this->annotationName])) {
$annotationValue = preg_replace('/\\s+/', '', $annotations['method'][$this->annotationName][0]);
$annotationValue = explode(',', $annotationValue);
$fakerino = Fakerino\Fakerino::create();
$fakeData = $fakerino->fake($annotationValue)->toArray();
$test->setDependencyInput($fakeData);
}
}
}