mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Implementing skipped tests message in html reporter
This commit is contained in:
parent
f7949d6ace
commit
d7803dc7bf
2 changed files with 7 additions and 3 deletions
|
@ -259,6 +259,7 @@ class CakeBaseReporter implements PHPUnit_Framework_TestListener {
|
||||||
* @param float $time
|
* @param float $time
|
||||||
*/
|
*/
|
||||||
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
|
public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) {
|
||||||
|
$this->paintSkip($e, $test);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -265,7 +265,9 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
||||||
$context = $message->getTrace();
|
$context = $message->getTrace();
|
||||||
$realContext = $context[3];
|
$realContext = $context[3];
|
||||||
$class = new ReflectionClass($realContext['class']);
|
$class = new ReflectionClass($realContext['class']);
|
||||||
if ($class->getParentClass()->getName() === 'PHPUnit_Framework_TestCase') {
|
$deeper = $class->getParentClass()->getName() === 'PHPUnit_Framework_TestCase';
|
||||||
|
$deeper = $deeper || !$class->isSubclassOf('PHPUnit_Framework_TestCase');
|
||||||
|
if ($deeper) {
|
||||||
$realContext = $context[4];
|
$realContext = $context[4];
|
||||||
$context = $context[3];
|
$context = $context[3];
|
||||||
} else {
|
} else {
|
||||||
|
@ -342,12 +344,13 @@ class CakeHtmlReporter extends CakeBaseReporter {
|
||||||
* Prints the message for skipping tests.
|
* Prints the message for skipping tests.
|
||||||
*
|
*
|
||||||
* @param string $message Text of skip condition.
|
* @param string $message Text of skip condition.
|
||||||
|
* @param PHPUnit_Framework_TestCase $test the test method skipped
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function paintSkip($message) {
|
public function paintSkip($message, $test) {
|
||||||
echo "<li class='skipped'>\n";
|
echo "<li class='skipped'>\n";
|
||||||
echo "<span>Skipped</span> ";
|
echo "<span>Skipped</span> ";
|
||||||
echo $this->_htmlEntities($message);
|
echo $test->getName() . ': ' . $this->_htmlEntities($message->getMessage());
|
||||||
echo "</li>\n";
|
echo "</li>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue