本文整理汇总了PHP中PHPUnit_Framework_TestFailure::failedTest方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Framework_TestFailure::failedTest方法的具体用法?PHP PHPUnit_Framework_TestFailure::failedTest怎么用?PHP PHPUnit_Framework_TestFailure::failedTest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Framework_TestFailure
的用法示例。
在下文中一共展示了PHPUnit_Framework_TestFailure::failedTest方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printDefect
protected function printDefect(\PHPUnit_Framework_TestFailure $defect, $count)
{
$failedTest = $defect->failedTest();
if (!$failedTest instanceof \Codeception\TestCase) {
return parent::printDefect($defect, $count);
}
$this->dispatcher->dispatch('fail.print', new \Codeception\Event\Fail($defect->failedTest(), $defect->thrownException()));
}
示例2: printDefectHeader
/**
* @param \PHPUnit_Framework_TestFailure $defect
* @param integer $count
*/
protected function printDefectHeader(\PHPUnit_Framework_TestFailure $defect, $count)
{
$failedTest = $defect->failedTest();
if ($failedTest instanceof \PHPUnit_Framework_SelfDescribing) {
$testName = $failedTest->toString();
} else {
$testName = get_class($failedTest);
}
$buffer = sprintf("\n%d) %s\n", $count, $testName);
$this->write($buffer);
$this->writeResults($buffer);
}
示例3: printDefect
protected function printDefect(\PHPUnit_Framework_TestFailure $defect, $count)
{
$this->write("\n---------\n");
$this->dispatcher->dispatch(Events::TEST_FAIL_PRINT, new FailEvent($defect->failedTest(), $defect->thrownException(), $count));
}
示例4: printDefectHeader
/**
* @param PHPUnit_Framework_TestFailure $defect
* @param integer $count
* @param boolean $failOrError
*/
protected function printDefectHeader(PHPUnit_Framework_TestFailure $defect, $count, $failOrError = true)
{
$failedTest = $defect->failedTest();
if ($failedTest instanceof PHPUnit_Framework_SelfDescribing) {
$testName = $failedTest->toString();
} else {
$testName = get_class($failedTest);
}
if ($failOrError) {
$this->write(sprintf("\n %d) %s", $count, $testName));
} else {
$this->write(sprintf(" %s", $this->yellow($testName)));
}
}
示例5: printDefectHeader
/**
* @param PHPUnit_Framework_TestFailure $defect
* @param integer $count
* @access protected
*/
protected function printDefectHeader(PHPUnit_Framework_TestFailure $defect)
{
$failedTest = $defect->failedTest();
if ($failedTest instanceof PHPUnit_Framework_SelfDescribing) {
$testName = $failedTest->toString();
} else {
$testName = get_class($failedTest);
}
$this->write("<name>{$testName}</name>");
}
示例6: printDefect
protected function printDefect(\PHPUnit_Framework_TestFailure $defect, $count)
{
$this->write("\n---------\n");
$this->dispatcher->dispatch('test.fail.print', new \Codeception\Event\Fail($defect->failedTest(), $defect->thrownException(), $count));
}
示例7: printDefectHeader
/**
* @param PHPUnit_Framework_TestFailure $defect
* @param integer $count
* @access protected
*/
protected function printDefectHeader(PHPUnit_Framework_TestFailure $defect, $count)
{
$failedTest = $defect->failedTest();
if ($failedTest instanceof PHPUnit_Framework_SelfDescribing) {
$testName = $failedTest->toString();
} else {
$testName = get_class($failedTest);
}
$this->write(sprintf("<table class='CopixTable'><tr><td>%d</td><td> %s</td></tr>", $count, $testName));
}
示例8: printDefectHeader
/**
* @param PHPUnit_Framework_TestFailure $defect
* @param integer $count
* @access protected
*/
protected function printDefectHeader(PHPUnit_Framework_TestFailure $defect, $count)
{
$name = $defect->failedTest()->getName();
if ($name == null) {
$class = new Reflection_Class($defect->failedTest());
$name = $class->name;
}
printf("%d) %s\n", $count, $name);
}