Class Yiisoft\Yii\Debug\Api\Inspector\Test\PHPUnitJSONReporter
| Inheritance | Yiisoft\Yii\Debug\Api\Inspector\Test\PHPUnitJSONReporter |
|---|---|
| Implements | PHPUnit\TextUI\ResultPrinter |
Public Methods
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| ENVIRONMENT_VARIABLE_DIRECTORY_NAME | 'REPORTER_OUTPUT_PATH' | Yiisoft\Yii\Debug\Api\Inspector\Test\PHPUnitJSONReporter | |
| FILENAME | 'phpunit-report.json' | Yiisoft\Yii\Debug\Api\Inspector\Test\PHPUnitJSONReporter |
Method Details
| public mixed __construct ( ) |
public function __construct()
{
$this->prettifier = new NamePrettifier();
}
| public void addError ( \PHPUnit\Framework\Test $test, Throwable $t, float $time ) | ||
| $test | \PHPUnit\Framework\Test | |
| $t | Throwable | |
| $time | float | |
public function addError(Test $test, Throwable $t, float $time): void
{
$this->logErroredTest($test, $t);
}
| public void addFailure ( \PHPUnit\Framework\Test $test, \PHPUnit\Framework\AssertionFailedError $e, float $time ) | ||
| $test | \PHPUnit\Framework\Test | |
| $e | \PHPUnit\Framework\AssertionFailedError | |
| $time | float | |
public function addFailure(Test $test, AssertionFailedError $e, float $time): void
{
$this->logErroredTest($test, $e);
}
| public void addIncompleteTest ( \PHPUnit\Framework\Test $test, Throwable $t, float $time ) | ||
| $test | \PHPUnit\Framework\Test | |
| $t | Throwable | |
| $time | float | |
public function addIncompleteTest(Test $test, Throwable $t, float $time): void
{
$this->logErroredTest($test, $t);
}
| public void addRiskyTest ( \PHPUnit\Framework\Test $test, Throwable $t, float $time ) | ||
| $test | \PHPUnit\Framework\Test | |
| $t | Throwable | |
| $time | float | |
public function addRiskyTest(Test $test, Throwable $t, float $time): void
{
$this->logErroredTest($test, $t);
}
| public void addSkippedTest ( \PHPUnit\Framework\Test $test, Throwable $t, float $time ) | ||
| $test | \PHPUnit\Framework\Test | |
| $t | Throwable | |
| $time | float | |
public function addSkippedTest(Test $test, Throwable $t, float $time): void
{
$this->logErroredTest($test, $t);
}
| public void addWarning ( \PHPUnit\Framework\Test $test, \PHPUnit\Framework\Warning $e, float $time ) | ||
| $test | \PHPUnit\Framework\Test | |
| $e | \PHPUnit\Framework\Warning | |
| $time | float | |
public function addWarning(Test $test, Warning $e, float $time): void
{
$this->logErroredTest($test, $e);
}
| public void endTest ( \PHPUnit\Framework\Test $test, float $time ) | ||
| $test | \PHPUnit\Framework\Test | |
| $time | float | |
public function endTest(Test $test, float $time): void
{
if (!$test instanceof TestCase) {
return;
}
if ($test->getStatus() !== BaseTestRunner::STATUS_PASSED) {
return;
}
$parsedName = $this->parseName($test);
$this->data[$parsedName] = [
'file' => $this->parseFilename($test),
'test' => $parsedName,
'status' => 'ok',
'stacktrace' => [],
];
}
| public void endTestSuite ( \PHPUnit\Framework\TestSuite $suite ) | ||
| $suite | \PHPUnit\Framework\TestSuite | |
public function endTestSuite(TestSuite $suite): void
{
}
| public void printResult ( \PHPUnit\Framework\TestResult $result ) | ||
| $result | \PHPUnit\Framework\TestResult | |
public function printResult(TestResult $result): void
{
$path = getenv(self::ENVIRONMENT_VARIABLE_DIRECTORY_NAME) ?: getcwd();
ksort($this->data);
file_put_contents(
$path . DIRECTORY_SEPARATOR . self::FILENAME,
json_encode(array_values($this->data), JSON_THROW_ON_ERROR)
);
}
| public void startTest ( \PHPUnit\Framework\Test $test ) | ||
| $test | \PHPUnit\Framework\Test | |
public function startTest(Test $test): void
{
}
| public void startTestSuite ( \PHPUnit\Framework\TestSuite $suite ) | ||
| $suite | \PHPUnit\Framework\TestSuite | |
public function startTestSuite(TestSuite $suite): void
{
}
Signup or Login in order to comment.