8889841chome/clixcotz/mars.clix.co.tz/vendor/phpunit/phpunit/src/Util/TestDox/HtmlResultPrinter.php 0000666 00000006511 15053376515 0026241 0 ustar 00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace PHPUnit\Util\TestDox;
use function sprintf;
use PHPUnit\Framework\TestResult;
/**
* @internal This class is not covered by the backward compatibility promise for PHPUnit
*/
final class HtmlResultPrinter extends ResultPrinter
{
/**
* @var string
*/
private const PAGE_HEADER = <<<'EOT'
Test Documentation
EOT;
/**
* @var string
*/
private const CLASS_HEADER = <<<'EOT'
%s
EOT;
/**
* @var string
*/
private const CLASS_FOOTER = <<<'EOT'
EOT;
/**
* @var string
*/
private const PAGE_FOOTER = <<<'EOT'
EOT;
public function printResult(TestResult $result): void
{
}
/**
* Handler for 'start run' event.
*/
protected function startRun(): void
{
$this->write(self::PAGE_HEADER);
}
/**
* Handler for 'start class' event.
*/
protected function startClass(string $name): void
{
$this->write(
sprintf(
self::CLASS_HEADER,
$this->currentTestClassPrettified
)
);
}
/**
* Handler for 'on test' event.
*/
protected function onTest(string $name, bool $success = true): void
{
$this->write(
sprintf(
" %s\n",
$success ? 'success' : 'defect',
$name
)
);
}
/**
* Handler for 'end class' event.
*/
protected function endClass(string $name): void
{
$this->write(self::CLASS_FOOTER);
}
/**
* Handler for 'end run' event.
*/
protected function endRun(): void
{
$this->write(self::PAGE_FOOTER);
}
}