One Hat Cyber Team
Your IP:
216.73.216.163
Server IP:
198.54.114.155
Server:
Linux server71.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
Server Software:
LiteSpeed
PHP Version:
5.6.40
Create File
|
Create Folder
Execute
Dir :
~
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
cwd
/
Edit File:
Logging.tar
TeamCity/TeamCityLogger.php 0000644 00000024261 15112505657 0011667 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; use function assert; use function getmypid; use function ini_get; use function is_a; use function round; use function sprintf; use function str_replace; use function stripos; use PHPUnit\Event\Code\TestMethod; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\Event; use PHPUnit\Event\EventFacadeIsSealedException; use PHPUnit\Event\Facade; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Telemetry\HRTime; use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\TestSuite\Finished as TestSuiteFinished; use PHPUnit\Event\TestSuite\Started as TestSuiteStarted; use PHPUnit\Event\TestSuite\TestSuiteForTestClass; use PHPUnit\Event\TestSuite\TestSuiteForTestMethodWithDataProvider; use PHPUnit\Event\UnknownSubscriberTypeException; use PHPUnit\Framework\Exception as FrameworkException; use PHPUnit\TextUI\Output\Printer; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TeamCityLogger { private readonly Printer $printer; private bool $isSummaryTestCountPrinted = false; private ?HRTime $time = null; private ?int $flowId; /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ public function __construct(Printer $printer, Facade $facade) { $this->printer = $printer; $this->registerSubscribers($facade); $this->setFlowId(); } public function testSuiteStarted(TestSuiteStarted $event): void { $testSuite = $event->testSuite(); if (!$this->isSummaryTestCountPrinted) { $this->isSummaryTestCountPrinted = true; $this->writeMessage( 'testCount', ['count' => $testSuite->count()], ); } $parameters = ['name' => $testSuite->name()]; if ($testSuite->isForTestClass()) { assert($testSuite instanceof TestSuiteForTestClass); $parameters['locationHint'] = sprintf( 'php_qn://%s::\\%s', $testSuite->file(), $testSuite->name(), ); } elseif ($testSuite->isForTestMethodWithDataProvider()) { assert($testSuite instanceof TestSuiteForTestMethodWithDataProvider); $parameters['locationHint'] = sprintf( 'php_qn://%s::\\%s', $testSuite->file(), $testSuite->name(), ); $parameters['name'] = $testSuite->methodName(); } $this->writeMessage('testSuiteStarted', $parameters); } public function testSuiteFinished(TestSuiteFinished $event): void { $testSuite = $event->testSuite(); $parameters = ['name' => $testSuite->name()]; if ($testSuite->isForTestMethodWithDataProvider()) { assert($testSuite instanceof TestSuiteForTestMethodWithDataProvider); $parameters['name'] = $testSuite->methodName(); } $this->writeMessage('testSuiteFinished', $parameters); } public function testPrepared(Prepared $event): void { $test = $event->test(); $parameters = [ 'name' => $test->name(), ]; if ($test->isTestMethod()) { assert($test instanceof TestMethod); $parameters['locationHint'] = sprintf( 'php_qn://%s::\\%s::%s', $test->file(), $test->className(), $test->methodName(), ); } $this->writeMessage('testStarted', $parameters); $this->time = $event->telemetryInfo()->time(); } /** * @throws InvalidArgumentException */ public function testMarkedIncomplete(MarkedIncomplete $event): void { if ($this->time === null) { $this->time = $event->telemetryInfo()->time(); } $this->writeMessage( 'testIgnored', [ 'name' => $event->test()->name(), 'message' => $event->throwable()->message(), 'details' => $this->details($event->throwable()), 'duration' => $this->duration($event), ], ); } /** * @throws InvalidArgumentException */ public function testSkipped(Skipped $event): void { if ($this->time === null) { $this->time = $event->telemetryInfo()->time(); } $parameters = [ 'name' => $event->test()->name(), 'message' => $event->message(), ]; $parameters['duration'] = $this->duration($event); $this->writeMessage('testIgnored', $parameters); } /** * @throws InvalidArgumentException */ public function testErrored(Errored $event): void { if ($this->time === null) { $this->time = $event->telemetryInfo()->time(); } $this->writeMessage( 'testFailed', [ 'name' => $event->test()->name(), 'message' => $this->message($event->throwable()), 'details' => $this->details($event->throwable()), 'duration' => $this->duration($event), ], ); } /** * @throws InvalidArgumentException */ public function testFailed(Failed $event): void { if ($this->time === null) { $this->time = $event->telemetryInfo()->time(); } $parameters = [ 'name' => $event->test()->name(), 'message' => $this->message($event->throwable()), 'details' => $this->details($event->throwable()), 'duration' => $this->duration($event), ]; if ($event->hasComparisonFailure()) { $parameters['type'] = 'comparisonFailure'; $parameters['actual'] = $event->comparisonFailure()->actual(); $parameters['expected'] = $event->comparisonFailure()->expected(); } $this->writeMessage('testFailed', $parameters); } /** * @throws InvalidArgumentException */ public function testConsideredRisky(ConsideredRisky $event): void { if ($this->time === null) { $this->time = $event->telemetryInfo()->time(); } $this->writeMessage( 'testFailed', [ 'name' => $event->test()->name(), 'message' => $event->message(), 'details' => '', 'duration' => $this->duration($event), ], ); } /** * @throws InvalidArgumentException */ public function testFinished(Finished $event): void { $this->writeMessage( 'testFinished', [ 'name' => $event->test()->name(), 'duration' => $this->duration($event), ], ); $this->time = null; } public function flush(): void { $this->printer->flush(); } /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ private function registerSubscribers(Facade $facade): void { $facade->registerSubscribers( new TestSuiteStartedSubscriber($this), new TestSuiteFinishedSubscriber($this), new TestPreparedSubscriber($this), new TestFinishedSubscriber($this), new TestErroredSubscriber($this), new TestFailedSubscriber($this), new TestMarkedIncompleteSubscriber($this), new TestSkippedSubscriber($this), new TestConsideredRiskySubscriber($this), new TestRunnerExecutionFinishedSubscriber($this), ); } private function setFlowId(): void { if (stripos(ini_get('disable_functions'), 'getmypid') === false) { $this->flowId = getmypid(); } } private function writeMessage(string $eventName, array $parameters = []): void { $this->printer->print( sprintf( "\n##teamcity[%s", $eventName, ), ); if ($this->flowId !== null) { $parameters['flowId'] = $this->flowId; } foreach ($parameters as $key => $value) { $this->printer->print( sprintf( " %s='%s'", $key, $this->escape((string) $value), ), ); } $this->printer->print("]\n"); } /** * @throws InvalidArgumentException */ private function duration(Event $event): int { if ($this->time === null) { return 0; } return (int) round($event->telemetryInfo()->time()->duration($this->time)->asFloat() * 1000); } private function escape(string $string): string { return str_replace( ['|', "'", "\n", "\r", ']', '['], ['||', "|'", '|n', '|r', '|]', '|['], $string, ); } private function message(Throwable $throwable): string { if (is_a($throwable->className(), FrameworkException::class, true)) { return $throwable->message(); } $buffer = $throwable->className(); if (!empty($throwable->message())) { $buffer .= ': ' . $throwable->message(); } return $buffer; } private function details(Throwable $throwable): string { $buffer = $throwable->stackTrace(); while ($throwable->hasPrevious()) { $throwable = $throwable->previous(); $buffer .= sprintf( "\nCaused by\n%s\n%s", $throwable->description(), $throwable->stackTrace(), ); } return $buffer; } } TeamCity/Subscriber/TestSkippedSubscriber.php 0000644 00000001363 15112505657 0015374 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\Test\SkippedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber { /** * @throws InvalidArgumentException */ public function notify(Skipped $event): void { $this->logger()->testSkipped($event); } } TeamCity/Subscriber/Subscriber.php 0000644 00000001217 15112505657 0013212 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class Subscriber { private readonly TeamCityLogger $logger; public function __construct(TeamCityLogger $logger) { $this->logger = $logger; } protected function logger(): TeamCityLogger { return $this->logger; } } TeamCity/Subscriber/TestSuiteFinishedSubscriber.php 0000644 00000001251 15112505657 0016534 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; use PHPUnit\Event\TestSuite\Finished; use PHPUnit\Event\TestSuite\FinishedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteFinishedSubscriber extends Subscriber implements FinishedSubscriber { public function notify(Finished $event): void { $this->logger()->testSuiteFinished($event); } } TeamCity/Subscriber/TestMarkedIncompleteSubscriber.php 0000644 00000001451 15112505657 0017216 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\MarkedIncompleteSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber { /** * @throws InvalidArgumentException */ public function notify(MarkedIncomplete $event): void { $this->logger()->testMarkedIncomplete($event); } } TeamCity/Subscriber/TestRunnerExecutionFinishedSubscriber.php 0000644 00000001307 15112505657 0020602 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; use PHPUnit\Event\TestRunner\ExecutionFinished; use PHPUnit\Event\TestRunner\ExecutionFinishedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestRunnerExecutionFinishedSubscriber extends Subscriber implements ExecutionFinishedSubscriber { public function notify(ExecutionFinished $event): void { $this->logger()->flush(); } } TeamCity/Subscriber/TestConsideredRiskySubscriber.php 0000644 00000001443 15112505657 0017075 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\ConsideredRiskySubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestConsideredRiskySubscriber extends Subscriber implements ConsideredRiskySubscriber { /** * @throws InvalidArgumentException */ public function notify(ConsideredRisky $event): void { $this->logger()->testConsideredRisky($event); } } TeamCity/Subscriber/TestFailedSubscriber.php 0000644 00000001355 15112505657 0015162 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\FailedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFailedSubscriber extends Subscriber implements FailedSubscriber { /** * @throws InvalidArgumentException */ public function notify(Failed $event): void { $this->logger()->testFailed($event); } } TeamCity/Subscriber/TestSuiteStartedSubscriber.php 0000644 00000001243 15112505657 0016412 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; use PHPUnit\Event\TestSuite\Started; use PHPUnit\Event\TestSuite\StartedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteStartedSubscriber extends Subscriber implements StartedSubscriber { public function notify(Started $event): void { $this->logger()->testSuiteStarted($event); } } TeamCity/Subscriber/TestFinishedSubscriber.php 0000644 00000001371 15112505657 0015525 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\FinishedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFinishedSubscriber extends Subscriber implements FinishedSubscriber { /** * @throws InvalidArgumentException */ public function notify(Finished $event): void { $this->logger()->testFinished($event); } } TeamCity/Subscriber/TestErroredSubscriber.php 0000644 00000001363 15112505657 0015377 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\ErroredSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestErroredSubscriber extends Subscriber implements ErroredSubscriber { /** * @throws InvalidArgumentException */ public function notify(Errored $event): void { $this->logger()->testErrored($event); } } TeamCity/Subscriber/error_log 0000644 00000007125 15112505657 0012317 0 ustar 00 [27-Nov-2025 22:27:42 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TeamCity\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestErroredSubscriber.php:19 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestErroredSubscriber.php on line 19 [27-Nov-2025 23:07:32 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TeamCity\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFinishedSubscriber.php:19 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFinishedSubscriber.php on line 19 [27-Nov-2025 23:07:40 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TeamCity\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSkippedSubscriber.php:19 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSkippedSubscriber.php on line 19 [27-Nov-2025 23:29:18 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TeamCity\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestRunnerExecutionFinishedSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestRunnerExecutionFinishedSubscriber.php on line 18 [27-Nov-2025 23:29:34 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TeamCity\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFailedSubscriber.php:19 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestFailedSubscriber.php on line 19 [27-Nov-2025 23:30:59 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TeamCity\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestMarkedIncompleteSubscriber.php:19 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestMarkedIncompleteSubscriber.php on line 19 [27-Nov-2025 23:33:09 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TeamCity\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestPreparedSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestPreparedSubscriber.php on line 18 [28-Nov-2025 00:06:40 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TeamCity\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestConsideredRiskySubscriber.php:19 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestConsideredRiskySubscriber.php on line 19 [28-Nov-2025 00:08:39 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TeamCity\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteStartedSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TeamCity/Subscriber/TestSuiteStartedSubscriber.php on line 18 TeamCity/Subscriber/TestPreparedSubscriber.php 0000644 00000001225 15112505657 0015534 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TeamCity; use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\PreparedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestPreparedSubscriber extends Subscriber implements PreparedSubscriber { public function notify(Prepared $event): void { $this->logger()->testPrepared($event); } } JUnit/JunitXmlLogger.php 0000644 00000030630 15112505657 0011231 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\JUnit; use function assert; use function basename; use function is_int; use function sprintf; use function str_replace; use function trim; use DOMDocument; use DOMElement; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Code\TestMethod; use PHPUnit\Event\EventFacadeIsSealedException; use PHPUnit\Event\Facade; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Telemetry\HRTime; use PHPUnit\Event\Telemetry\Info; use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; use PHPUnit\Event\TestSuite\Started; use PHPUnit\Event\UnknownSubscriberTypeException; use PHPUnit\TextUI\Output\Printer; use PHPUnit\Util\Xml; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class JunitXmlLogger { private readonly Printer $printer; private DOMDocument $document; private DOMElement $root; /** * @var DOMElement[] */ private array $testSuites = []; /** * @psalm-var array<int,int> */ private array $testSuiteTests = [0]; /** * @psalm-var array<int,int> */ private array $testSuiteAssertions = [0]; /** * @psalm-var array<int,int> */ private array $testSuiteErrors = [0]; /** * @psalm-var array<int,int> */ private array $testSuiteFailures = [0]; /** * @psalm-var array<int,int> */ private array $testSuiteSkipped = [0]; /** * @psalm-var array<int,int> */ private array $testSuiteTimes = [0]; private int $testSuiteLevel = 0; private ?DOMElement $currentTestCase = null; private ?HRTime $time = null; private bool $prepared = false; /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ public function __construct(Printer $printer, Facade $facade) { $this->printer = $printer; $this->registerSubscribers($facade); $this->createDocument(); } public function flush(): void { $this->printer->print($this->document->saveXML()); $this->printer->flush(); } public function testSuiteStarted(Started $event): void { $testSuite = $this->document->createElement('testsuite'); $testSuite->setAttribute('name', $event->testSuite()->name()); if ($event->testSuite()->isForTestClass()) { $testSuite->setAttribute('file', $event->testSuite()->file()); } if ($this->testSuiteLevel > 0) { $this->testSuites[$this->testSuiteLevel]->appendChild($testSuite); } else { $this->root->appendChild($testSuite); } $this->testSuiteLevel++; $this->testSuites[$this->testSuiteLevel] = $testSuite; $this->testSuiteTests[$this->testSuiteLevel] = 0; $this->testSuiteAssertions[$this->testSuiteLevel] = 0; $this->testSuiteErrors[$this->testSuiteLevel] = 0; $this->testSuiteFailures[$this->testSuiteLevel] = 0; $this->testSuiteSkipped[$this->testSuiteLevel] = 0; $this->testSuiteTimes[$this->testSuiteLevel] = 0; } public function testSuiteFinished(): void { $this->testSuites[$this->testSuiteLevel]->setAttribute( 'tests', (string) $this->testSuiteTests[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'assertions', (string) $this->testSuiteAssertions[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'errors', (string) $this->testSuiteErrors[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'failures', (string) $this->testSuiteFailures[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'skipped', (string) $this->testSuiteSkipped[$this->testSuiteLevel], ); $this->testSuites[$this->testSuiteLevel]->setAttribute( 'time', sprintf('%F', $this->testSuiteTimes[$this->testSuiteLevel]), ); if ($this->testSuiteLevel > 1) { $this->testSuiteTests[$this->testSuiteLevel - 1] += $this->testSuiteTests[$this->testSuiteLevel]; $this->testSuiteAssertions[$this->testSuiteLevel - 1] += $this->testSuiteAssertions[$this->testSuiteLevel]; $this->testSuiteErrors[$this->testSuiteLevel - 1] += $this->testSuiteErrors[$this->testSuiteLevel]; $this->testSuiteFailures[$this->testSuiteLevel - 1] += $this->testSuiteFailures[$this->testSuiteLevel]; $this->testSuiteSkipped[$this->testSuiteLevel - 1] += $this->testSuiteSkipped[$this->testSuiteLevel]; $this->testSuiteTimes[$this->testSuiteLevel - 1] += $this->testSuiteTimes[$this->testSuiteLevel]; } $this->testSuiteLevel--; } /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ public function testPrepared(Prepared $event): void { $this->createTestCase($event); $this->prepared = true; } /** * @throws InvalidArgumentException */ public function testFinished(Finished $event): void { $this->handleFinish($event->telemetryInfo(), $event->numberOfAssertionsPerformed()); } /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ public function testMarkedIncomplete(MarkedIncomplete $event): void { $this->handleIncompleteOrSkipped($event); } /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ public function testSkipped(Skipped $event): void { $this->handleIncompleteOrSkipped($event); } /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ public function testErrored(Errored $event): void { $this->handleFault($event, 'error'); $this->testSuiteErrors[$this->testSuiteLevel]++; } /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ public function testFailed(Failed $event): void { $this->handleFault($event, 'failure'); $this->testSuiteFailures[$this->testSuiteLevel]++; } /** * @throws InvalidArgumentException */ private function handleFinish(Info $telemetryInfo, int $numberOfAssertionsPerformed): void { assert($this->currentTestCase !== null); assert($this->time !== null); $time = $telemetryInfo->time()->duration($this->time)->asFloat(); $this->testSuiteAssertions[$this->testSuiteLevel] += $numberOfAssertionsPerformed; $this->currentTestCase->setAttribute( 'assertions', (string) $numberOfAssertionsPerformed, ); $this->currentTestCase->setAttribute( 'time', sprintf('%F', $time), ); $this->testSuites[$this->testSuiteLevel]->appendChild( $this->currentTestCase, ); $this->testSuiteTests[$this->testSuiteLevel]++; $this->testSuiteTimes[$this->testSuiteLevel] += $time; $this->currentTestCase = null; $this->time = null; $this->prepared = false; } /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ private function registerSubscribers(Facade $facade): void { $facade->registerSubscribers( new TestSuiteStartedSubscriber($this), new TestSuiteFinishedSubscriber($this), new TestPreparedSubscriber($this), new TestFinishedSubscriber($this), new TestErroredSubscriber($this), new TestFailedSubscriber($this), new TestMarkedIncompleteSubscriber($this), new TestSkippedSubscriber($this), new TestRunnerExecutionFinishedSubscriber($this), ); } private function createDocument(): void { $this->document = new DOMDocument('1.0', 'UTF-8'); $this->document->formatOutput = true; $this->root = $this->document->createElement('testsuites'); $this->document->appendChild($this->root); } /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ private function handleFault(Errored|Failed $event, string $type): void { if (!$this->prepared) { $this->createTestCase($event); } assert($this->currentTestCase !== null); $buffer = $this->testAsString($event->test()); $throwable = $event->throwable(); $buffer .= trim( $throwable->description() . PHP_EOL . $throwable->stackTrace(), ); $fault = $this->document->createElement( $type, Xml::prepareString($buffer), ); $fault->setAttribute('type', $throwable->className()); $this->currentTestCase->appendChild($fault); if (!$this->prepared) { $this->handleFinish($event->telemetryInfo(), 0); } } /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ private function handleIncompleteOrSkipped(MarkedIncomplete|Skipped $event): void { if (!$this->prepared) { $this->createTestCase($event); } assert($this->currentTestCase !== null); $skipped = $this->document->createElement('skipped'); $this->currentTestCase->appendChild($skipped); $this->testSuiteSkipped[$this->testSuiteLevel]++; if (!$this->prepared) { $this->handleFinish($event->telemetryInfo(), 0); } } /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ private function testAsString(Test $test): string { if ($test->isPhpt()) { return basename($test->file()); } assert($test instanceof TestMethod); return sprintf( '%s::%s%s', $test->className(), $this->name($test), PHP_EOL, ); } /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ private function name(Test $test): string { if ($test->isPhpt()) { return basename($test->file()); } assert($test instanceof TestMethod); if (!$test->testData()->hasDataFromDataProvider()) { return $test->methodName(); } $dataSetName = $test->testData()->dataFromDataProvider()->dataSetName(); if (is_int($dataSetName)) { return sprintf( '%s with data set #%d', $test->methodName(), $dataSetName, ); } return sprintf( '%s with data set "%s"', $test->methodName(), $dataSetName, ); } /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException * * @psalm-assert !null $this->currentTestCase */ private function createTestCase(Errored|Failed|MarkedIncomplete|Prepared|Skipped $event): void { $testCase = $this->document->createElement('testcase'); $test = $event->test(); $testCase->setAttribute('name', $this->name($test)); $testCase->setAttribute('file', $test->file()); if ($test->isTestMethod()) { assert($test instanceof TestMethod); $testCase->setAttribute('line', (string) $test->line()); $testCase->setAttribute('class', $test->className()); $testCase->setAttribute('classname', str_replace('\\', '.', $test->className())); } $this->currentTestCase = $testCase; $this->time = $event->telemetryInfo()->time(); } } JUnit/Subscriber/TestSkippedSubscriber.php 0000644 00000001541 15112505657 0014704 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\Test\SkippedSubscriber; use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber { /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ public function notify(Skipped $event): void { $this->logger()->testSkipped($event); } } JUnit/Subscriber/Subscriber.php 0000644 00000001214 15112505657 0012521 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\JUnit; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class Subscriber { private readonly JunitXmlLogger $logger; public function __construct(JunitXmlLogger $logger) { $this->logger = $logger; } protected function logger(): JunitXmlLogger { return $this->logger; } } JUnit/Subscriber/TestSuiteFinishedSubscriber.php 0000644 00000001240 15112505657 0016044 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\TestSuite\Finished; use PHPUnit\Event\TestSuite\FinishedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteFinishedSubscriber extends Subscriber implements FinishedSubscriber { public function notify(Finished $event): void { $this->logger()->testSuiteFinished(); } } JUnit/Subscriber/TestMarkedIncompleteSubscriber.php 0000644 00000001627 15112505657 0016535 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\MarkedIncompleteSubscriber; use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber { /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ public function notify(MarkedIncomplete $event): void { $this->logger()->testMarkedIncomplete($event); } } JUnit/Subscriber/TestRunnerExecutionFinishedSubscriber.php 0000644 00000001304 15112505657 0020111 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\TestRunner\ExecutionFinished; use PHPUnit\Event\TestRunner\ExecutionFinishedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestRunnerExecutionFinishedSubscriber extends Subscriber implements ExecutionFinishedSubscriber { public function notify(ExecutionFinished $event): void { $this->logger()->flush(); } } JUnit/Subscriber/TestFailedSubscriber.php 0000644 00000001533 15112505657 0014472 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\FailedSubscriber; use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFailedSubscriber extends Subscriber implements FailedSubscriber { /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ public function notify(Failed $event): void { $this->logger()->testFailed($event); } } JUnit/Subscriber/TestSuiteStartedSubscriber.php 0000644 00000001240 15112505657 0015721 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\TestSuite\Started; use PHPUnit\Event\TestSuite\StartedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteStartedSubscriber extends Subscriber implements StartedSubscriber { public function notify(Started $event): void { $this->logger()->testSuiteStarted($event); } } JUnit/Subscriber/TestFinishedSubscriber.php 0000644 00000001547 15112505657 0015044 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\FinishedSubscriber; use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFinishedSubscriber extends Subscriber implements FinishedSubscriber { /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ public function notify(Finished $event): void { $this->logger()->testFinished($event); } } JUnit/Subscriber/TestErroredSubscriber.php 0000644 00000001541 15112505657 0014707 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\ErroredSubscriber; use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestErroredSubscriber extends Subscriber implements ErroredSubscriber { /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ public function notify(Errored $event): void { $this->logger()->testErrored($event); } } JUnit/Subscriber/error_log 0000644 00000007000 15112505657 0011621 0 ustar 00 [27-Nov-2025 23:08:43 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\JUnit\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteFinishedSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteFinishedSubscriber.php on line 18 [27-Nov-2025 23:10:42 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\JUnit\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteStartedSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSuiteStartedSubscriber.php on line 18 [27-Nov-2025 23:29:27 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\JUnit\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSkippedSubscriber.php:20 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestSkippedSubscriber.php on line 20 [27-Nov-2025 23:29:28 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\JUnit\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFailedSubscriber.php:20 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFailedSubscriber.php on line 20 [27-Nov-2025 23:32:22 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\JUnit\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestRunnerExecutionFinishedSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestRunnerExecutionFinishedSubscriber.php on line 18 [28-Nov-2025 00:04:59 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\JUnit\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestErroredSubscriber.php:20 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestErroredSubscriber.php on line 20 [28-Nov-2025 00:05:56 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\JUnit\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestMarkedIncompleteSubscriber.php:20 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestMarkedIncompleteSubscriber.php on line 20 [28-Nov-2025 00:06:15 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\JUnit\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFinishedSubscriber.php:20 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestFinishedSubscriber.php on line 20 [28-Nov-2025 00:08:41 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\JUnit\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparedSubscriber.php:20 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/JUnit/Subscriber/TestPreparedSubscriber.php on line 20 JUnit/Subscriber/TestPreparedSubscriber.php 0000644 00000001547 15112505657 0015055 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\JUnit; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\PreparedSubscriber; use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestPreparedSubscriber extends Subscriber implements PreparedSubscriber { /** * @throws InvalidArgumentException * @throws NoDataSetFromDataProviderException */ public function notify(Prepared $event): void { $this->logger()->testPrepared($event); } } Exception.php 0000644 00000000742 15112505657 0007225 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging; use RuntimeException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Exception extends RuntimeException implements \PHPUnit\Exception { } TestDox/HtmlRenderer.php 0000644 00000007061 15112505657 0011255 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use function sprintf; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class HtmlRenderer { /** * @var string */ private const PAGE_HEADER = <<<'EOT' <!doctype html> <html lang="en"> <head> <meta charset="utf-8"/> <title>Test Documentation</title> <style> body { text-rendering: optimizeLegibility; font-family: Source SansSerif Pro, Arial, sans-serif; font-variant-ligatures: common-ligatures; font-kerning: normal; margin-left: 2rem; background-color: #fff; color: #000; } body > ul > li { font-size: larger; } h2 { font-size: larger; text-decoration-line: underline; text-decoration-thickness: 2px; margin: 0; padding: 0.5rem 0; } ul { list-style: none; margin: 0 0 2rem; padding: 0 0 0 1rem; text-indent: -1rem; } .success:before { color: #4e9a06; content: '✓'; padding-right: 0.5rem; } .defect { color: #a40000; } .defect:before { color: #a40000; content: '✗'; padding-right: 0.5rem; } </style> </head> <body> EOT; /** * @var string */ private const CLASS_HEADER = <<<'EOT' <h2>%s</h2> <ul> EOT; /** * @var string */ private const CLASS_FOOTER = <<<'EOT' </ul> EOT; /** * @var string */ private const PAGE_FOOTER = <<<'EOT' </body> </html> EOT; /** * @psalm-param array<string, TestResultCollection> $tests */ public function render(array $tests): string { $buffer = self::PAGE_HEADER; foreach ($tests as $prettifiedClassName => $_tests) { $buffer .= sprintf( self::CLASS_HEADER, $prettifiedClassName, ); foreach ($this->reduce($_tests) as $prettifiedMethodName => $outcome) { $buffer .= sprintf( " <li class=\"%s\">%s</li>\n", $outcome, $prettifiedMethodName, ); } $buffer .= self::CLASS_FOOTER; } return $buffer . self::PAGE_FOOTER; } /** * @psalm-return array<string, 'success'|'defect'> */ private function reduce(TestResultCollection $tests): array { $result = []; foreach ($tests as $test) { $prettifiedMethodName = $test->test()->testDox()->prettifiedMethodName(); if (!isset($result[$prettifiedMethodName])) { $result[$prettifiedMethodName] = $test->status()->isSuccess() ? 'success' : 'defect'; continue; } if ($test->status()->isSuccess()) { continue; } $result[$prettifiedMethodName] = 'defect'; } return $result; } } TestDox/NamePrettifier.php 0000644 00000021007 15112505657 0011574 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use function array_key_exists; use function array_keys; use function array_map; use function array_pop; use function array_values; use function assert; use function class_exists; use function explode; use function gettype; use function implode; use function in_array; use function is_bool; use function is_float; use function is_int; use function is_numeric; use function is_object; use function is_scalar; use function method_exists; use function ord; use function preg_quote; use function preg_replace; use function range; use function sprintf; use function str_contains; use function str_ends_with; use function str_replace; use function str_starts_with; use function strlen; use function strtolower; use function strtoupper; use function substr; use function trim; use PHPUnit\Framework\TestCase; use PHPUnit\Metadata\Parser\Registry as MetadataRegistry; use PHPUnit\Metadata\TestDox; use PHPUnit\Util\Color; use ReflectionEnum; use ReflectionMethod; use ReflectionObject; use SebastianBergmann\Exporter\Exporter; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NamePrettifier { /** * @psalm-var list<string> */ private static array $strings = []; /** * @psalm-param class-string $className */ public function prettifyTestClassName(string $className): string { if (class_exists($className)) { $classLevelTestDox = MetadataRegistry::parser()->forClass($className)->isTestDox(); if ($classLevelTestDox->isNotEmpty()) { $classLevelTestDox = $classLevelTestDox->asArray()[0]; assert($classLevelTestDox instanceof TestDox); return $classLevelTestDox->text(); } } $parts = explode('\\', $className); $className = array_pop($parts); if (str_ends_with($className, 'Test')) { $className = substr($className, 0, strlen($className) - strlen('Test')); } if (str_starts_with($className, 'Tests')) { $className = substr($className, strlen('Tests')); } elseif (str_starts_with($className, 'Test')) { $className = substr($className, strlen('Test')); } if (empty($className)) { $className = 'UnnamedTests'; } if (!empty($parts)) { $parts[] = $className; $fullyQualifiedName = implode('\\', $parts); } else { $fullyQualifiedName = $className; } $result = preg_replace('/(?<=[[:lower:]])(?=[[:upper:]])/u', ' ', $className); if ($fullyQualifiedName !== $className) { return $result . ' (' . $fullyQualifiedName . ')'; } return $result; } public function prettifyTestMethodName(string $name): string { $buffer = ''; if ($name === '') { return $buffer; } $string = (string) preg_replace('#\d+$#', '', $name, -1, $count); if (in_array($string, self::$strings, true)) { $name = $string; } elseif ($count === 0) { self::$strings[] = $string; } if (str_starts_with($name, 'test_')) { $name = substr($name, 5); } elseif (str_starts_with($name, 'test')) { $name = substr($name, 4); } if ($name === '') { return $buffer; } $name[0] = strtoupper($name[0]); if (str_contains($name, '_')) { return trim(str_replace('_', ' ', $name)); } $wasNumeric = false; foreach (range(0, strlen($name) - 1) as $i) { if ($i > 0 && ord($name[$i]) >= 65 && ord($name[$i]) <= 90) { $buffer .= ' ' . strtolower($name[$i]); } else { $isNumeric = is_numeric($name[$i]); if (!$wasNumeric && $isNumeric) { $buffer .= ' '; $wasNumeric = true; } if ($wasNumeric && !$isNumeric) { $wasNumeric = false; } $buffer .= $name[$i]; } } return $buffer; } public function prettifyTestCase(TestCase $test, bool $colorize): string { $annotationWithPlaceholders = false; $methodLevelTestDox = MetadataRegistry::parser()->forMethod($test::class, $test->name())->isTestDox()->isMethodLevel(); if ($methodLevelTestDox->isNotEmpty()) { $methodLevelTestDox = $methodLevelTestDox->asArray()[0]; assert($methodLevelTestDox instanceof TestDox); $result = $methodLevelTestDox->text(); if (str_contains($result, '$')) { $annotation = $result; $providedData = $this->mapTestMethodParameterNamesToProvidedDataValues($test, $colorize); $variables = array_map( static fn (string $variable): string => sprintf( '/%s(?=\b)/', preg_quote($variable, '/'), ), array_keys($providedData), ); $result = trim(preg_replace($variables, $providedData, $annotation)); $annotationWithPlaceholders = true; } } else { $result = $this->prettifyTestMethodName($test->name()); } if (!$annotationWithPlaceholders && $test->usesDataProvider()) { $result .= $this->prettifyDataSet($test, $colorize); } return $result; } public function prettifyDataSet(TestCase $test, bool $colorize): string { if (!$colorize) { return $test->dataSetAsString(); } if (is_int($test->dataName())) { return Color::dim(' with data set ') . Color::colorize('fg-cyan', (string) $test->dataName()); } return Color::dim(' with ') . Color::colorize('fg-cyan', Color::visualizeWhitespace($test->dataName())); } private function mapTestMethodParameterNamesToProvidedDataValues(TestCase $test, bool $colorize): array { assert(method_exists($test, $test->name())); /** @noinspection PhpUnhandledExceptionInspection */ $reflector = new ReflectionMethod($test::class, $test->name()); $providedData = []; $providedDataValues = array_values($test->providedData()); $i = 0; $providedData['$_dataName'] = $test->dataName(); foreach ($reflector->getParameters() as $parameter) { if (!array_key_exists($i, $providedDataValues) && $parameter->isDefaultValueAvailable()) { $providedDataValues[$i] = $parameter->getDefaultValue(); } $value = $providedDataValues[$i++] ?? null; if (is_object($value)) { $reflector = new ReflectionObject($value); if ($reflector->isEnum()) { $enumReflector = new ReflectionEnum($value); if ($enumReflector->isBacked()) { $value = $value->value; } else { $value = $value->name; } } elseif ($reflector->hasMethod('__toString')) { $value = (string) $value; } else { $value = $value::class; } } if (!is_scalar($value)) { $value = gettype($value); if ($value === 'NULL') { $value = 'null'; } } if (is_bool($value) || is_int($value) || is_float($value)) { $value = (new Exporter)->export($value); } if ($value === '') { if ($colorize) { $value = Color::colorize('dim,underlined', 'empty'); } else { $value = "''"; } } $providedData['$' . $parameter->getName()] = $value; } if ($colorize) { $providedData = array_map( static fn ($value) => Color::colorize('fg-cyan', Color::visualizeWhitespace((string) $value, true)), $providedData, ); } return $providedData; } } TestDox/TestMethod/TestResultCollector.php 0000644 00000017746 15112505657 0014742 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use function array_keys; use function array_merge; use function assert; use function is_subclass_of; use function ksort; use function uksort; use function usort; use PHPUnit\Event\Code\TestMethod; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\EventFacadeIsSealedException; use PHPUnit\Event\Facade; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Telemetry\HRTime; use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\MockObjectCreated; use PHPUnit\Event\Test\MockObjectForAbstractClassCreated; use PHPUnit\Event\Test\MockObjectForTraitCreated; use PHPUnit\Event\Test\MockObjectFromWsdlCreated; use PHPUnit\Event\Test\PartialMockObjectCreated; use PHPUnit\Event\Test\Passed; use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\Test\TestProxyCreated; use PHPUnit\Event\Test\TestStubCreated; use PHPUnit\Event\UnknownSubscriberTypeException; use PHPUnit\Framework\TestStatus\TestStatus; use PHPUnit\Logging\TestDox\TestResult as TestDoxTestMethod; use ReflectionMethod; use SoapClient; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestResultCollector { /** * @psalm-var array<string, list<TestDoxTestMethod>> */ private array $tests = []; private ?HRTime $time = null; private ?TestStatus $status = null; private ?Throwable $throwable = null; /** * @psalm-var list<class-string|trait-string> */ private array $testDoubles = []; /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ public function __construct(Facade $facade) { $this->registerSubscribers($facade); } /** * @psalm-return array<string, TestResultCollection> */ public function testMethodsGroupedByClass(): array { $result = []; foreach ($this->tests as $prettifiedClassName => $tests) { $testsByDeclaringClass = []; foreach ($tests as $test) { $declaringClassName = (new ReflectionMethod($test->test()->className(), $test->test()->methodName()))->getDeclaringClass()->getName(); if (!isset($testsByDeclaringClass[$declaringClassName])) { $testsByDeclaringClass[$declaringClassName] = []; } $testsByDeclaringClass[$declaringClassName][] = $test; } foreach (array_keys($testsByDeclaringClass) as $declaringClassName) { usort( $testsByDeclaringClass[$declaringClassName], static function (TestDoxTestMethod $a, TestDoxTestMethod $b): int { return $a->test()->line() <=> $b->test()->line(); }, ); } uksort( $testsByDeclaringClass, /** * @psalm-param class-string $a * @psalm-param class-string $b */ static function (string $a, string $b): int { if (is_subclass_of($b, $a)) { return -1; } if (is_subclass_of($a, $b)) { return 1; } return 0; }, ); $tests = []; foreach ($testsByDeclaringClass as $_tests) { $tests = array_merge($tests, $_tests); } $result[$prettifiedClassName] = TestResultCollection::fromArray($tests); } ksort($result); return $result; } public function testPrepared(Prepared $event): void { if (!$event->test()->isTestMethod()) { return; } $this->time = $event->telemetryInfo()->time(); $this->status = TestStatus::unknown(); $this->throwable = null; $this->testDoubles = []; } public function testErrored(Errored $event): void { if (!$event->test()->isTestMethod()) { return; } $this->status = TestStatus::error($event->throwable()->message()); $this->throwable = $event->throwable(); } public function testFailed(Failed $event): void { if (!$event->test()->isTestMethod()) { return; } $this->status = TestStatus::failure($event->throwable()->message()); $this->throwable = $event->throwable(); } public function testPassed(Passed $event): void { if (!$event->test()->isTestMethod()) { return; } $this->status = TestStatus::success(); } public function testSkipped(Skipped $event): void { $this->status = TestStatus::skipped($event->message()); } public function testMarkedIncomplete(MarkedIncomplete $event): void { $this->status = TestStatus::incomplete($event->throwable()->message()); $this->throwable = $event->throwable(); } public function testConsideredRisky(ConsideredRisky $event): void { $this->status = TestStatus::risky($event->message()); } public function testCreatedTestDouble(MockObjectCreated|MockObjectForAbstractClassCreated|MockObjectForTraitCreated|MockObjectFromWsdlCreated|PartialMockObjectCreated|TestProxyCreated|TestStubCreated $event): void { if ($event instanceof MockObjectForTraitCreated) { $this->testDoubles[] = $event->traitName(); return; } if ($event instanceof MockObjectFromWsdlCreated) { $this->testDoubles[] = SoapClient::class; return; } $this->testDoubles[] = $event->className(); } /** * @throws InvalidArgumentException */ public function testFinished(Finished $event): void { if (!$event->test()->isTestMethod()) { return; } $test = $event->test(); assert($test instanceof TestMethod); if (!isset($this->tests[$test->testDox()->prettifiedClassName()])) { $this->tests[$test->testDox()->prettifiedClassName()] = []; } $this->tests[$test->testDox()->prettifiedClassName()][] = new TestDoxTestMethod( $test, $event->telemetryInfo()->time()->duration($this->time), $this->status, $this->throwable, $this->testDoubles, ); $this->time = null; $this->status = null; $this->throwable = null; $this->testDoubles = []; } /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ private function registerSubscribers(Facade $facade): void { $facade->registerSubscribers( new TestConsideredRiskySubscriber($this), new TestCreatedMockObjectForAbstractClassSubscriber($this), new TestCreatedMockObjectForTraitSubscriber($this), new TestCreatedMockObjectFromWsdlSubscriber($this), new TestCreatedMockObjectSubscriber($this), new TestCreatedPartialMockObjectSubscriber($this), new TestCreatedTestProxySubscriber($this), new TestCreatedTestStubSubscriber($this), new TestErroredSubscriber($this), new TestFailedSubscriber($this), new TestFinishedSubscriber($this), new TestMarkedIncompleteSubscriber($this), new TestPassedSubscriber($this), new TestPreparedSubscriber($this), new TestSkippedSubscriber($this), ); } } TestDox/TestMethod/TestResultCollectionIterator.php 0000644 00000002324 15112505657 0016603 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use function count; use Iterator; /** * @template-implements Iterator<int, TestResult> * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestResultCollectionIterator implements Iterator { /** * @psalm-var list<TestResult> */ private readonly array $testResults; private int $position = 0; public function __construct(TestResultCollection $testResults) { $this->testResults = $testResults->asArray(); } public function rewind(): void { $this->position = 0; } public function valid(): bool { return $this->position < count($this->testResults); } public function key(): int { return $this->position; } public function current(): TestResult { return $this->testResults[$this->position]; } public function next(): void { $this->position++; } } TestDox/TestMethod/TestResultCollection.php 0000644 00000002312 15112505657 0015066 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use IteratorAggregate; /** * @template-implements IteratorAggregate<int, TestResult> * * @psalm-immutable * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestResultCollection implements IteratorAggregate { /** * @psalm-var list<TestResult> */ private readonly array $testResults; /** * @psalm-param list<TestResult> $testResults */ public static function fromArray(array $testResults): self { return new self(...$testResults); } private function __construct(TestResult ...$testResults) { $this->testResults = $testResults; } /** * @psalm-return list<TestResult> */ public function asArray(): array { return $this->testResults; } public function getIterator(): TestResultCollectionIterator { return new TestResultCollectionIterator($this); } } TestDox/TestMethod/TestResult.php 0000644 00000003636 15112505657 0013064 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Code\TestMethod; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\Telemetry\Duration; use PHPUnit\Framework\TestStatus\TestStatus; /** * @psalm-immutable * * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestResult { private readonly TestMethod $test; private readonly Duration $duration; private readonly TestStatus $status; private readonly ?Throwable $throwable; /** * @psalm-var list<class-string|trait-string> */ private readonly array $testDoubles; /** * @psalm-param list<class-string|trait-string> $testDoubles */ public function __construct(TestMethod $test, Duration $duration, TestStatus $status, ?Throwable $throwable, array $testDoubles) { $this->test = $test; $this->duration = $duration; $this->status = $status; $this->throwable = $throwable; $this->testDoubles = $testDoubles; } public function test(): TestMethod { return $this->test; } public function duration(): Duration { return $this->duration; } public function status(): TestStatus { return $this->status; } /** * @psalm-assert-if-true !null $this->throwable */ public function hasThrowable(): bool { return $this->throwable !== null; } public function throwable(): ?Throwable { return $this->throwable; } /** * @psalm-return list<class-string|trait-string> */ public function testDoubles(): array { return $this->testDoubles; } } TestDox/TestMethod/error_log 0000644 00000000714 15112505657 0012144 0 ustar 00 [27-Nov-2025 23:10:21 UTC] PHP Fatal error: Could not check compatibility between PHPUnit\Logging\TestDox\TestResultCollection::getIterator(): PHPUnit\Logging\TestDox\TestResultCollectionIterator and IteratorAggregate::getIterator(): Traversable, because class PHPUnit\Logging\TestDox\TestResultCollectionIterator is not available in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/TestResultCollection.php on line 49 TestDox/TestMethod/Subscriber/TestSkippedSubscriber.php 0000644 00000001221 15112505657 0017320 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\Test\SkippedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber { public function notify(Skipped $event): void { $this->collector()->testSkipped($event); } } TestDox/TestMethod/Subscriber/Subscriber.php 0000644 00000001257 15112505657 0015151 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ abstract class Subscriber { private readonly TestResultCollector $collector; public function __construct(TestResultCollector $collector) { $this->collector = $collector; } protected function collector(): TestResultCollector { return $this->collector; } } TestDox/TestMethod/Subscriber/TestMarkedIncompleteSubscriber.php 0000644 00000001307 15112505657 0021151 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\MarkedIncomplete; use PHPUnit\Event\Test\MarkedIncompleteSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestMarkedIncompleteSubscriber extends Subscriber implements MarkedIncompleteSubscriber { public function notify(MarkedIncomplete $event): void { $this->collector()->testMarkedIncomplete($event); } } TestDox/TestMethod/Subscriber/TestCreatedMockObjectForAbstractClassSubscriber.php 0000644 00000001435 15112505657 0024361 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\MockObjectForAbstractClassCreated; use PHPUnit\Event\Test\MockObjectForAbstractClassCreatedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestCreatedMockObjectForAbstractClassSubscriber extends Subscriber implements MockObjectForAbstractClassCreatedSubscriber { public function notify(MockObjectForAbstractClassCreated $event): void { $this->collector()->testCreatedTestDouble($event); } } TestDox/TestMethod/Subscriber/TestCreatedPartialMockObjectSubscriber.php 0000644 00000001360 15112505657 0022552 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\PartialMockObjectCreated; use PHPUnit\Event\Test\PartialMockObjectCreatedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestCreatedPartialMockObjectSubscriber extends Subscriber implements PartialMockObjectCreatedSubscriber { public function notify(PartialMockObjectCreated $event): void { $this->collector()->testCreatedTestDouble($event); } } TestDox/TestMethod/Subscriber/TestConsideredRiskySubscriber.php 0000644 00000001301 15112505657 0021021 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\ConsideredRisky; use PHPUnit\Event\Test\ConsideredRiskySubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestConsideredRiskySubscriber extends Subscriber implements ConsideredRiskySubscriber { public function notify(ConsideredRisky $event): void { $this->collector()->testConsideredRisky($event); } } TestDox/TestMethod/Subscriber/TestCreatedMockObjectForTraitSubscriber.php 0000644 00000001365 15112505657 0022715 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\MockObjectForTraitCreated; use PHPUnit\Event\Test\MockObjectForTraitCreatedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestCreatedMockObjectForTraitSubscriber extends Subscriber implements MockObjectForTraitCreatedSubscriber { public function notify(MockObjectForTraitCreated $event): void { $this->collector()->testCreatedTestDouble($event); } } TestDox/TestMethod/Subscriber/TestCreatedTestProxySubscriber.php 0000644 00000001310 15112505657 0021171 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\TestProxyCreated; use PHPUnit\Event\Test\TestProxyCreatedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestCreatedTestProxySubscriber extends Subscriber implements TestProxyCreatedSubscriber { public function notify(TestProxyCreated $event): void { $this->collector()->testCreatedTestDouble($event); } } TestDox/TestMethod/Subscriber/TestFailedSubscriber.php 0000644 00000001213 15112505657 0017106 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\Failed; use PHPUnit\Event\Test\FailedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFailedSubscriber extends Subscriber implements FailedSubscriber { public function notify(Failed $event): void { $this->collector()->testFailed($event); } } TestDox/TestMethod/Subscriber/TestFinishedSubscriber.php 0000644 00000001373 15112505657 0017462 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\InvalidArgumentException; use PHPUnit\Event\Test\Finished; use PHPUnit\Event\Test\FinishedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestFinishedSubscriber extends Subscriber implements FinishedSubscriber { /** * @throws InvalidArgumentException */ public function notify(Finished $event): void { $this->collector()->testFinished($event); } } TestDox/TestMethod/Subscriber/TestErroredSubscriber.php 0000644 00000001221 15112505657 0017323 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\Errored; use PHPUnit\Event\Test\ErroredSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestErroredSubscriber extends Subscriber implements ErroredSubscriber { public function notify(Errored $event): void { $this->collector()->testErrored($event); } } TestDox/TestMethod/Subscriber/error_log 0000644 00000013724 15112505657 0014254 0 ustar 00 [28-Nov-2025 12:51:29 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestProxySubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestProxySubscriber.php on line 18 [28-Nov-2025 12:52:25 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestErroredSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestErroredSubscriber.php on line 18 [28-Nov-2025 12:52:42 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForTraitSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForTraitSubscriber.php on line 18 [28-Nov-2025 12:52:46 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFinishedSubscriber.php:19 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestFinishedSubscriber.php on line 19 [28-Nov-2025 14:38:29 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectSubscriber.php on line 18 [28-Nov-2025 14:40:28 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestStubSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedTestStubSubscriber.php on line 18 [28-Nov-2025 14:42:27 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedPartialMockObjectSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedPartialMockObjectSubscriber.php on line 18 [28-Nov-2025 14:43:09 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectFromWsdlSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectFromWsdlSubscriber.php on line 18 [28-Nov-2025 15:32:27 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestSkippedSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestSkippedSubscriber.php on line 18 [28-Nov-2025 15:33:06 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestConsideredRiskySubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestConsideredRiskySubscriber.php on line 18 [28-Nov-2025 15:33:32 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPreparedSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPreparedSubscriber.php on line 18 [28-Nov-2025 15:38:46 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestMarkedIncompleteSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestMarkedIncompleteSubscriber.php on line 18 [28-Nov-2025 15:40:06 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForAbstractClassSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestCreatedMockObjectForAbstractClassSubscriber.php on line 18 [28-Nov-2025 15:40:34 UTC] PHP Fatal error: Uncaught Error: Class "PHPUnit\Logging\TestDox\Subscriber" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPassedSubscriber.php:18 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/TestDox/TestMethod/Subscriber/TestPassedSubscriber.php on line 18 TestDox/TestMethod/Subscriber/TestCreatedMockObjectFromWsdlSubscriber.php 0000644 00000001365 15112505657 0022720 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\MockObjectFromWsdlCreated; use PHPUnit\Event\Test\MockObjectFromWsdlCreatedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestCreatedMockObjectFromWsdlSubscriber extends Subscriber implements MockObjectFromWsdlCreatedSubscriber { public function notify(MockObjectFromWsdlCreated $event): void { $this->collector()->testCreatedTestDouble($event); } } TestDox/TestMethod/Subscriber/TestPreparedSubscriber.php 0000644 00000001227 15112505657 0017471 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\Prepared; use PHPUnit\Event\Test\PreparedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestPreparedSubscriber extends Subscriber implements PreparedSubscriber { public function notify(Prepared $event): void { $this->collector()->testPrepared($event); } } TestDox/TestMethod/Subscriber/TestCreatedTestStubSubscriber.php 0000644 00000001303 15112505657 0020767 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\TestStubCreated; use PHPUnit\Event\Test\TestStubCreatedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestCreatedTestStubSubscriber extends Subscriber implements TestStubCreatedSubscriber { public function notify(TestStubCreated $event): void { $this->collector()->testCreatedTestDouble($event); } } TestDox/TestMethod/Subscriber/TestCreatedMockObjectSubscriber.php 0000644 00000001315 15112505657 0021235 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\MockObjectCreated; use PHPUnit\Event\Test\MockObjectCreatedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestCreatedMockObjectSubscriber extends Subscriber implements MockObjectCreatedSubscriber { public function notify(MockObjectCreated $event): void { $this->collector()->testCreatedTestDouble($event); } } TestDox/TestMethod/Subscriber/TestPassedSubscriber.php 0000644 00000001213 15112505657 0017141 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use PHPUnit\Event\Test\Passed; use PHPUnit\Event\Test\PassedSubscriber; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestPassedSubscriber extends Subscriber implements PassedSubscriber { public function notify(Passed $event): void { $this->collector()->testPassed($event); } } TestDox/PlainTextRenderer.php 0000644 00000003243 15112505657 0012257 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging\TestDox; use function sprintf; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class PlainTextRenderer { /** * @psalm-param array<string, TestResultCollection> $tests */ public function render(array $tests): string { $buffer = ''; foreach ($tests as $prettifiedClassName => $_tests) { $buffer .= $prettifiedClassName . "\n"; foreach ($this->reduce($_tests) as $prettifiedMethodName => $outcome) { $buffer .= sprintf( ' [%s] %s' . "\n", $outcome, $prettifiedMethodName, ); } $buffer .= "\n"; } return $buffer; } /** * @psalm-return array<string, 'x'|' '> */ private function reduce(TestResultCollection $tests): array { $result = []; foreach ($tests as $test) { $prettifiedMethodName = $test->test()->testDox()->prettifiedMethodName(); if (!isset($result[$prettifiedMethodName])) { $result[$prettifiedMethodName] = $test->status()->isSuccess() ? 'x' : ' '; continue; } if ($test->status()->isSuccess()) { continue; } $result[$prettifiedMethodName] = ' '; } return $result; } } EventLogger.php 0000644 00000003043 15112505657 0007505 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of PHPUnit. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace PHPUnit\Logging; use const FILE_APPEND; use const LOCK_EX; use const PHP_EOL; use function explode; use function file_put_contents; use function implode; use function str_repeat; use function strlen; use PHPUnit\Event\Event; use PHPUnit\Event\Tracer\Tracer; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class EventLogger implements Tracer { private readonly string $path; private readonly bool $includeTelemetryInfo; public function __construct(string $path, bool $includeTelemetryInfo) { $this->path = $path; $this->includeTelemetryInfo = $includeTelemetryInfo; } public function trace(Event $event): void { $telemetryInfo = $this->telemetryInfo($event); $indentation = PHP_EOL . str_repeat(' ', strlen($telemetryInfo)); $lines = explode(PHP_EOL, $event->asString()); file_put_contents( $this->path, $telemetryInfo . implode($indentation, $lines) . PHP_EOL, FILE_APPEND | LOCK_EX, ); } private function telemetryInfo(Event $event): string { if (!$this->includeTelemetryInfo) { return ''; } return $event->telemetryInfo()->asString() . ' '; } } error_log 0000644 00000001220 15112505657 0006463 0 ustar 00 [26-Nov-2025 17:35:27 UTC] PHP Fatal error: Uncaught Error: Interface "PHPUnit\Exception" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/Exception.php:17 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/Exception.php on line 17 [26-Nov-2025 19:35:29 UTC] PHP Fatal error: Uncaught Error: Interface "PHPUnit\Event\Tracer\Tracer" not found in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/EventLogger.php:26 Stack trace: #0 {main} thrown in /home/fluxyjvi/public_html/project/vendor/phpunit/phpunit/src/Logging/EventLogger.php on line 26
Simpan