dev
This commit is contained in:
parent
68edd0f3ea
commit
428e843ac8
19
src/Extention.php
Normal file
19
src/Extention.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php declare(strict_types=1);
|
||||
namespace JHodges\GiteaBitPHPUnit;
|
||||
|
||||
use PHPUnit\Runner\BeforeFirstTestHook;
|
||||
use PHPUnit\Runner\AfterLastTestHook;
|
||||
|
||||
final class Extension implements BeforeFirstTestHook, AfterLastTestHook{
|
||||
public function executeBeforeFirstTest(): void
|
||||
{
|
||||
// called before the first test is being run
|
||||
echo "AAAAAA";
|
||||
}
|
||||
|
||||
public function executeAfterLastTest(): void
|
||||
{
|
||||
echo "ZZZZZZZ";
|
||||
// called after the last test has been run
|
||||
}
|
||||
}
|
@ -3,9 +3,20 @@ namespace JHodges\GiteaBitPHPUnit;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use PHPUnit\Framework\TestListener;
|
||||
use PHPUnit\Framework\Test as PHPUnit_Framework_Test;
|
||||
use PHPUnit\Framework\Test;
|
||||
use PHPUnit\Framework\AssertionFailedError as PHPUnit_Framework_AssertionFailedError;
|
||||
use PHPUnit\Framework\TestSuite as PHPUnit_Framework_TestSuite;
|
||||
use PHPUnit\Framework\Warning;
|
||||
use Exception;
|
||||
|
||||
class Listener implements TestListener{
|
||||
|
||||
public function addWarning(Test $test, Warning $e, $time)
|
||||
{
|
||||
printf("Warning while running test '%s'.\n", $test->getName());
|
||||
}
|
||||
|
||||
public function addError(PHPUnit_Framework_Test $test, Exception $e, $time)
|
||||
{
|
||||
printf("Error while running test '%s'.\n", $test->getName());
|
||||
|
Loading…
Reference in New Issue
Block a user