One Hat Cyber Team
Your IP:
216.73.216.102
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 :
~
/
home
/
fluxyjvi
/
www
/
assets
/
images
/
View File Name :
Event.tar
DocumentPreRenderEvent.php 0000644 00000001616 15107427024 0011652 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of the league/commonmark package. * * (c) Colin O'Dell <colinodell@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace League\CommonMark\Event; use League\CommonMark\Node\Block\Document; /** * Event dispatched just before rendering begins */ final class DocumentPreRenderEvent extends AbstractEvent { /** @psalm-readonly */ private Document $document; /** @psalm-readonly */ private string $format; public function __construct(Document $document, string $format) { $this->document = $document; $this->format = $format; } public function getDocument(): Document { return $this->document; } public function getFormat(): string { return $this->format; } } DocumentParsedEvent.php 0000644 00000001330 15107427025 0011174 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of the league/commonmark package. * * (c) Colin O'Dell <colinodell@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace League\CommonMark\Event; use League\CommonMark\Node\Block\Document; /** * Event dispatched when the document has been fully parsed */ final class DocumentParsedEvent extends AbstractEvent { /** @psalm-readonly */ private Document $document; public function __construct(Document $document) { $this->document = $document; } public function getDocument(): Document { return $this->document; } } DocumentPreParsedEvent.php 0000644 00000002164 15107427025 0011651 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of the league/commonmark package. * * (c) Colin O'Dell <colinodell@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace League\CommonMark\Event; use League\CommonMark\Input\MarkdownInputInterface; use League\CommonMark\Node\Block\Document; /** * Event dispatched when the document is about to be parsed */ final class DocumentPreParsedEvent extends AbstractEvent { /** @psalm-readonly */ private Document $document; private MarkdownInputInterface $markdown; public function __construct(Document $document, MarkdownInputInterface $markdown) { $this->document = $document; $this->markdown = $markdown; } public function getDocument(): Document { return $this->document; } public function getMarkdown(): MarkdownInputInterface { return $this->markdown; } public function replaceMarkdown(MarkdownInputInterface $markdownInput): void { $this->markdown = $markdownInput; } } DocumentRenderedEvent.php 0000644 00000001604 15107427025 0011512 0 ustar 00 <?php /* * This file is part of the league/commonmark package. * * (c) Colin O'Dell <colinodell@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ declare(strict_types=1); namespace League\CommonMark\Event; use League\CommonMark\Output\RenderedContentInterface; final class DocumentRenderedEvent extends AbstractEvent { private RenderedContentInterface $output; public function __construct(RenderedContentInterface $output) { $this->output = $output; } /** * @psalm-mutation-free */ public function getOutput(): RenderedContentInterface { return $this->output; } /** * @psalm-external-mutation-free */ public function replaceOutput(RenderedContentInterface $output): void { $this->output = $output; } } ListenerData.php 0000644 00000001605 15107427025 0007641 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of the league/commonmark package. * * (c) Colin O'Dell <colinodell@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace League\CommonMark\Event; /** * @internal * * @psalm-immutable */ final class ListenerData { /** @var class-string */ private string $event; /** @var callable */ private $listener; /** * @param class-string $event */ public function __construct(string $event, callable $listener) { $this->event = $event; $this->listener = $listener; } /** * @return class-string */ public function getEvent(): string { return $this->event; } public function getListener(): callable { return $this->listener; } } AbstractEvent.php 0000644 00000002752 15107427025 0010033 0 ustar 00 <?php declare(strict_types=1); /* * This file is part of the league/commonmark package. * * (c) Colin O'Dell <colinodell@gmail.com> * * Original code based on the Symfony EventDispatcher "Event" contract * - (c) 2018-2019 Fabien Potencier * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace League\CommonMark\Event; use Psr\EventDispatcher\StoppableEventInterface; /** * Base class for classes containing event data. * * This class contains no event data. It is used by events that do not pass * state information to an event handler when an event is raised. * * You can call the method stopPropagation() to abort the execution of * further listeners in your event listener. */ abstract class AbstractEvent implements StoppableEventInterface { /** @psalm-readonly-allow-private-mutation */ private bool $propagationStopped = false; /** * Returns whether further event listeners should be triggered. */ final public function isPropagationStopped(): bool { return $this->propagationStopped; } /** * Stops the propagation of the event to further event listeners. * * If multiple event listeners are connected to the same event, no * further event listener will be triggered once any trigger calls * stopPropagation(). */ final public function stopPropagation(): void { $this->propagationStopped = true; } } Subscriber.php 0000644 00000000641 15107470266 0007371 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\Event; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface Subscriber { } Facade.php 0000644 00000020125 15107470266 0006430 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\Event; use function gc_status; use PHPUnit\Event\Telemetry\HRTime; use PHPUnit\Event\Telemetry\Php81GarbageCollectorStatusProvider; use PHPUnit\Event\Telemetry\Php83GarbageCollectorStatusProvider; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Facade { private static ?self $instance = null; private Emitter $emitter; private ?TypeMap $typeMap = null; private ?Emitter $suspended = null; private ?DeferringDispatcher $deferringDispatcher = null; private bool $sealed = false; public static function instance(): self { if (self::$instance === null) { self::$instance = new self; } return self::$instance; } public static function emitter(): Emitter { return self::instance()->emitter; } public function __construct() { $this->emitter = $this->createDispatchingEmitter(); } /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ public function registerSubscribers(Subscriber ...$subscribers): void { foreach ($subscribers as $subscriber) { $this->registerSubscriber($subscriber); } } /** * @throws EventFacadeIsSealedException * @throws UnknownSubscriberTypeException */ public function registerSubscriber(Subscriber $subscriber): void { if ($this->sealed) { throw new EventFacadeIsSealedException; } $this->deferredDispatcher()->registerSubscriber($subscriber); } /** * @throws EventFacadeIsSealedException */ public function registerTracer(Tracer\Tracer $tracer): void { if ($this->sealed) { throw new EventFacadeIsSealedException; } $this->deferredDispatcher()->registerTracer($tracer); } /** @noinspection PhpUnused */ public function initForIsolation(HRTime $offset, bool $exportObjects): CollectingDispatcher { $dispatcher = new CollectingDispatcher; $this->emitter = new DispatchingEmitter( $dispatcher, new Telemetry\System( new Telemetry\SystemStopWatchWithOffset($offset), new Telemetry\SystemMemoryMeter, $this->garbageCollectorStatusProvider(), ), ); if ($exportObjects) { $this->emitter->exportObjects(); } $this->sealed = true; return $dispatcher; } public function forward(EventCollection $events): void { if ($this->suspended !== null) { return; } $dispatcher = $this->deferredDispatcher(); foreach ($events as $event) { $dispatcher->dispatch($event); } } public function seal(): void { $this->deferredDispatcher()->flush(); $this->sealed = true; $this->emitter->testRunnerEventFacadeSealed(); } private function createDispatchingEmitter(): DispatchingEmitter { return new DispatchingEmitter( $this->deferredDispatcher(), $this->createTelemetrySystem(), ); } private function createTelemetrySystem(): Telemetry\System { return new Telemetry\System( new Telemetry\SystemStopWatch, new Telemetry\SystemMemoryMeter, $this->garbageCollectorStatusProvider(), ); } private function deferredDispatcher(): DeferringDispatcher { if ($this->deferringDispatcher === null) { $this->deferringDispatcher = new DeferringDispatcher( new DirectDispatcher($this->typeMap()), ); } return $this->deferringDispatcher; } private function typeMap(): TypeMap { if ($this->typeMap === null) { $typeMap = new TypeMap; $this->registerDefaultTypes($typeMap); $this->typeMap = $typeMap; } return $this->typeMap; } private function registerDefaultTypes(TypeMap $typeMap): void { $defaultEvents = [ Application\Started::class, Application\Finished::class, Test\DataProviderMethodCalled::class, Test\DataProviderMethodFinished::class, Test\MarkedIncomplete::class, Test\AfterLastTestMethodCalled::class, Test\AfterLastTestMethodFinished::class, Test\AfterTestMethodCalled::class, Test\AfterTestMethodFinished::class, Test\AssertionSucceeded::class, Test\AssertionFailed::class, Test\BeforeFirstTestMethodCalled::class, Test\BeforeFirstTestMethodErrored::class, Test\BeforeFirstTestMethodFinished::class, Test\BeforeTestMethodCalled::class, Test\BeforeTestMethodFinished::class, Test\ComparatorRegistered::class, Test\ConsideredRisky::class, Test\DeprecationTriggered::class, Test\Errored::class, Test\ErrorTriggered::class, Test\Failed::class, Test\Finished::class, Test\NoticeTriggered::class, Test\Passed::class, Test\PhpDeprecationTriggered::class, Test\PhpNoticeTriggered::class, Test\PhpunitDeprecationTriggered::class, Test\PhpunitErrorTriggered::class, Test\PhpunitWarningTriggered::class, Test\PhpWarningTriggered::class, Test\PostConditionCalled::class, Test\PostConditionFinished::class, Test\PreConditionCalled::class, Test\PreConditionFinished::class, Test\PreparationStarted::class, Test\Prepared::class, Test\PreparationFailed::class, Test\PrintedUnexpectedOutput::class, Test\Skipped::class, Test\WarningTriggered::class, Test\MockObjectCreated::class, Test\MockObjectForAbstractClassCreated::class, Test\MockObjectForIntersectionOfInterfacesCreated::class, Test\MockObjectForTraitCreated::class, Test\MockObjectFromWsdlCreated::class, Test\PartialMockObjectCreated::class, Test\TestProxyCreated::class, Test\TestStubCreated::class, Test\TestStubForIntersectionOfInterfacesCreated::class, TestRunner\BootstrapFinished::class, TestRunner\Configured::class, TestRunner\EventFacadeSealed::class, TestRunner\ExecutionAborted::class, TestRunner\ExecutionFinished::class, TestRunner\ExecutionStarted::class, TestRunner\ExtensionLoadedFromPhar::class, TestRunner\ExtensionBootstrapped::class, TestRunner\Finished::class, TestRunner\Started::class, TestRunner\DeprecationTriggered::class, TestRunner\WarningTriggered::class, TestRunner\GarbageCollectionDisabled::class, TestRunner\GarbageCollectionTriggered::class, TestRunner\GarbageCollectionEnabled::class, TestSuite\Filtered::class, TestSuite\Finished::class, TestSuite\Loaded::class, TestSuite\Skipped::class, TestSuite\Sorted::class, TestSuite\Started::class, ]; foreach ($defaultEvents as $eventClass) { $typeMap->addMapping( $eventClass . 'Subscriber', $eventClass, ); } } private function garbageCollectorStatusProvider(): Telemetry\GarbageCollectorStatusProvider { if (!isset(gc_status()['running'])) { return new Php81GarbageCollectorStatusProvider; } return new Php83GarbageCollectorStatusProvider; } } Exception/UnknownEventException.php 0000644 00000000763 15107470267 0013552 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\Event; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class UnknownEventException extends RuntimeException implements Exception { } Exception/InvalidEventException.php 0000644 00000000763 15107470267 0013501 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\Event; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class InvalidEventException extends RuntimeException implements Exception { } Exception/SubscriberTypeAlreadyRegisteredException.php 0000644 00000001006 15107470267 0017365 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\Event; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class SubscriberTypeAlreadyRegisteredException extends RuntimeException implements Exception { } Exception/UnknownSubscriberException.php 0000644 00000000770 15107470267 0014572 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\Event; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class UnknownSubscriberException extends RuntimeException implements Exception { } Exception/Exception.php 0000644 00000000512 15107470267 0011160 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\Event; interface Exception extends \PHPUnit\Exception { } Exception/RuntimeException.php 0000644 00000000730 15107470270 0012520 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\Event; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class RuntimeException extends \RuntimeException implements Exception { } Exception/NoTestCaseObjectOnCallStackException.php 0000644 00000001214 15107470270 0016311 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\Event\Code; use PHPUnit\Event\Exception; use RuntimeException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class NoTestCaseObjectOnCallStackException extends RuntimeException implements Exception { public function __construct() { parent::__construct('Cannot find TestCase object on call stack'); } } Exception/NoComparisonFailureException.php 0000644 00000001034 15107470270 0015012 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\Event\Test; use PHPUnit\Event\Exception; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class NoComparisonFailureException extends RuntimeException implements Exception { } Exception/UnknownEventTypeException.php 0000644 00000000767 15107470270 0014412 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\Event; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class UnknownEventTypeException extends RuntimeException implements Exception { } Exception/MapError.php 0000644 00000000746 15107470270 0010754 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\Event; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class MapError extends RuntimeException implements Exception { } Exception/InvalidSubscriberException.php 0000644 00000000770 15107470271 0014514 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\Event; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class InvalidSubscriberException extends RuntimeException implements Exception { } Exception/NoPreviousThrowableException.php 0000644 00000000772 15107470271 0015065 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\Event; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class NoPreviousThrowableException extends RuntimeException implements Exception { } Exception/NoDataSetFromDataProviderException.php 0000644 00000001046 15107470271 0016052 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\Event\TestData; use PHPUnit\Event\Exception; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class NoDataSetFromDataProviderException extends RuntimeException implements Exception { } Exception/UnknownSubscriberTypeException.php 0000644 00000000774 15107470271 0015433 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\Event; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class UnknownSubscriberTypeException extends RuntimeException implements Exception { } Exception/InvalidArgumentException.php 0000644 00000000750 15107470271 0014171 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\Event; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class InvalidArgumentException extends \InvalidArgumentException implements Exception { } Exception/MoreThanOneDataSetFromDataProviderException.php 0000644 00000001057 15107470272 0017660 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\Event\TestData; use PHPUnit\Event\Exception; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class MoreThanOneDataSetFromDataProviderException extends RuntimeException implements Exception { } Exception/EventAlreadyAssignedException.php 0000644 00000000773 15107470272 0015147 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\Event; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class EventAlreadyAssignedException extends RuntimeException implements Exception { } Exception/EventFacadeIsSealedException.php 0000644 00000000772 15107470272 0014664 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\Event; use RuntimeException; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class EventFacadeIsSealedException extends RuntimeException implements Exception { } Events/EventCollection.php 0000644 00000002441 15107470272 0011624 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\Event; use function count; use Countable; use IteratorAggregate; /** * @template-implements IteratorAggregate<int, Event> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class EventCollection implements Countable, IteratorAggregate { /** * @psalm-var list<Event> */ private array $events = []; public function add(Event ...$events): void { foreach ($events as $event) { $this->events[] = $event; } } /** * @psalm-return list<Event> */ public function asArray(): array { return $this->events; } public function count(): int { return count($this->events); } public function isEmpty(): bool { return $this->count() === 0; } public function isNotEmpty(): bool { return $this->count() > 0; } public function getIterator(): EventCollectionIterator { return new EventCollectionIterator($this); } } Events/EventCollectionIterator.php 0000644 00000002243 15107470272 0013336 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\Event; use function count; use Iterator; /** * @template-implements Iterator<int, Event> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class EventCollectionIterator implements Iterator { /** * @psalm-var list<Event> */ private readonly array $events; private int $position = 0; public function __construct(EventCollection $events) { $this->events = $events->asArray(); } public function rewind(): void { $this->position = 0; } public function valid(): bool { return $this->position < count($this->events); } public function key(): int { return $this->position; } public function current(): Event { return $this->events[$this->position]; } public function next(): void { $this->position++; } } Events/TestSuite/SortedSubscriber.php 0000644 00000001024 15107470272 0013740 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\Event\TestSuite; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface SortedSubscriber extends Subscriber { public function notify(Sorted $event): void; } Events/TestSuite/Finished.php 0000644 00000002411 15107470272 0012206 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\Event\TestSuite; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Finished implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly TestSuite $testSuite; public function __construct(Telemetry\Info $telemetryInfo, TestSuite $testSuite) { $this->telemetryInfo = $telemetryInfo; $this->testSuite = $testSuite; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function testSuite(): TestSuite { return $this->testSuite; } public function asString(): string { return sprintf( 'Test Suite Finished (%s, %d test%s)', $this->testSuite->name(), $this->testSuite->count(), $this->testSuite->count() !== 1 ? 's' : '', ); } } Events/TestSuite/Sorted.php 0000644 00000003070 15107470273 0011720 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\Event\TestSuite; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Sorted implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly int $executionOrder; private readonly int $executionOrderDefects; private readonly bool $resolveDependencies; public function __construct(Telemetry\Info $telemetryInfo, int $executionOrder, int $executionOrderDefects, bool $resolveDependencies) { $this->telemetryInfo = $telemetryInfo; $this->executionOrder = $executionOrder; $this->executionOrderDefects = $executionOrderDefects; $this->resolveDependencies = $resolveDependencies; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function executionOrder(): int { return $this->executionOrder; } public function executionOrderDefects(): int { return $this->executionOrderDefects; } public function resolveDependencies(): bool { return $this->resolveDependencies; } public function asString(): string { return 'Test Suite Sorted'; } } Events/TestSuite/Skipped.php 0000644 00000002557 15107470273 0012070 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\Event\TestSuite; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Skipped implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly TestSuite $testSuite; private readonly string $message; public function __construct(Telemetry\Info $telemetryInfo, TestSuite $testSuite, string $message) { $this->telemetryInfo = $telemetryInfo; $this->testSuite = $testSuite; $this->message = $message; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function testSuite(): TestSuite { return $this->testSuite; } public function message(): string { return $this->message; } public function asString(): string { return sprintf( 'Test Suite Skipped (%s, %s)', $this->testSuite->name(), $this->message, ); } } Events/TestSuite/StartedSubscriber.php 0000644 00000001026 15107470273 0014111 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\Event\TestSuite; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface StartedSubscriber extends Subscriber { public function notify(Started $event): void; } Events/TestSuite/SkippedSubscriber.php 0000644 00000001026 15107470273 0014102 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\Event\TestSuite; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface SkippedSubscriber extends Subscriber { public function notify(Skipped $event): void; } Events/TestSuite/Started.php 0000644 00000002407 15107470273 0012071 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\Event\TestSuite; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Started implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly TestSuite $testSuite; public function __construct(Telemetry\Info $telemetryInfo, TestSuite $testSuite) { $this->telemetryInfo = $telemetryInfo; $this->testSuite = $testSuite; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function testSuite(): TestSuite { return $this->testSuite; } public function asString(): string { return sprintf( 'Test Suite Started (%s, %d test%s)', $this->testSuite->name(), $this->testSuite->count(), $this->testSuite->count() !== 1 ? 's' : '', ); } } Events/TestSuite/FinishedSubscriber.php 0000644 00000001030 15107470273 0014227 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\Event\TestSuite; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface FinishedSubscriber extends Subscriber { public function notify(Finished $event): void; } Events/TestSuite/LoadedSubscriber.php 0000644 00000001024 15107470274 0013672 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\Event\TestSuite; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface LoadedSubscriber extends Subscriber { public function notify(Loaded $event): void; } Events/TestSuite/Loaded.php 0000644 00000002333 15107470274 0011652 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\Event\TestSuite; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Loaded implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly TestSuite $testSuite; public function __construct(Telemetry\Info $telemetryInfo, TestSuite $testSuite) { $this->telemetryInfo = $telemetryInfo; $this->testSuite = $testSuite; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function testSuite(): TestSuite { return $this->testSuite; } public function asString(): string { return sprintf( 'Test Suite Loaded (%d test%s)', $this->testSuite->count(), $this->testSuite->count() !== 1 ? 's' : '', ); } } Events/TestSuite/FilteredSubscriber.php 0000644 00000001030 15107470274 0014235 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\Event\TestSuite; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface FilteredSubscriber extends Subscriber { public function notify(Filtered $event): void; } Events/TestSuite/Filtered.php 0000644 00000002337 15107470274 0012224 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\Event\TestSuite; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Filtered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly TestSuite $testSuite; public function __construct(Telemetry\Info $telemetryInfo, TestSuite $testSuite) { $this->telemetryInfo = $telemetryInfo; $this->testSuite = $testSuite; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function testSuite(): TestSuite { return $this->testSuite; } public function asString(): string { return sprintf( 'Test Suite Filtered (%d test%s)', $this->testSuite->count(), $this->testSuite->count() !== 1 ? 's' : '', ); } } Events/Test/PrintedUnexpectedOutputSubscriber.php 0000644 00000001061 15107470274 0016344 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PrintedUnexpectedOutputSubscriber extends Subscriber { public function notify(PrintedUnexpectedOutput $event): void; } Events/Test/Issue/DeprecationTriggeredSubscriber.php 0000644 00000001053 15107470275 0016655 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface DeprecationTriggeredSubscriber extends Subscriber { public function notify(DeprecationTriggered $event): void; } Events/Test/Issue/PhpWarningTriggered.php 0000644 00000005604 15107470275 0014457 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PhpWarningTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; /** * @psalm-var non-empty-string */ private readonly string $message; /** * @psalm-var non-empty-string */ private readonly string $file; /** * @psalm-var positive-int */ private readonly int $line; private readonly bool $suppressed; private readonly bool $ignoredByBaseline; /** * @psalm-param non-empty-string $message * @psalm-param non-empty-string $file * @psalm-param positive-int $line */ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; $this->file = $file; $this->line = $line; $this->suppressed = $suppressed; $this->ignoredByBaseline = $ignoredByBaseline; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Test { return $this->test; } /** * @psalm-return non-empty-string */ public function message(): string { return $this->message; } /** * @psalm-return non-empty-string */ public function file(): string { return $this->file; } /** * @psalm-return positive-int */ public function line(): int { return $this->line; } public function wasSuppressed(): bool { return $this->suppressed; } public function ignoredByBaseline(): bool { return $this->ignoredByBaseline; } public function asString(): string { $message = $this->message; if (!empty($message)) { $message = PHP_EOL . $message; } $status = ''; if ($this->ignoredByBaseline) { $status = 'Baseline-Ignored '; } elseif ($this->suppressed) { $status = 'Suppressed '; } return sprintf( 'Test Triggered %sPHP Warning (%s)%s', $status, $this->test->id(), $message, ); } } Events/Test/Issue/PhpDeprecationTriggered.php 0000644 00000005614 15107470275 0015310 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PhpDeprecationTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; /** * @psalm-var non-empty-string */ private readonly string $message; /** * @psalm-var non-empty-string */ private readonly string $file; /** * @psalm-var positive-int */ private readonly int $line; private readonly bool $suppressed; private readonly bool $ignoredByBaseline; /** * @psalm-param non-empty-string $message * @psalm-param non-empty-string $file * @psalm-param positive-int $line */ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; $this->file = $file; $this->line = $line; $this->suppressed = $suppressed; $this->ignoredByBaseline = $ignoredByBaseline; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Test { return $this->test; } /** * @psalm-return non-empty-string */ public function message(): string { return $this->message; } /** * @psalm-return non-empty-string */ public function file(): string { return $this->file; } /** * @psalm-return positive-int */ public function line(): int { return $this->line; } public function wasSuppressed(): bool { return $this->suppressed; } public function ignoredByBaseline(): bool { return $this->ignoredByBaseline; } public function asString(): string { $message = $this->message; if (!empty($message)) { $message = PHP_EOL . $message; } $status = ''; if ($this->ignoredByBaseline) { $status = 'Baseline-Ignored '; } elseif ($this->suppressed) { $status = 'Suppressed '; } return sprintf( 'Test Triggered %sPHP Deprecation (%s)%s', $status, $this->test->id(), $message, ); } } Events/Test/Issue/PhpunitDeprecationTriggered.php 0000644 00000003001 15107470275 0016174 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PhpunitDeprecationTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; private readonly string $message; public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Test { return $this->test; } public function message(): string { return $this->message; } public function asString(): string { $message = $this->message; if (!empty($message)) { $message = PHP_EOL . $message; } return sprintf( 'Test Triggered PHPUnit Deprecation (%s)%s', $this->test->id(), $message, ); } } Events/Test/Issue/PhpunitErrorTriggeredSubscriber.php 0000644 00000001055 15107470275 0017063 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PhpunitErrorTriggeredSubscriber extends Subscriber { public function notify(PhpunitErrorTriggered $event): void; } Events/Test/Issue/PhpunitWarningTriggeredSubscriber.php 0000644 00000001061 15107470276 0017375 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PhpunitWarningTriggeredSubscriber extends Subscriber { public function notify(PhpunitWarningTriggered $event): void; } Events/Test/Issue/PhpNoticeTriggered.php 0000644 00000005602 15107470276 0014272 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PhpNoticeTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; /** * @psalm-var non-empty-string */ private readonly string $message; /** * @psalm-var non-empty-string */ private readonly string $file; /** * @psalm-var positive-int */ private readonly int $line; private readonly bool $suppressed; private readonly bool $ignoredByBaseline; /** * @psalm-param non-empty-string $message * @psalm-param non-empty-string $file * @psalm-param positive-int $line */ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; $this->file = $file; $this->line = $line; $this->suppressed = $suppressed; $this->ignoredByBaseline = $ignoredByBaseline; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Test { return $this->test; } /** * @psalm-return non-empty-string */ public function message(): string { return $this->message; } /** * @psalm-return non-empty-string */ public function file(): string { return $this->file; } /** * @psalm-return positive-int */ public function line(): int { return $this->line; } public function wasSuppressed(): bool { return $this->suppressed; } public function ignoredByBaseline(): bool { return $this->ignoredByBaseline; } public function asString(): string { $message = $this->message; if (!empty($message)) { $message = PHP_EOL . $message; } $status = ''; if ($this->ignoredByBaseline) { $status = 'Baseline-Ignored '; } elseif ($this->suppressed) { $status = 'Suppressed '; } return sprintf( 'Test Triggered %sPHP Notice (%s)%s', $status, $this->test->id(), $message, ); } } Events/Test/Issue/PhpNoticeTriggeredSubscriber.php 0000644 00000001047 15107470276 0016315 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PhpNoticeTriggeredSubscriber extends Subscriber { public function notify(PhpNoticeTriggered $event): void; } Events/Test/Issue/PhpDeprecationTriggeredSubscriber.php 0000644 00000001061 15107470276 0017325 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PhpDeprecationTriggeredSubscriber extends Subscriber { public function notify(PhpDeprecationTriggered $event): void; } Events/Test/Issue/ConsideredRisky.php 0000644 00000003075 15107470276 0013647 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ConsideredRisky implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Code\Test $test; /** * @psalm-var non-empty-string */ private readonly string $message; /** * @psalm-param non-empty-string $message */ public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test, string $message) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Code\Test { return $this->test; } /** * @psalm-return non-empty-string */ public function message(): string { return $this->message; } public function asString(): string { return sprintf( 'Test Considered Risky (%s)%s%s', $this->test->id(), PHP_EOL, $this->message, ); } } Events/Test/Issue/DeprecationTriggered.php 0000644 00000005605 15107470277 0014642 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class DeprecationTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; /** * @psalm-var non-empty-string */ private readonly string $message; /** * @psalm-var non-empty-string */ private readonly string $file; /** * @psalm-var positive-int */ private readonly int $line; private readonly bool $suppressed; private readonly bool $ignoredByBaseline; /** * @psalm-param non-empty-string $message * @psalm-param non-empty-string $file * @psalm-param positive-int $line */ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; $this->file = $file; $this->line = $line; $this->suppressed = $suppressed; $this->ignoredByBaseline = $ignoredByBaseline; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Test { return $this->test; } /** * @psalm-return non-empty-string */ public function message(): string { return $this->message; } /** * @psalm-return non-empty-string */ public function file(): string { return $this->file; } /** * @psalm-return positive-int */ public function line(): int { return $this->line; } public function wasSuppressed(): bool { return $this->suppressed; } public function ignoredByBaseline(): bool { return $this->ignoredByBaseline; } public function asString(): string { $message = $this->message; if (!empty($message)) { $message = PHP_EOL . $message; } $status = ''; if ($this->ignoredByBaseline) { $status = 'Baseline-Ignored '; } elseif ($this->suppressed) { $status = 'Suppressed '; } return sprintf( 'Test Triggered %sDeprecation (%s)%s', $status, $this->test->id(), $message, ); } } Events/Test/Issue/PhpunitWarningTriggered.php 0000644 00000002771 15107470277 0015363 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PhpunitWarningTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; private readonly string $message; public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Test { return $this->test; } public function message(): string { return $this->message; } public function asString(): string { $message = $this->message; if (!empty($message)) { $message = PHP_EOL . $message; } return sprintf( 'Test Triggered PHPUnit Warning (%s)%s', $this->test->id(), $message, ); } } Events/Test/Issue/NoticeTriggered.php 0000644 00000005573 15107470277 0013632 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class NoticeTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; /** * @psalm-var non-empty-string */ private readonly string $message; /** * @psalm-var non-empty-string */ private readonly string $file; /** * @psalm-var positive-int */ private readonly int $line; private readonly bool $suppressed; private readonly bool $ignoredByBaseline; /** * @psalm-param non-empty-string $message * @psalm-param non-empty-string $file * @psalm-param positive-int $line */ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; $this->file = $file; $this->line = $line; $this->suppressed = $suppressed; $this->ignoredByBaseline = $ignoredByBaseline; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Test { return $this->test; } /** * @psalm-return non-empty-string */ public function message(): string { return $this->message; } /** * @psalm-return non-empty-string */ public function file(): string { return $this->file; } /** * @psalm-return positive-int */ public function line(): int { return $this->line; } public function wasSuppressed(): bool { return $this->suppressed; } public function ignoredByBaseline(): bool { return $this->ignoredByBaseline; } public function asString(): string { $message = $this->message; if (!empty($message)) { $message = PHP_EOL . $message; } $status = ''; if ($this->ignoredByBaseline) { $status = 'Baseline-Ignored '; } elseif ($this->suppressed) { $status = 'Suppressed '; } return sprintf( 'Test Triggered %sNotice (%s)%s', $status, $this->test->id(), $message, ); } } Events/Test/Issue/PhpunitDeprecationTriggeredSubscriber.php 0000644 00000001071 15107470277 0020227 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PhpunitDeprecationTriggeredSubscriber extends Subscriber { public function notify(PhpunitDeprecationTriggered $event): void; } Events/Test/Issue/WarningTriggeredSubscriber.php 0000644 00000001043 15107470300 0016011 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface WarningTriggeredSubscriber extends Subscriber { public function notify(WarningTriggered $event): void; } Events/Test/Issue/PhpunitErrorTriggered.php 0000644 00000003016 15107470300 0015023 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\Event\Test; use const PHP_EOL; use function sprintf; use function trim; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PhpunitErrorTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; private readonly string $message; public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Test { return $this->test; } public function message(): string { return $this->message; } public function asString(): string { $message = trim($this->message); if (!empty($message)) { $message = PHP_EOL . $message; } return sprintf( 'Test Triggered PHPUnit Error (%s)%s', $this->test->id(), $message, ); } } Events/Test/Issue/ErrorTriggered.php 0000644 00000004742 15107470300 0013462 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ErrorTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; /** * @psalm-var non-empty-string */ private readonly string $message; /** * @psalm-var non-empty-string */ private readonly string $file; /** * @psalm-var positive-int */ private readonly int $line; private readonly bool $suppressed; /** * @psalm-param non-empty-string $message * @psalm-param non-empty-string $file * @psalm-param positive-int $line */ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; $this->file = $file; $this->line = $line; $this->suppressed = $suppressed; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Test { return $this->test; } /** * @psalm-return non-empty-string */ public function message(): string { return $this->message; } /** * @psalm-return non-empty-string */ public function file(): string { return $this->file; } /** * @psalm-return positive-int */ public function line(): int { return $this->line; } public function wasSuppressed(): bool { return $this->suppressed; } public function asString(): string { $message = $this->message; if (!empty($message)) { $message = PHP_EOL . $message; } return sprintf( 'Test Triggered %sError (%s)%s', $this->wasSuppressed() ? 'Suppressed ' : '', $this->test->id(), $message, ); } } Events/Test/Issue/NoticeTriggeredSubscriber.php 0000644 00000001041 15107470300 0015623 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface NoticeTriggeredSubscriber extends Subscriber { public function notify(NoticeTriggered $event): void; } Events/Test/Issue/ConsideredRiskySubscriber.php 0000644 00000001041 15107470301 0015647 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface ConsideredRiskySubscriber extends Subscriber { public function notify(ConsideredRisky $event): void; } Events/Test/Issue/WarningTriggered.php 0000644 00000005575 15107470301 0014004 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class WarningTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Test $test; /** * @psalm-var non-empty-string */ private readonly string $message; /** * @psalm-var non-empty-string */ private readonly string $file; /** * @psalm-var positive-int */ private readonly int $line; private readonly bool $suppressed; private readonly bool $ignoredByBaseline; /** * @psalm-param non-empty-string $message * @psalm-param non-empty-string $file * @psalm-param positive-int $line */ public function __construct(Telemetry\Info $telemetryInfo, Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; $this->file = $file; $this->line = $line; $this->suppressed = $suppressed; $this->ignoredByBaseline = $ignoredByBaseline; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Test { return $this->test; } /** * @psalm-return non-empty-string */ public function message(): string { return $this->message; } /** * @psalm-return non-empty-string */ public function file(): string { return $this->file; } /** * @psalm-return positive-int */ public function line(): int { return $this->line; } public function wasSuppressed(): bool { return $this->suppressed; } public function ignoredByBaseline(): bool { return $this->ignoredByBaseline; } public function asString(): string { $message = $this->message; if (!empty($message)) { $message = PHP_EOL . $message; } $status = ''; if ($this->ignoredByBaseline) { $status = 'Baseline-Ignored '; } elseif ($this->suppressed) { $status = 'Suppressed '; } return sprintf( 'Test Triggered %sWarning (%s)%s', $status, $this->test->id(), $message, ); } } Events/Test/Issue/ErrorTriggeredSubscriber.php 0000644 00000001037 15107470301 0015501 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface ErrorTriggeredSubscriber extends Subscriber { public function notify(ErrorTriggered $event): void; } Events/Test/Issue/PhpWarningTriggeredSubscriber.php 0000644 00000001051 15107470302 0016462 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PhpWarningTriggeredSubscriber extends Subscriber { public function notify(PhpWarningTriggered $event): void; } Events/Test/Outcome/Errored.php 0000644 00000003074 15107470302 0012460 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\Event\Test; use const PHP_EOL; use function sprintf; use function trim; use PHPUnit\Event\Code; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Errored implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Code\Test $test; private readonly Throwable $throwable; public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test, Throwable $throwable) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->throwable = $throwable; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Code\Test { return $this->test; } public function throwable(): Throwable { return $this->throwable; } public function asString(): string { $message = trim($this->throwable->message()); if (!empty($message)) { $message = PHP_EOL . $message; } return sprintf( 'Test Errored (%s)%s', $this->test->id(), $message, ); } } Events/Test/Outcome/Skipped.php 0000644 00000002741 15107470302 0012455 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Skipped implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Code\Test $test; private readonly string $message; public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test, string $message) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->message = $message; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Code\Test { return $this->test; } public function message(): string { return $this->message; } public function asString(): string { $message = $this->message; if (!empty($message)) { $message = PHP_EOL . $message; } return sprintf( 'Test Skipped (%s)%s', $this->test->id(), $message, ); } } Events/Test/Outcome/PassedSubscriber.php 0000644 00000001017 15107470302 0014314 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PassedSubscriber extends Subscriber { public function notify(Passed $event): void; } Events/Test/Outcome/SkippedSubscriber.php 0000644 00000001021 15107470303 0014470 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface SkippedSubscriber extends Subscriber { public function notify(Skipped $event): void; } Events/Test/Outcome/FailedSubscriber.php 0000644 00000001017 15107470303 0014262 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface FailedSubscriber extends Subscriber { public function notify(Failed $event): void; } Events/Test/Outcome/Failed.php 0000644 00000004343 15107470303 0012243 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\Event\Test; use const PHP_EOL; use function sprintf; use function trim; use PHPUnit\Event\Code; use PHPUnit\Event\Code\ComparisonFailure; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Failed implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Code\Test $test; private readonly Throwable $throwable; private readonly ?ComparisonFailure $comparisonFailure; public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test, Throwable $throwable, ?ComparisonFailure $comparisonFailure) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->throwable = $throwable; $this->comparisonFailure = $comparisonFailure; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Code\Test { return $this->test; } public function throwable(): Throwable { return $this->throwable; } /** * @psalm-assert-if-true !null $this->comparisonFailure */ public function hasComparisonFailure(): bool { return $this->comparisonFailure !== null; } /** * @throws NoComparisonFailureException */ public function comparisonFailure(): ComparisonFailure { if ($this->comparisonFailure === null) { throw new NoComparisonFailureException; } return $this->comparisonFailure; } public function asString(): string { $message = trim($this->throwable->message()); if (!empty($message)) { $message = PHP_EOL . $message; } return sprintf( 'Test Failed (%s)%s', $this->test->id(), $message, ); } } Events/Test/Outcome/MarkedIncomplete.php 0000644 00000003117 15107470303 0014300 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\Event\Test; use const PHP_EOL; use function sprintf; use function trim; use PHPUnit\Event\Code; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class MarkedIncomplete implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Code\Test $test; private readonly Throwable $throwable; public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test, Throwable $throwable) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->throwable = $throwable; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Code\Test { return $this->test; } public function throwable(): Throwable { return $this->throwable; } public function asString(): string { $message = trim($this->throwable->message()); if (!empty($message)) { $message = PHP_EOL . $message; } return sprintf( 'Test Marked Incomplete (%s)%s', $this->test->id(), $message, ); } } Events/Test/Outcome/Passed.php 0000644 00000002210 15107470303 0012265 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Passed implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Code\Test $test; public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Code\Test { return $this->test; } public function asString(): string { return sprintf( 'Test Passed (%s)', $this->test->id(), ); } } Events/Test/Outcome/ErroredSubscriber.php 0000644 00000001021 15107470303 0014473 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface ErroredSubscriber extends Subscriber { public function notify(Errored $event): void; } Events/Test/Outcome/MarkedIncompleteSubscriber.php 0000644 00000001043 15107470304 0016321 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface MarkedIncompleteSubscriber extends Subscriber { public function notify(MarkedIncomplete $event): void; } Events/Test/ComparatorRegisteredSubscriber.php 0000644 00000001053 15107470304 0015611 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface ComparatorRegisteredSubscriber extends Subscriber { public function notify(ComparatorRegistered $event): void; } Events/Test/HookMethod/AfterLastTestMethodCalled.php 0000644 00000003236 15107470304 0016501 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class AfterLastTestMethodCalled implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; private readonly Code\ClassMethod $calledMethod; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethod = $calledMethod; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } public function calledMethod(): Code\ClassMethod { return $this->calledMethod; } public function asString(): string { return sprintf( 'After Last Test Method Called (%s::%s)', $this->calledMethod->className(), $this->calledMethod->methodName(), ); } } Events/Test/HookMethod/BeforeTestMethodFinishedSubscriber.php 0000644 00000001063 15107470304 0020403 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface BeforeTestMethodFinishedSubscriber extends Subscriber { public function notify(BeforeTestMethodFinished $event): void; } Events/Test/HookMethod/AfterLastTestMethodFinishedSubscriber.php 0000644 00000001071 15107470304 0021065 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface AfterLastTestMethodFinishedSubscriber extends Subscriber { public function notify(AfterLastTestMethodFinished $event): void; } Events/Test/HookMethod/BeforeFirstTestMethodCalledSubscriber.php 0000644 00000001071 15107470305 0021046 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface BeforeFirstTestMethodCalledSubscriber extends Subscriber { public function notify(BeforeFirstTestMethodCalled $event): void; } Events/Test/HookMethod/PreConditionCalledSubscriber.php 0000644 00000001047 15107470305 0017233 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PreConditionCalledSubscriber extends Subscriber { public function notify(PreConditionCalled $event): void; } Events/Test/HookMethod/PreConditionCalled.php 0000644 00000003224 15107470305 0015206 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PreConditionCalled implements Event { private readonly Telemetry\Info$telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; private readonly Code\ClassMethod $calledMethod; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethod = $calledMethod; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } public function calledMethod(): Code\ClassMethod { return $this->calledMethod; } public function asString(): string { return sprintf( 'Pre Condition Method Called (%s::%s)', $this->calledMethod->className(), $this->calledMethod->methodName(), ); } } Events/Test/HookMethod/PreConditionFinishedSubscriber.php 0000644 00000001053 15107470305 0017575 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PreConditionFinishedSubscriber extends Subscriber { public function notify(PreConditionFinished $event): void; } Events/Test/HookMethod/BeforeTestMethodCalledSubscriber.php 0000644 00000001057 15107470305 0020042 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface BeforeTestMethodCalledSubscriber extends Subscriber { public function notify(BeforeTestMethodCalled $event): void; } Events/Test/HookMethod/BeforeTestMethodCalled.php 0000644 00000003227 15107470306 0016020 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class BeforeTestMethodCalled implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; private readonly Code\ClassMethod $calledMethod; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethod = $calledMethod; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } public function calledMethod(): Code\ClassMethod { return $this->calledMethod; } public function asString(): string { return sprintf( 'Before Test Method Called (%s::%s)', $this->calledMethod->className(), $this->calledMethod->methodName(), ); } } Events/Test/HookMethod/AfterTestMethodFinishedSubscriber.php 0000644 00000001061 15107470306 0020242 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface AfterTestMethodFinishedSubscriber extends Subscriber { public function notify(AfterTestMethodFinished $event): void; } Events/Test/HookMethod/PostConditionFinished.php 0000644 00000003640 15107470306 0015755 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PostConditionFinished implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; /** * @psalm-var list<Code\ClassMethod> */ private readonly array $calledMethods; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethods = $calledMethods; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } /** * @psalm-return list<Code\ClassMethod> */ public function calledMethods(): array { return $this->calledMethods; } public function asString(): string { $buffer = 'Post Condition Method Finished:'; foreach ($this->calledMethods as $calledMethod) { $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), $calledMethod->methodName(), ); } return $buffer; } } Events/Test/HookMethod/AfterLastTestMethodFinished.php 0000644 00000003647 15107470306 0017056 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class AfterLastTestMethodFinished implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; /** * @psalm-var list<Code\ClassMethod> */ private readonly array $calledMethods; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethods = $calledMethods; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } /** * @psalm-return list<Code\ClassMethod> */ public function calledMethods(): array { return $this->calledMethods; } public function asString(): string { $buffer = 'After Last Test Method Finished:'; foreach ($this->calledMethods as $calledMethod) { $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), $calledMethod->methodName(), ); } return $buffer; } } Events/Test/HookMethod/AfterTestMethodCalled.php 0000644 00000003225 15107470307 0015656 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class AfterTestMethodCalled implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; private readonly Code\ClassMethod $calledMethod; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethod = $calledMethod; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } public function calledMethod(): Code\ClassMethod { return $this->calledMethod; } public function asString(): string { return sprintf( 'After Test Method Called (%s::%s)', $this->calledMethod->className(), $this->calledMethod->methodName(), ); } } Events/Test/HookMethod/PostConditionCalled.php 0000644 00000003227 15107470307 0015412 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PostConditionCalled implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; private readonly Code\ClassMethod $calledMethod; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethod = $calledMethod; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } public function calledMethod(): Code\ClassMethod { return $this->calledMethod; } public function asString(): string { return sprintf( 'Post Condition Method Called (%s::%s)', $this->calledMethod->className(), $this->calledMethod->methodName(), ); } } Events/Test/HookMethod/PostConditionFinishedSubscriber.php 0000644 00000001055 15107470307 0020000 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PostConditionFinishedSubscriber extends Subscriber { public function notify(PostConditionFinished $event): void; } Events/Test/HookMethod/BeforeFirstTestMethodFinishedSubscriber.php 0000644 00000001075 15107470307 0021421 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface BeforeFirstTestMethodFinishedSubscriber extends Subscriber { public function notify(BeforeFirstTestMethodFinished $event): void; } Events/Test/HookMethod/BeforeFirstTestMethodCalled.php 0000644 00000003242 15107470307 0017026 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class BeforeFirstTestMethodCalled implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; private readonly Code\ClassMethod $calledMethod; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethod = $calledMethod; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } public function calledMethod(): Code\ClassMethod { return $this->calledMethod; } public function asString(): string { return sprintf( 'Before First Test Method Called (%s::%s)', $this->calledMethod->className(), $this->calledMethod->methodName(), ); } } Events/Test/HookMethod/PreConditionFinished.php 0000644 00000003636 15107470310 0015556 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PreConditionFinished implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; /** * @psalm-var list<Code\ClassMethod> */ private readonly array $calledMethods; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethods = $calledMethods; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } /** * @psalm-return list<Code\ClassMethod> */ public function calledMethods(): array { return $this->calledMethods; } public function asString(): string { $buffer = 'Pre Condition Method Finished:'; foreach ($this->calledMethods as $calledMethod) { $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), $calledMethod->methodName(), ); } return $buffer; } } Events/Test/HookMethod/AfterTestMethodCalledSubscriber.php 0000644 00000001055 15107470310 0017673 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface AfterTestMethodCalledSubscriber extends Subscriber { public function notify(AfterTestMethodCalled $event): void; } Events/Test/HookMethod/BeforeFirstTestMethodErrored.php 0000644 00000004052 15107470310 0017236 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class BeforeFirstTestMethodErrored implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; private readonly Code\ClassMethod $calledMethod; private readonly Throwable $throwable; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod $calledMethod, Throwable $throwable) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethod = $calledMethod; $this->throwable = $throwable; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } public function calledMethod(): Code\ClassMethod { return $this->calledMethod; } public function throwable(): Throwable { return $this->throwable; } public function asString(): string { $message = $this->throwable->message(); if (!empty($message)) { $message = PHP_EOL . $message; } return sprintf( 'Before First Test Method Errored (%s::%s)%s', $this->calledMethod->className(), $this->calledMethod->methodName(), $message, ); } } Events/Test/HookMethod/BeforeFirstTestMethodErroredSubscriber.php 0000644 00000001073 15107470310 0021262 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface BeforeFirstTestMethodErroredSubscriber extends Subscriber { public function notify(BeforeFirstTestMethodErrored $event): void; } Events/Test/HookMethod/BeforeTestMethodFinished.php 0000644 00000003640 15107470311 0016360 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class BeforeTestMethodFinished implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; /** * @psalm-var list<Code\ClassMethod> */ private readonly array $calledMethods; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethods = $calledMethods; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } /** * @psalm-return list<Code\ClassMethod> */ public function calledMethods(): array { return $this->calledMethods; } public function asString(): string { $buffer = 'Before Test Method Finished:'; foreach ($this->calledMethods as $calledMethod) { $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), $calledMethod->methodName(), ); } return $buffer; } } Events/Test/HookMethod/PostConditionCalledSubscriber.php 0000644 00000001051 15107470311 0017422 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PostConditionCalledSubscriber extends Subscriber { public function notify(PostConditionCalled $event): void; } Events/Test/HookMethod/AfterTestMethodFinished.php 0000644 00000003636 15107470311 0016224 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class AfterTestMethodFinished implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; /** * @psalm-var list<Code\ClassMethod> */ private readonly array $calledMethods; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethods = $calledMethods; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } /** * @psalm-return list<Code\ClassMethod> */ public function calledMethods(): array { return $this->calledMethods; } public function asString(): string { $buffer = 'After Test Method Finished:'; foreach ($this->calledMethods as $calledMethod) { $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), $calledMethod->methodName(), ); } return $buffer; } } Events/Test/HookMethod/AfterLastTestMethodCalledSubscriber.php 0000644 00000001065 15107470311 0020521 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface AfterLastTestMethodCalledSubscriber extends Subscriber { public function notify(AfterLastTestMethodCalled $event): void; } Events/Test/HookMethod/BeforeFirstTestMethodFinished.php 0000644 00000003652 15107470311 0017373 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class BeforeFirstTestMethodFinished implements Event { private readonly Telemetry\Info$telemetryInfo; /** * @psalm-var class-string */ private readonly string $testClassName; /** * @psalm-var list<Code\ClassMethod> */ private readonly array $calledMethods; /** * @psalm-param class-string $testClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $testClassName, Code\ClassMethod ...$calledMethods) { $this->telemetryInfo = $telemetryInfo; $this->testClassName = $testClassName; $this->calledMethods = $calledMethods; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function testClassName(): string { return $this->testClassName; } /** * @psalm-return list<Code\ClassMethod> */ public function calledMethods(): array { return $this->calledMethods; } public function asString(): string { $buffer = 'Before First Test Method Finished:'; foreach ($this->calledMethods as $calledMethod) { $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), $calledMethod->methodName(), ); } return $buffer; } } Events/Test/Assertion/AssertionSucceeded.php 0000644 00000003445 15107470311 0015170 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\Event\Test; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class AssertionSucceeded implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly string $value; private readonly string $constraint; private readonly int $count; private readonly string $message; public function __construct(Telemetry\Info $telemetryInfo, string $value, string $constraint, int $count, string $message) { $this->telemetryInfo = $telemetryInfo; $this->value = $value; $this->constraint = $constraint; $this->count = $count; $this->message = $message; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function value(): string { return $this->value; } public function count(): int { return $this->count; } public function message(): string { return $this->message; } public function asString(): string { $message = ''; if (!empty($this->message)) { $message = sprintf( ', Message: %s', $this->message, ); } return sprintf( 'Assertion Succeeded (Constraint: %s, Value: %s%s)', $this->constraint, $this->value, $message, ); } } Events/Test/Assertion/AssertionFailedSubscriber.php 0000644 00000001041 15107470312 0016503 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface AssertionFailedSubscriber extends Subscriber { public function notify(AssertionFailed $event): void; } Events/Test/Assertion/AssertionFailed.php 0000644 00000003437 15107470312 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\Event\Test; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class AssertionFailed implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly string $value; private readonly string $constraint; private readonly int $count; private readonly string $message; public function __construct(Telemetry\Info $telemetryInfo, string $value, string $constraint, int $count, string $message) { $this->telemetryInfo = $telemetryInfo; $this->value = $value; $this->constraint = $constraint; $this->count = $count; $this->message = $message; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function value(): string { return $this->value; } public function count(): int { return $this->count; } public function message(): string { return $this->message; } public function asString(): string { $message = ''; if (!empty($this->message)) { $message = sprintf( ', Message: %s', $this->message, ); } return sprintf( 'Assertion Failed (Constraint: %s, Value: %s%s)', $this->constraint, $this->value, $message, ); } } Events/Test/Assertion/AssertionSucceededSubscriber.php 0000644 00000001047 15107470312 0017211 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface AssertionSucceededSubscriber extends Subscriber { public function notify(AssertionSucceeded $event): void; } Events/Test/Lifecycle/Finished.php 0000644 00000002703 15107470312 0013072 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Finished implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Code\Test $test; private readonly int $numberOfAssertionsPerformed; public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test, int $numberOfAssertionsPerformed) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; $this->numberOfAssertionsPerformed = $numberOfAssertionsPerformed; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Code\Test { return $this->test; } public function numberOfAssertionsPerformed(): int { return $this->numberOfAssertionsPerformed; } public function asString(): string { return sprintf( 'Test Finished (%s)', $this->test->id(), ); } } Events/Test/Lifecycle/PreparationFailed.php 0000644 00000002237 15107470313 0014735 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PreparationFailed implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Code\Test $test; public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Code\Test { return $this->test; } public function asString(): string { return sprintf( 'Test Preparation Failed (%s)', $this->test->id(), ); } } Events/Test/Lifecycle/DataProviderMethodCalled.php 0000644 00000003206 15107470313 0016173 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\Event\Test; use function sprintf; use PHPUnit\Event\Code\ClassMethod; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry\Info; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class DataProviderMethodCalled implements Event { private readonly Info $telemetryInfo; private readonly ClassMethod $testMethod; private readonly ClassMethod $dataProviderMethod; public function __construct(Info $telemetryInfo, ClassMethod $testMethod, ClassMethod $dataProviderMethod) { $this->telemetryInfo = $telemetryInfo; $this->testMethod = $testMethod; $this->dataProviderMethod = $dataProviderMethod; } public function telemetryInfo(): Info { return $this->telemetryInfo; } public function testMethod(): ClassMethod { return $this->testMethod; } public function dataProviderMethod(): ClassMethod { return $this->dataProviderMethod; } public function asString(): string { return sprintf( 'Data Provider Method Called (%s::%s for test method %s::%s)', $this->dataProviderMethod->className(), $this->dataProviderMethod->methodName(), $this->testMethod->className(), $this->testMethod->methodName(), ); } } Events/Test/Lifecycle/Prepared.php 0000644 00000002214 15107470313 0013101 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Prepared implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Code\Test $test; public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Code\Test { return $this->test; } public function asString(): string { return sprintf( 'Test Prepared (%s)', $this->test->id(), ); } } Events/Test/Lifecycle/DataProviderMethodFinishedSubscriber.php 0000644 00000001067 15107470313 0020567 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface DataProviderMethodFinishedSubscriber extends Subscriber { public function notify(DataProviderMethodFinished $event): void; } Events/Test/Lifecycle/DataProviderMethodCalledSubscriber.php 0000644 00000001063 15107470313 0020216 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface DataProviderMethodCalledSubscriber extends Subscriber { public function notify(DataProviderMethodCalled $event): void; } Events/Test/Lifecycle/FinishedSubscriber.php 0000644 00000001023 15107470314 0015112 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface FinishedSubscriber extends Subscriber { public function notify(Finished $event): void; } Events/Test/Lifecycle/PreparedSubscriber.php 0000644 00000001023 15107470314 0015123 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PreparedSubscriber extends Subscriber { public function notify(Prepared $event): void; } Events/Test/Lifecycle/PreparationStartedSubscriber.php 0000644 00000001047 15107470314 0017202 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PreparationStartedSubscriber extends Subscriber { public function notify(PreparationStarted $event): void; } Events/Test/Lifecycle/DataProviderMethodFinished.php 0000644 00000003640 15107470314 0016543 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\Event\Test; use const PHP_EOL; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Code\ClassMethod; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class DataProviderMethodFinished implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly ClassMethod $testMethod; /** * @psalm-var list<ClassMethod> */ private readonly array $calledMethods; public function __construct(Telemetry\Info $telemetryInfo, ClassMethod $testMethod, ClassMethod ...$calledMethods) { $this->telemetryInfo = $telemetryInfo; $this->testMethod = $testMethod; $this->calledMethods = $calledMethods; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function testMethod(): ClassMethod { return $this->testMethod; } /** * @psalm-return list<Code\ClassMethod> */ public function calledMethods(): array { return $this->calledMethods; } public function asString(): string { $buffer = sprintf( 'Data Provider Method Finished for %s::%s:', $this->testMethod->className(), $this->testMethod->methodName(), ); foreach ($this->calledMethods as $calledMethod) { $buffer .= sprintf( PHP_EOL . '- %s::%s', $calledMethod->className(), $calledMethod->methodName(), ); } return $buffer; } } Events/Test/Lifecycle/PreparationFailedSubscriber.php 0000644 00000001045 15107470315 0016757 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PreparationFailedSubscriber extends Subscriber { public function notify(PreparationFailed $event): void; } Events/Test/Lifecycle/PreparationStarted.php 0000644 00000002241 15107470315 0015154 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\Event\Test; use function sprintf; use PHPUnit\Event\Code; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PreparationStarted implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Code\Test $test; public function __construct(Telemetry\Info $telemetryInfo, Code\Test $test) { $this->telemetryInfo = $telemetryInfo; $this->test = $test; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function test(): Code\Test { return $this->test; } public function asString(): string { return sprintf( 'Test Preparation Started (%s)', $this->test->id(), ); } } Events/Test/TestDouble/TestStubCreatedSubscriber.php 0000644 00000001041 15107470315 0016602 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface TestStubCreatedSubscriber extends Subscriber { public function notify(TestStubCreated $event): void; } Events/Test/TestDouble/MockObjectForAbstractClassCreatedSubscriber.php 0000644 00000001105 15107470315 0022167 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface MockObjectForAbstractClassCreatedSubscriber extends Subscriber { public function notify(MockObjectForAbstractClassCreated $event): void; } Events/Test/TestDouble/MockObjectForIntersectionOfInterfacesCreated.php 0000644 00000002577 15107470315 0022367 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\Event\Test; use function implode; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class MockObjectForIntersectionOfInterfacesCreated implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var list<class-string> */ private readonly array $interfaces; /** * @psalm-param list<class-string> $interfaces */ public function __construct(Telemetry\Info $telemetryInfo, array $interfaces) { $this->telemetryInfo = $telemetryInfo; $this->interfaces = $interfaces; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @return list<class-string> */ public function interfaces(): array { return $this->interfaces; } public function asString(): string { return sprintf( 'Mock Object Created (%s)', implode('&', $this->interfaces), ); } } Events/Test/TestDouble/MockObjectFromWsdlCreated.php 0000644 00000005202 15107470316 0016503 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\Event\Test; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class MockObjectFromWsdlCreated implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly string $wsdlFile; /** * @psalm-var class-string */ private readonly string $originalClassName; /** * @psalm-var class-string */ private readonly string $mockClassName; /** * @psalm-var list<string> */ private readonly array $methods; private readonly bool $callOriginalConstructor; private readonly array $options; /** * @psalm-param class-string $originalClassName * @psalm-param class-string $mockClassName */ public function __construct(Telemetry\Info $telemetryInfo, string $wsdlFile, string $originalClassName, string $mockClassName, array $methods, bool $callOriginalConstructor, array $options) { $this->telemetryInfo = $telemetryInfo; $this->wsdlFile = $wsdlFile; $this->originalClassName = $originalClassName; $this->mockClassName = $mockClassName; $this->methods = $methods; $this->callOriginalConstructor = $callOriginalConstructor; $this->options = $options; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function wsdlFile(): string { return $this->wsdlFile; } /** * @psalm-return class-string */ public function originalClassName(): string { return $this->originalClassName; } /** * @psalm-return class-string */ public function mockClassName(): string { return $this->mockClassName; } /** * @psalm-return list<string> */ public function methods(): array { return $this->methods; } public function callOriginalConstructor(): bool { return $this->callOriginalConstructor; } public function options(): array { return $this->options; } public function asString(): string { return sprintf( 'Mock Object Created (%s)', $this->wsdlFile, ); } } Events/Test/TestDouble/TestProxyCreated.php 0000644 00000003066 15107470316 0014774 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\Event\Test; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestProxyCreated implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $className; private readonly string $constructorArguments; /** * @psalm-param class-string $className */ public function __construct(Telemetry\Info $telemetryInfo, string $className, string $constructorArguments) { $this->telemetryInfo = $telemetryInfo; $this->className = $className; $this->constructorArguments = $constructorArguments; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function className(): string { return $this->className; } public function constructorArguments(): string { return $this->constructorArguments; } public function asString(): string { return sprintf( 'Test Proxy Created (%s)', $this->className, ); } } Events/Test/TestDouble/MockObjectFromWsdlCreatedSubscriber.php 0000644 00000001065 15107470316 0020532 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface MockObjectFromWsdlCreatedSubscriber extends Subscriber { public function notify(MockObjectFromWsdlCreated $event): void; } Events/Test/TestDouble/MockObjectCreated.php 0000644 00000002460 15107470316 0015030 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\Event\Test; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class MockObjectCreated implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $className; /** * @psalm-param class-string $className */ public function __construct(Telemetry\Info $telemetryInfo, string $className) { $this->telemetryInfo = $telemetryInfo; $this->className = $className; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function className(): string { return $this->className; } public function asString(): string { return sprintf( 'Mock Object Created (%s)', $this->className, ); } } Events/Test/TestDouble/TestStubForIntersectionOfInterfacesCreatedSubscriber.php 0000644 00000001127 15107470316 0024137 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface TestStubForIntersectionOfInterfacesCreatedSubscriber extends Subscriber { public function notify(TestStubForIntersectionOfInterfacesCreated $event): void; } Events/Test/TestDouble/MockObjectForTraitCreated.php 0000644 00000002470 15107470317 0016505 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\Event\Test; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class MockObjectForTraitCreated implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var trait-string */ private readonly string $traitName; /** * @psalm-param trait-string $traitName */ public function __construct(Telemetry\Info $telemetryInfo, string $traitName) { $this->telemetryInfo = $telemetryInfo; $this->traitName = $traitName; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return trait-string */ public function traitName(): string { return $this->traitName; } public function asString(): string { return sprintf( 'Mock Object Created (%s)', $this->traitName, ); } } Events/Test/TestDouble/TestStubForIntersectionOfInterfacesCreated.php 0000644 00000002573 15107470317 0022122 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\Event\Test; use function implode; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestStubForIntersectionOfInterfacesCreated implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var list<class-string> */ private readonly array $interfaces; /** * @psalm-param list<class-string> $interfaces */ public function __construct(Telemetry\Info $telemetryInfo, array $interfaces) { $this->telemetryInfo = $telemetryInfo; $this->interfaces = $interfaces; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @return list<class-string> */ public function interfaces(): array { return $this->interfaces; } public function asString(): string { return sprintf( 'Test Stub Created (%s)', implode('&', $this->interfaces), ); } } Events/Test/TestDouble/MockObjectForIntersectionOfInterfacesCreatedSubscriber.php 0000644 00000001133 15107470317 0024400 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface MockObjectForIntersectionOfInterfacesCreatedSubscriber extends Subscriber { public function notify(MockObjectForIntersectionOfInterfacesCreated $event): void; } Events/Test/TestDouble/MockObjectForAbstractClassCreated.php 0000644 00000002500 15107470317 0020145 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\Event\Test; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class MockObjectForAbstractClassCreated implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $className; /** * @psalm-param class-string $className */ public function __construct(Telemetry\Info $telemetryInfo, string $className) { $this->telemetryInfo = $telemetryInfo; $this->className = $className; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function className(): string { return $this->className; } public function asString(): string { return sprintf( 'Mock Object Created (%s)', $this->className, ); } } Events/Test/TestDouble/PartialMockObjectCreatedSubscriber.php 0000644 00000001063 15107470320 0020362 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface PartialMockObjectCreatedSubscriber extends Subscriber { public function notify(PartialMockObjectCreated $event): void; } Events/Test/TestDouble/TestStubCreated.php 0000644 00000002440 15107470320 0014556 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\Event\Test; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestStubCreated implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @var class-string */ private readonly string $className; /** * @psalm-param class-string $className */ public function __construct(Telemetry\Info $telemetryInfo, string $className) { $this->telemetryInfo = $telemetryInfo; $this->className = $className; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @return class-string */ public function className(): string { return $this->className; } public function asString(): string { return sprintf( 'Test Stub Created (%s)', $this->className, ); } } Events/Test/TestDouble/MockObjectForTraitCreatedSubscriber.php 0000644 00000001065 15107470320 0020522 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface MockObjectForTraitCreatedSubscriber extends Subscriber { public function notify(MockObjectForTraitCreated $event): void; } Events/Test/TestDouble/TestProxyCreatedSubscriber.php 0000644 00000001043 15107470320 0017004 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface TestProxyCreatedSubscriber extends Subscriber { public function notify(TestProxyCreated $event): void; } Events/Test/TestDouble/MockObjectCreatedSubscriber.php 0000644 00000001045 15107470320 0017045 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\Event\Test; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface MockObjectCreatedSubscriber extends Subscriber { public function notify(MockObjectCreated $event): void; } Events/Test/TestDouble/PartialMockObjectCreated.php 0000644 00000003150 15107470321 0016336 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\Event\Test; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PartialMockObjectCreated implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $className; /** * @psalm-var list<string> */ private readonly array $methodNames; /** * @psalm-param class-string $className */ public function __construct(Telemetry\Info $telemetryInfo, string $className, string ...$methodNames) { $this->telemetryInfo = $telemetryInfo; $this->className = $className; $this->methodNames = $methodNames; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function className(): string { return $this->className; } /** * @psalm-return list<string> */ public function methodNames(): array { return $this->methodNames; } public function asString(): string { return sprintf( 'Partial Mock Object Created (%s)', $this->className, ); } } Events/Test/ComparatorRegistered.php 0000644 00000002465 15107470321 0013574 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\Event\Test; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ComparatorRegistered implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $className; /** * @psalm-param class-string $className */ public function __construct(Telemetry\Info $telemetryInfo, string $className) { $this->telemetryInfo = $telemetryInfo; $this->className = $className; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function className(): string { return $this->className; } public function asString(): string { return sprintf( 'Comparator Registered (%s)', $this->className, ); } } Events/Test/PrintedUnexpectedOutput.php 0000644 00000002514 15107470321 0014315 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\Event\Test; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PrintedUnexpectedOutput implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var non-empty-string */ private readonly string $output; /** * @psalm-param non-empty-string $output */ public function __construct(Telemetry\Info $telemetryInfo, string $output) { $this->telemetryInfo = $telemetryInfo; $this->output = $output; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return non-empty-string */ public function output(): string { return $this->output; } public function asString(): string { return sprintf( 'Test Printed Unexpected Output%s%s', PHP_EOL, $this->output, ); } } Events/TestRunner/GarbageCollectionEnabled.php 0000644 00000001635 15107470321 0015456 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\Event\TestRunner; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class GarbageCollectionEnabled implements Event { private readonly Telemetry\Info $telemetryInfo; public function __construct(Telemetry\Info $telemetryInfo) { $this->telemetryInfo = $telemetryInfo; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function asString(): string { return 'Test Runner Enabled Garbage Collection'; } } Events/TestRunner/Finished.php 0000644 00000001573 15107470321 0012371 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\Event\TestRunner; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Finished implements Event { private readonly Telemetry\Info $telemetryInfo; public function __construct(Telemetry\Info $telemetryInfo) { $this->telemetryInfo = $telemetryInfo; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function asString(): string { return 'Test Runner Finished'; } } Events/TestRunner/DeprecationTriggeredSubscriber.php 0000644 00000001061 15107470322 0016747 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface DeprecationTriggeredSubscriber extends Subscriber { public function notify(DeprecationTriggered $event): void; } Events/TestRunner/ExecutionFinishedSubscriber.php 0000644 00000001053 15107470322 0016273 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface ExecutionFinishedSubscriber extends Subscriber { public function notify(ExecutionFinished $event): void; } Events/TestRunner/Configured.php 0000644 00000002175 15107470322 0012725 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\Event\TestRunner; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; use PHPUnit\TextUI\Configuration\Configuration; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Configured implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Configuration $configuration; public function __construct(Telemetry\Info $telemetryInfo, Configuration $configuration) { $this->telemetryInfo = $telemetryInfo; $this->configuration = $configuration; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function configuration(): Configuration { return $this->configuration; } public function asString(): string { return 'Test Runner Configured'; } } Events/TestRunner/ExtensionBootstrapped.php 0000644 00000003245 15107470322 0015202 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\Event\TestRunner; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ExtensionBootstrapped implements Event { private readonly Telemetry\Info $telemetryInfo; /** * @psalm-var class-string */ private readonly string $className; /** * @psalm-var array<string, string> */ private readonly array $parameters; /** * @psalm-param class-string $className * @psalm-param array<string, string> $parameters */ public function __construct(Telemetry\Info $telemetryInfo, string $className, array $parameters) { $this->telemetryInfo = $telemetryInfo; $this->className = $className; $this->parameters = $parameters; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } /** * @psalm-return class-string */ public function className(): string { return $this->className; } /** * @psalm-return array<string, string> */ public function parameters(): array { return $this->parameters; } public function asString(): string { return sprintf( 'Extension Bootstrapped (%s)', $this->className, ); } } Events/TestRunner/ExecutionStartedSubscriber.php 0000644 00000001051 15107470322 0016146 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface ExecutionStartedSubscriber extends Subscriber { public function notify(ExecutionStarted $event): void; } Events/TestRunner/GarbageCollectionTriggered.php 0000644 00000001641 15107470323 0016037 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\Event\TestRunner; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class GarbageCollectionTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; public function __construct(Telemetry\Info $telemetryInfo) { $this->telemetryInfo = $telemetryInfo; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function asString(): string { return 'Test Runner Triggered Garbage Collection'; } } Events/TestRunner/EventFacadeSealedSubscriber.php 0000644 00000001053 15107470323 0016142 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface EventFacadeSealedSubscriber extends Subscriber { public function notify(EventFacadeSealed $event): void; } Events/TestRunner/GarbageCollectionEnabledSubscriber.php 0000644 00000001071 15107470323 0017476 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface GarbageCollectionEnabledSubscriber extends Subscriber { public function notify(GarbageCollectionEnabled $event): void; } Events/TestRunner/ExecutionFinished.php 0000644 00000001616 15107470323 0014255 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\Event\TestRunner; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ExecutionFinished implements Event { private readonly Telemetry\Info $telemetryInfo; public function __construct(Telemetry\Info $telemetryInfo) { $this->telemetryInfo = $telemetryInfo; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function asString(): string { return 'Test Runner Execution Finished'; } } Events/TestRunner/StartedSubscriber.php 0000644 00000001027 15107470323 0014266 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface StartedSubscriber extends Subscriber { public function notify(Started $event): void; } Events/TestRunner/GarbageCollectionTriggeredSubscriber.php 0000644 00000001075 15107470324 0020065 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface GarbageCollectionTriggeredSubscriber extends Subscriber { public function notify(GarbageCollectionTriggered $event): void; } Events/TestRunner/GarbageCollectionDisabled.php 0000644 00000001637 15107470324 0015640 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\Event\TestRunner; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class GarbageCollectionDisabled implements Event { private readonly Telemetry\Info $telemetryInfo; public function __construct(Telemetry\Info $telemetryInfo) { $this->telemetryInfo = $telemetryInfo; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function asString(): string { return 'Test Runner Disabled Garbage Collection'; } } Events/TestRunner/BootstrapFinished.php 0000644 00000002221 15107470324 0014261 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\Event\TestRunner; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class BootstrapFinished implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly string $filename; public function __construct(Telemetry\Info $telemetryInfo, string $filename) { $this->telemetryInfo = $telemetryInfo; $this->filename = $filename; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function filename(): string { return $this->filename; } public function asString(): string { return sprintf( 'Bootstrap Finished (%s)', $this->filename, ); } } Events/TestRunner/ExtensionLoadedFromPharSubscriber.php 0000644 00000001067 15107470324 0017411 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface ExtensionLoadedFromPharSubscriber extends Subscriber { public function notify(ExtensionLoadedFromPhar $event): void; } Events/TestRunner/ExtensionBootstrappedSubscriber.php 0000644 00000001063 15107470325 0017225 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface ExtensionBootstrappedSubscriber extends Subscriber { public function notify(ExtensionBootstrapped $event): void; } Events/TestRunner/EventFacadeSealed.php 0000644 00000001603 15107470325 0014121 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\Event\TestRunner; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class EventFacadeSealed implements Event { private readonly Telemetry\Info $telemetryInfo; public function __construct(Telemetry\Info $telemetryInfo) { $this->telemetryInfo = $telemetryInfo; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function asString(): string { return 'Event Facade Sealed'; } } Events/TestRunner/Started.php 0000644 00000001571 15107470325 0012250 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\Event\TestRunner; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Started implements Event { private readonly Telemetry\Info $telemetryInfo; public function __construct(Telemetry\Info $telemetryInfo) { $this->telemetryInfo = $telemetryInfo; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function asString(): string { return 'Test Runner Started'; } } Events/TestRunner/ExecutionAbortedSubscriber.php 0000644 00000001051 15107470325 0016123 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface ExecutionAbortedSubscriber extends Subscriber { public function notify(ExecutionAborted $event): void; } Events/TestRunner/ConfiguredSubscriber.php 0000644 00000001035 15107470325 0014746 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface ConfiguredSubscriber extends Subscriber { public function notify(Configured $event): void; } Events/TestRunner/DeprecationTriggered.php 0000644 00000002235 15107470326 0014733 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\Event\TestRunner; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class DeprecationTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly string $message; public function __construct(Telemetry\Info $telemetryInfo, string $message) { $this->telemetryInfo = $telemetryInfo; $this->message = $message; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function message(): string { return $this->message; } public function asString(): string { return sprintf( 'Test Runner Triggered Deprecation (%s)', $this->message, ); } } Events/TestRunner/GarbageCollectionDisabledSubscriber.php 0000644 00000001073 15107470326 0017660 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface GarbageCollectionDisabledSubscriber extends Subscriber { public function notify(GarbageCollectionDisabled $event): void; } Events/TestRunner/ExtensionLoadedFromPhar.php 0000644 00000003017 15107470326 0015364 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\Event\TestRunner; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ExtensionLoadedFromPhar implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly string $filename; private readonly string $name; private readonly string $version; public function __construct(Telemetry\Info $telemetryInfo, string $filename, string $name, string $version) { $this->telemetryInfo = $telemetryInfo; $this->filename = $filename; $this->name = $name; $this->version = $version; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function filename(): string { return $this->filename; } public function name(): string { return $this->name; } public function version(): string { return $this->version; } public function asString(): string { return sprintf( 'Extension Loaded from PHAR (%s %s)', $this->name, $this->version, ); } } Events/TestRunner/ExecutionStarted.php 0000644 00000002431 15107470326 0014131 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\Event\TestRunner; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; use PHPUnit\Event\TestSuite\TestSuite; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ExecutionStarted implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly TestSuite $testSuite; public function __construct(Telemetry\Info $telemetryInfo, TestSuite $testSuite) { $this->telemetryInfo = $telemetryInfo; $this->testSuite = $testSuite; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function testSuite(): TestSuite { return $this->testSuite; } public function asString(): string { return sprintf( 'Test Runner Execution Started (%d test%s)', $this->testSuite->count(), $this->testSuite->count() !== 1 ? 's' : '', ); } } Events/TestRunner/FinishedSubscriber.php 0000644 00000001031 15107470326 0014407 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface FinishedSubscriber extends Subscriber { public function notify(Finished $event): void; } Events/TestRunner/WarningTriggeredSubscriber.php 0000644 00000001051 15107470327 0016123 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface WarningTriggeredSubscriber extends Subscriber { public function notify(WarningTriggered $event): void; } Events/TestRunner/BootstrapFinishedSubscriber.php 0000644 00000001053 15107470327 0016312 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\Event\TestRunner; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface BootstrapFinishedSubscriber extends Subscriber { public function notify(BootstrapFinished $event): void; } Events/TestRunner/ExecutionAborted.php 0000644 00000001614 15107470327 0014106 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\Event\TestRunner; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ExecutionAborted implements Event { private readonly Telemetry\Info $telemetryInfo; public function __construct(Telemetry\Info $telemetryInfo) { $this->telemetryInfo = $telemetryInfo; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function asString(): string { return 'Test Runner Execution Aborted'; } } Events/TestRunner/WarningTriggered.php 0000644 00000002225 15107470327 0014103 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\Event\TestRunner; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class WarningTriggered implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly string $message; public function __construct(Telemetry\Info $telemetryInfo, string $message) { $this->telemetryInfo = $telemetryInfo; $this->message = $message; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function message(): string { return $this->message; } public function asString(): string { return sprintf( 'Test Runner Triggered Warning (%s)', $this->message, ); } } Events/Event.php 0000644 00000000772 15107470327 0007616 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\Event; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface Event { public function telemetryInfo(): Telemetry\Info; public function asString(): string; } Events/Application/Finished.php 0000644 00000002255 15107470330 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\Event\Application; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Finished implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly int $shellExitCode; public function __construct(Telemetry\Info $telemetryInfo, int $shellExitCode) { $this->telemetryInfo = $telemetryInfo; $this->shellExitCode = $shellExitCode; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function shellExitCode(): int { return $this->shellExitCode; } public function asString(): string { return sprintf( 'PHPUnit Finished (Shell Exit Code: %d)', $this->shellExitCode, ); } } Events/Application/StartedSubscriber.php 0000644 00000001030 15107470330 0014410 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\Event\Application; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface StartedSubscriber extends Subscriber { public function notify(Started $event): void; } Events/Application/Started.php 0000644 00000002261 15107470330 0012373 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\Event\Application; use function sprintf; use PHPUnit\Event\Event; use PHPUnit\Event\Runtime\Runtime; use PHPUnit\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Started implements Event { private readonly Telemetry\Info $telemetryInfo; private readonly Runtime $runtime; public function __construct(Telemetry\Info $telemetryInfo, Runtime $runtime) { $this->telemetryInfo = $telemetryInfo; $this->runtime = $runtime; } public function telemetryInfo(): Telemetry\Info { return $this->telemetryInfo; } public function runtime(): Runtime { return $this->runtime; } public function asString(): string { return sprintf( 'PHPUnit Started (%s)', $this->runtime->asString(), ); } } Events/Application/FinishedSubscriber.php 0000644 00000001032 15107470330 0014535 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\Event\Application; use PHPUnit\Event\Subscriber; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface FinishedSubscriber extends Subscriber { public function notify(Finished $event): void; } Value/Telemetry/SystemStopWatch.php 0000644 00000001242 15107470330 0013423 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\Event\Telemetry; use function hrtime; use PHPUnit\Event\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class SystemStopWatch implements StopWatch { /** * @throws InvalidArgumentException */ public function current(): HRTime { return HRTime::fromSecondsAndNanoseconds(...hrtime()); } } Value/Telemetry/GarbageCollectorStatus.php 0000644 00000011250 15107470331 0014706 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\Event\Telemetry; use PHPUnit\Event\RuntimeException; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class GarbageCollectorStatus { private readonly int $runs; private readonly int $collected; private readonly int $threshold; private readonly int $roots; private readonly ?float $applicationTime; private readonly ?float $collectorTime; private readonly ?float $destructorTime; private readonly ?float $freeTime; private readonly ?bool $running; private readonly ?bool $protected; private readonly ?bool $full; private readonly ?int $bufferSize; public function __construct(int $runs, int $collected, int $threshold, int $roots, ?float $applicationTime, ?float $collectorTime, ?float $destructorTime, ?float $freeTime, ?bool $running, ?bool $protected, ?bool $full, ?int $bufferSize) { $this->runs = $runs; $this->collected = $collected; $this->threshold = $threshold; $this->roots = $roots; $this->applicationTime = $applicationTime; $this->collectorTime = $collectorTime; $this->destructorTime = $destructorTime; $this->freeTime = $freeTime; $this->running = $running; $this->protected = $protected; $this->full = $full; $this->bufferSize = $bufferSize; } public function runs(): int { return $this->runs; } public function collected(): int { return $this->collected; } public function threshold(): int { return $this->threshold; } public function roots(): int { return $this->roots; } /** * @psalm-assert-if-true !null $this->applicationTime * @psalm-assert-if-true !null $this->collectorTime * @psalm-assert-if-true !null $this->destructorTime * @psalm-assert-if-true !null $this->freeTime * @psalm-assert-if-true !null $this->running * @psalm-assert-if-true !null $this->protected * @psalm-assert-if-true !null $this->full * @psalm-assert-if-true !null $this->bufferSize */ public function hasExtendedInformation(): bool { return $this->running !== null; } /** * @throws RuntimeException on PHP < 8.3 */ public function applicationTime(): float { if ($this->applicationTime === null) { throw new RuntimeException('Information not available'); } return $this->applicationTime; } /** * @throws RuntimeException on PHP < 8.3 */ public function collectorTime(): float { if ($this->collectorTime === null) { throw new RuntimeException('Information not available'); } return $this->collectorTime; } /** * @throws RuntimeException on PHP < 8.3 */ public function destructorTime(): float { if ($this->destructorTime === null) { throw new RuntimeException('Information not available'); } return $this->destructorTime; } /** * @throws RuntimeException on PHP < 8.3 */ public function freeTime(): float { if ($this->freeTime === null) { throw new RuntimeException('Information not available'); } return $this->freeTime; } /** * @throws RuntimeException on PHP < 8.3 */ public function isRunning(): bool { if ($this->running === null) { throw new RuntimeException('Information not available'); } return $this->running; } /** * @throws RuntimeException on PHP < 8.3 */ public function isProtected(): bool { if ($this->protected === null) { throw new RuntimeException('Information not available'); } return $this->protected; } /** * @throws RuntimeException on PHP < 8.3 */ public function isFull(): bool { if ($this->full === null) { throw new RuntimeException('Information not available'); } return $this->full; } /** * @throws RuntimeException on PHP < 8.3 */ public function bufferSize(): int { if ($this->bufferSize === null) { throw new RuntimeException('Information not available'); } return $this->bufferSize; } } Value/Telemetry/System.php 0000644 00000002326 15107470331 0011573 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\Event\Telemetry; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class System { private readonly StopWatch $stopWatch; private readonly MemoryMeter $memoryMeter; private readonly GarbageCollectorStatusProvider $garbageCollectorStatusProvider; public function __construct(StopWatch $stopWatch, MemoryMeter $memoryMeter, GarbageCollectorStatusProvider $garbageCollectorStatusProvider) { $this->stopWatch = $stopWatch; $this->memoryMeter = $memoryMeter; $this->garbageCollectorStatusProvider = $garbageCollectorStatusProvider; } public function snapshot(): Snapshot { return new Snapshot( $this->stopWatch->current(), $this->memoryMeter->memoryUsage(), $this->memoryMeter->peakMemoryUsage(), $this->garbageCollectorStatusProvider->status(), ); } } Value/Telemetry/Php81GarbageCollectorStatusProvider.php 0000644 00000001637 15107470331 0017252 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\Event\Telemetry; use function gc_status; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Php81GarbageCollectorStatusProvider implements GarbageCollectorStatusProvider { public function status(): GarbageCollectorStatus { $status = gc_status(); return new GarbageCollectorStatus( $status['runs'], $status['collected'], $status['threshold'], $status['roots'], null, null, null, null, null, null, null, null, ); } } Value/Telemetry/MemoryMeter.php 0000644 00000001005 15107470331 0012545 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\Event\Telemetry; /** * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface MemoryMeter { public function memoryUsage(): MemoryUsage; public function peakMemoryUsage(): MemoryUsage; } Value/Telemetry/Info.php 0000644 00000004501 15107470331 0011177 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\Event\Telemetry; use function sprintf; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Info { private readonly Snapshot $current; private readonly Duration $durationSinceStart; private readonly MemoryUsage $memorySinceStart; private readonly Duration $durationSincePrevious; private readonly MemoryUsage $memorySincePrevious; public function __construct(Snapshot $current, Duration $durationSinceStart, MemoryUsage $memorySinceStart, Duration $durationSincePrevious, MemoryUsage $memorySincePrevious) { $this->current = $current; $this->durationSinceStart = $durationSinceStart; $this->memorySinceStart = $memorySinceStart; $this->durationSincePrevious = $durationSincePrevious; $this->memorySincePrevious = $memorySincePrevious; } public function time(): HRTime { return $this->current->time(); } public function memoryUsage(): MemoryUsage { return $this->current->memoryUsage(); } public function peakMemoryUsage(): MemoryUsage { return $this->current->peakMemoryUsage(); } public function durationSinceStart(): Duration { return $this->durationSinceStart; } public function memoryUsageSinceStart(): MemoryUsage { return $this->memorySinceStart; } public function durationSincePrevious(): Duration { return $this->durationSincePrevious; } public function memoryUsageSincePrevious(): MemoryUsage { return $this->memorySincePrevious; } public function garbageCollectorStatus(): GarbageCollectorStatus { return $this->current->garbageCollectorStatus(); } public function asString(): string { return sprintf( '[%s / %s] [%d bytes]', $this->durationSinceStart()->asString(), $this->durationSincePrevious()->asString(), $this->memoryUsage()->bytes(), ); } } Value/Telemetry/HRTime.php 0000644 00000005156 15107470332 0011444 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\Event\Telemetry; use function sprintf; use PHPUnit\Event\InvalidArgumentException; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class HRTime { private readonly int $seconds; private readonly int $nanoseconds; /** * @throws InvalidArgumentException */ public static function fromSecondsAndNanoseconds(int $seconds, int $nanoseconds): self { return new self( $seconds, $nanoseconds, ); } /** * @throws InvalidArgumentException */ private function __construct(int $seconds, int $nanoseconds) { $this->ensureNotNegative($seconds, 'seconds'); $this->ensureNotNegative($nanoseconds, 'nanoseconds'); $this->ensureNanoSecondsInRange($nanoseconds); $this->seconds = $seconds; $this->nanoseconds = $nanoseconds; } public function seconds(): int { return $this->seconds; } public function nanoseconds(): int { return $this->nanoseconds; } /** * @throws InvalidArgumentException */ public function duration(self $start): Duration { $seconds = $this->seconds - $start->seconds(); $nanoseconds = $this->nanoseconds - $start->nanoseconds(); if ($nanoseconds < 0) { $seconds--; $nanoseconds += 1000000000; } if ($seconds < 0) { throw new InvalidArgumentException('Start needs to be smaller.'); } return Duration::fromSecondsAndNanoseconds( $seconds, $nanoseconds, ); } /** * @throws InvalidArgumentException */ private function ensureNotNegative(int $value, string $type): void { if ($value < 0) { throw new InvalidArgumentException( sprintf( 'Value for %s must not be negative.', $type, ), ); } } /** * @throws InvalidArgumentException */ private function ensureNanoSecondsInRange(int $nanoseconds): void { if ($nanoseconds > 999999999) { throw new InvalidArgumentException( 'Value for nanoseconds must not be greater than 999999999.', ); } } } Value/Telemetry/SystemMemoryMeter.php 0000644 00000001375 15107470332 0013765 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\Event\Telemetry; use function memory_get_peak_usage; use function memory_get_usage; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class SystemMemoryMeter implements MemoryMeter { public function memoryUsage(): MemoryUsage { return MemoryUsage::fromBytes(memory_get_usage(true)); } public function peakMemoryUsage(): MemoryUsage { return MemoryUsage::fromBytes(memory_get_peak_usage(true)); } } Value/Telemetry/Duration.php 0000644 00000006727 15107470332 0012106 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\Event\Telemetry; use function floor; use function sprintf; use PHPUnit\Event\InvalidArgumentException; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Duration { private readonly int $seconds; private readonly int $nanoseconds; /** * @throws InvalidArgumentException */ public static function fromSecondsAndNanoseconds(int $seconds, int $nanoseconds): self { return new self( $seconds, $nanoseconds, ); } /** * @throws InvalidArgumentException */ private function __construct(int $seconds, int $nanoseconds) { $this->ensureNotNegative($seconds, 'seconds'); $this->ensureNotNegative($nanoseconds, 'nanoseconds'); $this->ensureNanoSecondsInRange($nanoseconds); $this->seconds = $seconds; $this->nanoseconds = $nanoseconds; } public function seconds(): int { return $this->seconds; } public function nanoseconds(): int { return $this->nanoseconds; } public function asFloat(): float { return $this->seconds() + ($this->nanoseconds() / 1000000000); } public function asString(): string { $seconds = $this->seconds(); $minutes = 0; $hours = 0; if ($seconds > 60 * 60) { $hours = floor($seconds / 60 / 60); $seconds -= ($hours * 60 * 60); } if ($seconds > 60) { $minutes = floor($seconds / 60); $seconds -= ($minutes * 60); } return sprintf( '%02d:%02d:%02d.%09d', $hours, $minutes, $seconds, $this->nanoseconds(), ); } public function equals(self $other): bool { return $this->seconds === $other->seconds && $this->nanoseconds === $other->nanoseconds; } public function isLessThan(self $other): bool { if ($this->seconds < $other->seconds) { return true; } if ($this->seconds > $other->seconds) { return false; } return $this->nanoseconds < $other->nanoseconds; } public function isGreaterThan(self $other): bool { if ($this->seconds > $other->seconds) { return true; } if ($this->seconds < $other->seconds) { return false; } return $this->nanoseconds > $other->nanoseconds; } /** * @throws InvalidArgumentException */ private function ensureNotNegative(int $value, string $type): void { if ($value < 0) { throw new InvalidArgumentException( sprintf( 'Value for %s must not be negative.', $type, ), ); } } /** * @throws InvalidArgumentException */ private function ensureNanoSecondsInRange(int $nanoseconds): void { if ($nanoseconds > 999999999) { throw new InvalidArgumentException( 'Value for nanoseconds must not be greater than 999999999.', ); } } } Value/Telemetry/GarbageCollectorStatusProvider.php 0000644 00000000751 15107470332 0016426 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\Event\Telemetry; /** * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface GarbageCollectorStatusProvider { public function status(): GarbageCollectorStatus; } Value/Telemetry/SystemStopWatchWithOffset.php 0000644 00000001676 15107470332 0015443 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\Event\Telemetry; use function hrtime; use PHPUnit\Event\InvalidArgumentException; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class SystemStopWatchWithOffset implements StopWatch { private ?HRTime $offset; public function __construct(HRTime $offset) { $this->offset = $offset; } /** * @throws InvalidArgumentException */ public function current(): HRTime { if ($this->offset !== null) { $offset = $this->offset; $this->offset = null; return $offset; } return HRTime::fromSecondsAndNanoseconds(...hrtime()); } } Value/Telemetry/StopWatch.php 0000644 00000000705 15107470332 0012223 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\Event\Telemetry; /** * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface StopWatch { public function current(): HRTime; } Value/Telemetry/MemoryUsage.php 0000644 00000001546 15107470332 0012550 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\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class MemoryUsage { private readonly int $bytes; public static function fromBytes(int $bytes): self { return new self($bytes); } private function __construct(int $bytes) { $this->bytes = $bytes; } public function bytes(): int { return $this->bytes; } public function diff(self $other): self { return self::fromBytes($this->bytes - $other->bytes); } } Value/Telemetry/Php83GarbageCollectorStatusProvider.php 0000644 00000002054 15107470332 0017247 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\Event\Telemetry; use function gc_status; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class Php83GarbageCollectorStatusProvider implements GarbageCollectorStatusProvider { public function status(): GarbageCollectorStatus { $status = gc_status(); return new GarbageCollectorStatus( $status['runs'], $status['collected'], $status['threshold'], $status['roots'], $status['application_time'], $status['collector_time'], $status['destructor_time'], $status['free_time'], $status['running'], $status['protected'], $status['full'], $status['buffer_size'], ); } } Value/Telemetry/Snapshot.php 0000644 00000002641 15107470333 0012110 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\Event\Telemetry; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Snapshot { private readonly HRTime $time; private readonly MemoryUsage $memoryUsage; private readonly MemoryUsage $peakMemoryUsage; private readonly GarbageCollectorStatus $garbageCollectorStatus; public function __construct(HRTime $time, MemoryUsage $memoryUsage, MemoryUsage $peakMemoryUsage, GarbageCollectorStatus $garbageCollectorStatus) { $this->time = $time; $this->memoryUsage = $memoryUsage; $this->peakMemoryUsage = $peakMemoryUsage; $this->garbageCollectorStatus = $garbageCollectorStatus; } public function time(): HRTime { return $this->time; } public function memoryUsage(): MemoryUsage { return $this->memoryUsage; } public function peakMemoryUsage(): MemoryUsage { return $this->peakMemoryUsage; } public function garbageCollectorStatus(): GarbageCollectorStatus { return $this->garbageCollectorStatus; } } Value/ThrowableBuilder.php 0000644 00000002044 15107470333 0011572 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\Event\Code; use PHPUnit\Event\NoPreviousThrowableException; use PHPUnit\Framework\Exception; use PHPUnit\Util\Filter; use PHPUnit\Util\ThrowableToStringMapper; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ThrowableBuilder { /** * @throws Exception * @throws NoPreviousThrowableException */ public static function from(\Throwable $t): Throwable { $previous = $t->getPrevious(); if ($previous !== null) { $previous = self::from($previous); } return new Throwable( $t::class, $t->getMessage(), ThrowableToStringMapper::map($t), Filter::getFilteredStacktrace($t), $previous, ); } } Value/Throwable.php 0000644 00000004527 15107470333 0010273 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\Event\Code; use const PHP_EOL; use PHPUnit\Event\NoPreviousThrowableException; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Throwable { /** * @psalm-var class-string */ private readonly string $className; private readonly string $message; private readonly string $description; private readonly string $stackTrace; private readonly ?Throwable $previous; /** * @psalm-param class-string $className */ public function __construct(string $className, string $message, string $description, string $stackTrace, ?self $previous) { $this->className = $className; $this->message = $message; $this->description = $description; $this->stackTrace = $stackTrace; $this->previous = $previous; } /** * @throws NoPreviousThrowableException */ public function asString(): string { $buffer = $this->description(); if (!empty($this->stackTrace())) { $buffer .= PHP_EOL . $this->stackTrace(); } if ($this->hasPrevious()) { $buffer .= PHP_EOL . 'Caused by' . PHP_EOL . $this->previous()->asString(); } return $buffer; } /** * @psalm-return class-string */ public function className(): string { return $this->className; } public function message(): string { return $this->message; } public function description(): string { return $this->description; } public function stackTrace(): string { return $this->stackTrace; } /** * @psalm-assert-if-true !null $this->previous */ public function hasPrevious(): bool { return $this->previous !== null; } /** * @throws NoPreviousThrowableException */ public function previous(): self { if ($this->previous === null) { throw new NoPreviousThrowableException; } return $this->previous; } } Value/ComparisonFailure.php 0000644 00000001753 15107470333 0011764 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\Event\Code; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ComparisonFailure { private readonly string $expected; private readonly string $actual; private readonly string $diff; public function __construct(string $expected, string $actual, string $diff) { $this->expected = $expected; $this->actual = $actual; $this->diff = $diff; } public function expected(): string { return $this->expected; } public function actual(): string { return $this->actual; } public function diff(): string { return $this->diff; } } Value/TestSuite/TestSuiteForTestClass.php 0000644 00000002635 15107470333 0014521 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\Event\TestSuite; use PHPUnit\Event\Code\TestCollection; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteForTestClass extends TestSuite { /** * @psalm-var class-string */ private readonly string $className; private readonly string $file; private readonly int $line; /** * @psalm-param class-string $name */ public function __construct(string $name, int $size, TestCollection $tests, string $file, int $line) { parent::__construct($name, $size, $tests); $this->className = $name; $this->file = $file; $this->line = $line; } /** * @psalm-return class-string */ public function className(): string { return $this->className; } public function file(): string { return $this->file; } public function line(): int { return $this->line; } /** * @psalm-assert-if-true TestSuiteForTestClass $this */ public function isForTestClass(): bool { return true; } } Value/TestSuite/TestSuiteWithName.php 0000644 00000001152 15107470333 0013652 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\Event\TestSuite; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteWithName extends TestSuite { /** * @psalm-assert-if-true TestSuiteWithName $this */ public function isWithName(): bool { return true; } } Value/TestSuite/TestSuiteBuilder.php 0000644 00000007057 15107470334 0013537 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\Event\TestSuite; use function explode; use PHPUnit\Event\Code\Test; use PHPUnit\Event\Code\TestCollection; use PHPUnit\Event\RuntimeException; use PHPUnit\Framework\DataProviderTestSuite; use PHPUnit\Framework\TestCase; use PHPUnit\Framework\TestSuite as FrameworkTestSuite; use PHPUnit\Runner\PhptTestCase; use ReflectionClass; use ReflectionException; use ReflectionMethod; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteBuilder { /** * @throws RuntimeException */ public static function from(FrameworkTestSuite $testSuite): TestSuite { $groups = []; foreach ($testSuite->groupDetails() as $groupName => $tests) { if (!isset($groups[$groupName])) { $groups[$groupName] = []; } foreach ($tests as $test) { $groups[$groupName][] = $test::class; } } $tests = []; self::process($testSuite, $tests); if ($testSuite instanceof DataProviderTestSuite) { [$className, $methodName] = explode('::', $testSuite->name()); try { $reflector = new ReflectionMethod($className, $methodName); return new TestSuiteForTestMethodWithDataProvider( $testSuite->name(), $testSuite->count(), TestCollection::fromArray($tests), $className, $methodName, $reflector->getFileName(), $reflector->getStartLine(), ); // @codeCoverageIgnoreStart } catch (ReflectionException $e) { throw new RuntimeException( $e->getMessage(), $e->getCode(), $e, ); } // @codeCoverageIgnoreEnd } if ($testSuite->isForTestClass()) { try { $reflector = new ReflectionClass($testSuite->name()); return new TestSuiteForTestClass( $testSuite->name(), $testSuite->count(), TestCollection::fromArray($tests), $reflector->getFileName(), $reflector->getStartLine(), ); // @codeCoverageIgnoreStart } catch (ReflectionException $e) { throw new RuntimeException( $e->getMessage(), $e->getCode(), $e, ); } // @codeCoverageIgnoreEnd } return new TestSuiteWithName( $testSuite->name(), $testSuite->count(), TestCollection::fromArray($tests), ); } /** * @psalm-param list<Test> $tests */ private static function process(FrameworkTestSuite $testSuite, &$tests): void { foreach ($testSuite->tests() as $test) { if ($test instanceof FrameworkTestSuite) { self::process($test, $tests); continue; } if ($test instanceof TestCase || $test instanceof PhptTestCase) { $tests[] = $test->valueObjectForEvents(); } } } } Value/TestSuite/TestSuiteForTestMethodWithDataProvider.php 0000644 00000003564 15107470334 0020040 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\Event\TestSuite; use PHPUnit\Event\Code\TestCollection; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestSuiteForTestMethodWithDataProvider extends TestSuite { /** * @psalm-var class-string */ private readonly string $className; /** * @psalm-var non-empty-string */ private readonly string $methodName; private readonly string $file; private readonly int $line; /** * @psalm-param non-empty-string $name * @psalm-param class-string $className * @psalm-param non-empty-string $methodName */ public function __construct(string $name, int $size, TestCollection $tests, string $className, string $methodName, string $file, int $line) { parent::__construct($name, $size, $tests); $this->className = $className; $this->methodName = $methodName; $this->file = $file; $this->line = $line; } /** * @psalm-return class-string */ public function className(): string { return $this->className; } /** * @psalm-return non-empty-string */ public function methodName(): string { return $this->methodName; } public function file(): string { return $this->file; } public function line(): int { return $this->line; } /** * @psalm-assert-if-true TestSuiteForTestMethodWithDataProvider $this */ public function isForTestMethodWithDataProvider(): bool { return true; } } Value/TestSuite/TestSuite.php 0000644 00000003206 15107470334 0012220 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\Event\TestSuite; use PHPUnit\Event\Code\TestCollection; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ abstract class TestSuite { /** * @psalm-var non-empty-string */ private readonly string $name; private readonly int $count; private readonly TestCollection $tests; /** * @psalm-param non-empty-string $name */ public function __construct(string $name, int $size, TestCollection $tests) { $this->name = $name; $this->count = $size; $this->tests = $tests; } /** * @psalm-return non-empty-string */ public function name(): string { return $this->name; } public function count(): int { return $this->count; } public function tests(): TestCollection { return $this->tests; } /** * @psalm-assert-if-true TestSuiteWithName $this */ public function isWithName(): bool { return false; } /** * @psalm-assert-if-true TestSuiteForTestClass $this */ public function isForTestClass(): bool { return false; } /** * @psalm-assert-if-true TestSuiteForTestMethodWithDataProvider $this */ public function isForTestMethodWithDataProvider(): bool { return false; } } Value/Test/TestMethod.php 0000644 00000007441 15107470334 0011342 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\Event\Code; use function assert; use function is_int; use function sprintf; use PHPUnit\Event\TestData\NoDataSetFromDataProviderException; use PHPUnit\Event\TestData\TestDataCollection; use PHPUnit\Metadata\MetadataCollection; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestMethod extends Test { /** * @psalm-var class-string */ private readonly string $className; /** * @psalm-var non-empty-string */ private readonly string $methodName; /** * @psalm-var non-negative-int */ private readonly int $line; private readonly TestDox $testDox; private readonly MetadataCollection $metadata; private readonly TestDataCollection $testData; /** * @psalm-param class-string $className * @psalm-param non-empty-string $methodName * @psalm-param non-empty-string $file * @psalm-param non-negative-int $line */ public function __construct(string $className, string $methodName, string $file, int $line, TestDox $testDox, MetadataCollection $metadata, TestDataCollection $testData) { parent::__construct($file); $this->className = $className; $this->methodName = $methodName; $this->line = $line; $this->testDox = $testDox; $this->metadata = $metadata; $this->testData = $testData; } /** * @psalm-return class-string */ public function className(): string { return $this->className; } /** * @psalm-return non-empty-string */ public function methodName(): string { return $this->methodName; } /** * @psalm-return non-negative-int */ public function line(): int { return $this->line; } public function testDox(): TestDox { return $this->testDox; } public function metadata(): MetadataCollection { return $this->metadata; } public function testData(): TestDataCollection { return $this->testData; } /** * @psalm-assert-if-true TestMethod $this */ public function isTestMethod(): bool { return true; } /** * @psalm-return non-empty-string * * @throws NoDataSetFromDataProviderException */ public function id(): string { $buffer = $this->className . '::' . $this->methodName; if ($this->testData()->hasDataFromDataProvider()) { $buffer .= '#' . $this->testData->dataFromDataProvider()->dataSetName(); } return $buffer; } /** * @psalm-return non-empty-string * * @throws NoDataSetFromDataProviderException */ public function nameWithClass(): string { return $this->className . '::' . $this->name(); } /** * @psalm-return non-empty-string * * @throws NoDataSetFromDataProviderException */ public function name(): string { if (!$this->testData->hasDataFromDataProvider()) { return $this->methodName; } $dataSetName = $this->testData->dataFromDataProvider()->dataSetName(); if (is_int($dataSetName)) { $dataSetName = sprintf( ' with data set #%d', $dataSetName, ); } else { $dataSetName = sprintf( ' with data set "%s"', $dataSetName, ); } return $this->methodName . $dataSetName; } } Value/Test/TestCollection.php 0000644 00000002365 15107470334 0012215 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\Event\Code; use function count; use Countable; use IteratorAggregate; /** * @template-implements IteratorAggregate<int, Test> * * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestCollection implements Countable, IteratorAggregate { /** * @psalm-var list<Test> */ private readonly array $tests; /** * @psalm-param list<Test> $tests */ public static function fromArray(array $tests): self { return new self(...$tests); } private function __construct(Test ...$tests) { $this->tests = $tests; } /** * @psalm-return list<Test> */ public function asArray(): array { return $this->tests; } public function count(): int { return count($this->tests); } public function getIterator(): TestCollectionIterator { return new TestCollectionIterator($this); } } Value/Test/TestDox.php 0000644 00000002444 15107470334 0010652 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\Event\Code; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestDox { private readonly string $prettifiedClassName; private readonly string $prettifiedMethodName; private readonly string $prettifiedAndColorizedMethodName; public function __construct(string $prettifiedClassName, string $prettifiedMethodName, string $prettifiedAndColorizedMethodName) { $this->prettifiedClassName = $prettifiedClassName; $this->prettifiedMethodName = $prettifiedMethodName; $this->prettifiedAndColorizedMethodName = $prettifiedAndColorizedMethodName; } public function prettifiedClassName(): string { return $this->prettifiedClassName; } public function prettifiedMethodName(bool $colorize = false): string { if ($colorize) { return $this->prettifiedAndColorizedMethodName; } return $this->prettifiedMethodName; } } Value/Test/Test.php 0000644 00000002365 15107470334 0010201 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\Event\Code; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ abstract class Test { /** * @psalm-var non-empty-string */ private readonly string $file; /** * @psalm-param non-empty-string $file */ public function __construct(string $file) { $this->file = $file; } /** * @psalm-return non-empty-string */ public function file(): string { return $this->file; } /** * @psalm-assert-if-true TestMethod $this */ public function isTestMethod(): bool { return false; } /** * @psalm-assert-if-true Phpt $this */ public function isPhpt(): bool { return false; } /** * @psalm-return non-empty-string */ abstract public function id(): string; /** * @psalm-return non-empty-string */ abstract public function name(): string; } Value/Test/TestData/TestDataCollection.php 0000644 00000004771 15107470334 0014523 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\Event\TestData; use function count; use Countable; use IteratorAggregate; /** * @template-implements IteratorAggregate<int, TestData> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestDataCollection implements Countable, IteratorAggregate { /** * @psalm-var list<TestData> */ private readonly array $data; private ?DataFromDataProvider $fromDataProvider = null; /** * @psalm-param list<TestData> $data * * @throws MoreThanOneDataSetFromDataProviderException */ public static function fromArray(array $data): self { return new self(...$data); } /** * @throws MoreThanOneDataSetFromDataProviderException */ private function __construct(TestData ...$data) { $this->ensureNoMoreThanOneDataFromDataProvider($data); $this->data = $data; } /** * @psalm-return list<TestData> */ public function asArray(): array { return $this->data; } public function count(): int { return count($this->data); } /** * @psalm-assert-if-true !null $this->fromDataProvider */ public function hasDataFromDataProvider(): bool { return $this->fromDataProvider !== null; } /** * @throws NoDataSetFromDataProviderException */ public function dataFromDataProvider(): DataFromDataProvider { if (!$this->hasDataFromDataProvider()) { throw new NoDataSetFromDataProviderException; } return $this->fromDataProvider; } public function getIterator(): TestDataCollectionIterator { return new TestDataCollectionIterator($this); } /** * @psalm-param list<TestData> $data * * @throws MoreThanOneDataSetFromDataProviderException */ private function ensureNoMoreThanOneDataFromDataProvider(array $data): void { foreach ($data as $_data) { if ($_data->isFromDataProvider()) { if ($this->fromDataProvider !== null) { throw new MoreThanOneDataSetFromDataProviderException; } $this->fromDataProvider = $_data; } } } } Value/Test/TestData/DataFromDataProvider.php 0000644 00000002062 15107470335 0014770 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\Event\TestData; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class DataFromDataProvider extends TestData { private readonly int|string $dataSetName; public static function from(int|string $dataSetName, string $data): self { return new self($dataSetName, $data); } protected function __construct(int|string $dataSetName, string $data) { $this->dataSetName = $dataSetName; parent::__construct($data); } public function dataSetName(): int|string { return $this->dataSetName; } /** * @psalm-assert-if-true DataFromDataProvider $this */ public function isFromDataProvider(): bool { return true; } } Value/Test/TestData/DataFromTestDependency.php 0000644 00000001335 15107470335 0015324 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\Event\TestData; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class DataFromTestDependency extends TestData { public static function from(string $data): self { return new self($data); } /** * @psalm-assert-if-true DataFromTestDependency $this */ public function isFromTestDependency(): bool { return true; } } Value/Test/TestData/TestData.php 0000644 00000001706 15107470335 0012503 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\Event\TestData; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ abstract class TestData { private readonly string $data; protected function __construct(string $data) { $this->data = $data; } public function data(): string { return $this->data; } /** * @psalm-assert-if-true DataFromDataProvider $this */ public function isFromDataProvider(): bool { return false; } /** * @psalm-assert-if-true DataFromTestDependency $this */ public function isFromTestDependency(): bool { return false; } } Value/Test/TestData/TestDataCollectionIterator.php 0000644 00000002257 15107470335 0016233 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\Event\TestData; use function count; use Iterator; /** * @template-implements Iterator<int, TestData> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestDataCollectionIterator implements Iterator { /** * @psalm-var list<TestData> */ private readonly array $data; private int $position = 0; public function __construct(TestDataCollection $data) { $this->data = $data->asArray(); } public function rewind(): void { $this->position = 0; } public function valid(): bool { return $this->position < count($this->data); } public function key(): int { return $this->position; } public function current(): TestData { return $this->data[$this->position]; } public function next(): void { $this->position++; } } Value/Test/Phpt.php 0000644 00000001510 15107470335 0010165 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\Event\Code; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Phpt extends Test { /** * @psalm-assert-if-true Phpt $this */ public function isPhpt(): bool { return true; } /** * @psalm-return non-empty-string */ public function id(): string { return $this->file(); } /** * @psalm-return non-empty-string */ public function name(): string { return $this->file(); } } Value/Test/TestMethodBuilder.php 0000644 00000005471 15107470335 0012653 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\Event\Code; use function assert; use function debug_backtrace; use function is_numeric; use PHPUnit\Event\Facade as EventFacade; use PHPUnit\Event\TestData\DataFromDataProvider; use PHPUnit\Event\TestData\DataFromTestDependency; use PHPUnit\Event\TestData\MoreThanOneDataSetFromDataProviderException; use PHPUnit\Event\TestData\TestDataCollection; use PHPUnit\Framework\TestCase; use PHPUnit\Metadata\Parser\Registry as MetadataRegistry; use PHPUnit\Util\Exporter; use PHPUnit\Util\Reflection; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestMethodBuilder { /** * @throws MoreThanOneDataSetFromDataProviderException */ public static function fromTestCase(TestCase $testCase): TestMethod { $methodName = $testCase->name(); assert(!empty($methodName)); $location = Reflection::sourceLocationFor($testCase::class, $methodName); return new TestMethod( $testCase::class, $methodName, $location['file'], $location['line'], TestDoxBuilder::fromTestCase($testCase), MetadataRegistry::parser()->forClassAndMethod($testCase::class, $methodName), self::dataFor($testCase), ); } /** * @throws NoTestCaseObjectOnCallStackException */ public static function fromCallStack(): TestMethod { foreach (debug_backtrace() as $frame) { if (isset($frame['object']) && $frame['object'] instanceof TestCase) { return $frame['object']->valueObjectForEvents(); } } throw new NoTestCaseObjectOnCallStackException; } /** * @throws MoreThanOneDataSetFromDataProviderException */ private static function dataFor(TestCase $testCase): TestDataCollection { $testData = []; if ($testCase->usesDataProvider()) { $dataSetName = $testCase->dataName(); if (is_numeric($dataSetName)) { $dataSetName = (int) $dataSetName; } $testData[] = DataFromDataProvider::from( $dataSetName, Exporter::export($testCase->providedData(), EventFacade::emitter()->exportsObjects()), ); } if ($testCase->hasDependencyInput()) { $testData[] = DataFromTestDependency::from( Exporter::export($testCase->dependencyInput(), EventFacade::emitter()->exportsObjects()), ); } return TestDataCollection::fromArray($testData); } } Value/Test/TestDoxBuilder.php 0000644 00000002704 15107470335 0012161 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\Event\Code; use PHPUnit\Event\TestData\MoreThanOneDataSetFromDataProviderException; use PHPUnit\Framework\TestCase; use PHPUnit\Logging\TestDox\NamePrettifier; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestDoxBuilder { /** * @throws MoreThanOneDataSetFromDataProviderException */ public static function fromTestCase(TestCase $testCase): TestDox { $prettifier = new NamePrettifier; return new TestDox( $prettifier->prettifyTestClassName($testCase::class), $prettifier->prettifyTestCase($testCase, false), $prettifier->prettifyTestCase($testCase, true), ); } /** * @psalm-param class-string $className * @psalm-param non-empty-string $methodName */ public static function fromClassNameAndMethodName(string $className, string $methodName): TestDox { $prettifier = new NamePrettifier; return new TestDox( $prettifier->prettifyTestClassName($className), $prettifier->prettifyTestMethodName($methodName), $prettifier->prettifyTestMethodName($methodName), ); } } Value/Test/TestCollectionIterator.php 0000644 00000002235 15107470335 0013724 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\Event\Code; use function count; use Iterator; /** * @template-implements Iterator<int, Test> * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class TestCollectionIterator implements Iterator { /** * @psalm-var list<Test> */ private readonly array $tests; private int $position = 0; public function __construct(TestCollection $tests) { $this->tests = $tests->asArray(); } public function rewind(): void { $this->position = 0; } public function valid(): bool { return $this->position < count($this->tests); } public function key(): int { return $this->position; } public function current(): Test { return $this->tests[$this->position]; } public function next(): void { $this->position++; } } Value/Runtime/PHP.php 0000644 00000004537 15107470335 0010421 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\Event\Runtime; use const PHP_EXTRA_VERSION; use const PHP_MAJOR_VERSION; use const PHP_MINOR_VERSION; use const PHP_RELEASE_VERSION; use const PHP_SAPI; use const PHP_VERSION; use const PHP_VERSION_ID; use function array_merge; use function get_loaded_extensions; use function sort; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PHP { private readonly string $version; private readonly int $versionId; private readonly int $majorVersion; private readonly int $minorVersion; private readonly int $releaseVersion; private readonly string $extraVersion; private readonly string $sapi; /** * @psalm-var list<string> */ private readonly array $extensions; public function __construct() { $this->version = PHP_VERSION; $this->versionId = PHP_VERSION_ID; $this->majorVersion = PHP_MAJOR_VERSION; $this->minorVersion = PHP_MINOR_VERSION; $this->releaseVersion = PHP_RELEASE_VERSION; $this->extraVersion = PHP_EXTRA_VERSION; $this->sapi = PHP_SAPI; $extensions = array_merge( get_loaded_extensions(true), get_loaded_extensions(), ); sort($extensions); $this->extensions = $extensions; } public function version(): string { return $this->version; } public function sapi(): string { return $this->sapi; } public function majorVersion(): int { return $this->majorVersion; } public function minorVersion(): int { return $this->minorVersion; } public function releaseVersion(): int { return $this->releaseVersion; } public function extraVersion(): string { return $this->extraVersion; } public function versionId(): int { return $this->versionId; } /** * @psalm-return list<string> */ public function extensions(): array { return $this->extensions; } } Value/Runtime/OperatingSystem.php 0000644 00000001671 15107470335 0013123 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\Event\Runtime; use const PHP_OS; use const PHP_OS_FAMILY; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class OperatingSystem { private readonly string $operatingSystem; private readonly string $operatingSystemFamily; public function __construct() { $this->operatingSystem = PHP_OS; $this->operatingSystemFamily = PHP_OS_FAMILY; } public function operatingSystem(): string { return $this->operatingSystem; } public function operatingSystemFamily(): string { return $this->operatingSystemFamily; } } Value/Runtime/Runtime.php 0000644 00000002527 15107470335 0011412 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\Event\Runtime; use function sprintf; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class Runtime { private readonly OperatingSystem $operatingSystem; private readonly PHP $php; private readonly PHPUnit $phpunit; public function __construct() { $this->operatingSystem = new OperatingSystem; $this->php = new PHP; $this->phpunit = new PHPUnit; } public function asString(): string { $php = $this->php(); return sprintf( 'PHPUnit %s using PHP %s (%s) on %s', $this->phpunit()->versionId(), $php->version(), $php->sapi(), $this->operatingSystem()->operatingSystem(), ); } public function operatingSystem(): OperatingSystem { return $this->operatingSystem; } public function php(): PHP { return $this->php; } public function phpunit(): PHPUnit { return $this->phpunit; } } Value/Runtime/PHPUnit.php 0000644 00000001563 15107470335 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\Event\Runtime; use PHPUnit\Runner\Version; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class PHPUnit { private readonly string $versionId; private readonly string $releaseSeries; public function __construct() { $this->versionId = Version::id(); $this->releaseSeries = Version::series(); } public function versionId(): string { return $this->versionId; } public function releaseSeries(): string { return $this->releaseSeries; } } Value/ComparisonFailureBuilder.php 0000644 00000003360 15107470336 0013272 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\Event\Code; use function is_bool; use function is_scalar; use function print_r; use PHPUnit\Framework\ExpectationFailedException; use Throwable; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class ComparisonFailureBuilder { public static function from(Throwable $t): ?ComparisonFailure { if (!$t instanceof ExpectationFailedException) { return null; } if (!$t->getComparisonFailure()) { return null; } $expectedAsString = $t->getComparisonFailure()->getExpectedAsString(); if (empty($expectedAsString)) { $expectedAsString = self::mapScalarValueToString($t->getComparisonFailure()->getExpected()); } $actualAsString = $t->getComparisonFailure()->getActualAsString(); if (empty($actualAsString)) { $actualAsString = self::mapScalarValueToString($t->getComparisonFailure()->getActual()); } return new ComparisonFailure( $expectedAsString, $actualAsString, $t->getComparisonFailure()->getDiff(), ); } private static function mapScalarValueToString(mixed $value): string { if ($value === null) { return 'null'; } if (is_bool($value)) { return $value ? 'true' : 'false'; } if (is_scalar($value)) { return print_r($value, true); } return ''; } } Value/ClassMethod.php 0000644 00000002234 15107470336 0010546 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\Event\Code; /** * @psalm-immutable * * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ final class ClassMethod { /** * @psalm-var class-string */ private readonly string $className; /** * @psalm-var non-empty-string */ private readonly string $methodName; /** * @psalm-param class-string $className * @psalm-param non-empty-string $methodName */ public function __construct(string $className, string $methodName) { $this->className = $className; $this->methodName = $methodName; } /** * @psalm-return class-string */ public function className(): string { return $this->className; } /** * @psalm-return non-empty-string */ public function methodName(): string { return $this->methodName; } } TypeMap.php 0000644 00000012737 15107470336 0006654 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\Event; use function array_key_exists; use function class_exists; use function class_implements; use function in_array; use function interface_exists; use function sprintf; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TypeMap { /** * @psalm-var array<class-string, class-string> */ private array $mapping = []; /** * @psalm-param class-string $subscriberInterface * @psalm-param class-string $eventClass * * @throws EventAlreadyAssignedException * @throws InvalidEventException * @throws InvalidSubscriberException * @throws SubscriberTypeAlreadyRegisteredException * @throws UnknownEventException * @throws UnknownSubscriberException */ public function addMapping(string $subscriberInterface, string $eventClass): void { $this->ensureSubscriberInterfaceExists($subscriberInterface); $this->ensureSubscriberInterfaceExtendsInterface($subscriberInterface); $this->ensureEventClassExists($eventClass); $this->ensureEventClassImplementsEventInterface($eventClass); $this->ensureSubscriberWasNotAlreadyRegistered($subscriberInterface); $this->ensureEventWasNotAlreadyAssigned($eventClass); $this->mapping[$subscriberInterface] = $eventClass; } public function isKnownSubscriberType(Subscriber $subscriber): bool { foreach (class_implements($subscriber) as $interface) { if (array_key_exists($interface, $this->mapping)) { return true; } } return false; } public function isKnownEventType(Event $event): bool { return in_array($event::class, $this->mapping, true); } /** * @psalm-return class-string * * @throws MapError */ public function map(Subscriber $subscriber): string { foreach (class_implements($subscriber) as $interface) { if (array_key_exists($interface, $this->mapping)) { return $this->mapping[$interface]; } } throw new MapError( sprintf( 'Subscriber "%s" does not implement a known interface', $subscriber::class, ), ); } /** * @psalm-param class-string $subscriberInterface * * @throws UnknownSubscriberException */ private function ensureSubscriberInterfaceExists(string $subscriberInterface): void { if (!interface_exists($subscriberInterface)) { throw new UnknownSubscriberException( sprintf( 'Subscriber "%s" does not exist or is not an interface', $subscriberInterface, ), ); } } /** * @psalm-param class-string $eventClass * * @throws UnknownEventException */ private function ensureEventClassExists(string $eventClass): void { if (!class_exists($eventClass)) { throw new UnknownEventException( sprintf( 'Event class "%s" does not exist', $eventClass, ), ); } } /** * @psalm-param class-string $subscriberInterface * * @throws InvalidSubscriberException */ private function ensureSubscriberInterfaceExtendsInterface(string $subscriberInterface): void { if (!in_array(Subscriber::class, class_implements($subscriberInterface), true)) { throw new InvalidSubscriberException( sprintf( 'Subscriber "%s" does not extend Subscriber interface', $subscriberInterface, ), ); } } /** * @psalm-param class-string $eventClass * * @throws InvalidEventException */ private function ensureEventClassImplementsEventInterface(string $eventClass): void { if (!in_array(Event::class, class_implements($eventClass), true)) { throw new InvalidEventException( sprintf( 'Event "%s" does not implement Event interface', $eventClass, ), ); } } /** * @psalm-param class-string $subscriberInterface * * @throws SubscriberTypeAlreadyRegisteredException */ private function ensureSubscriberWasNotAlreadyRegistered(string $subscriberInterface): void { if (array_key_exists($subscriberInterface, $this->mapping)) { throw new SubscriberTypeAlreadyRegisteredException( sprintf( 'Subscriber type "%s" already registered', $subscriberInterface, ), ); } } /** * @psalm-param class-string $eventClass * * @throws EventAlreadyAssignedException */ private function ensureEventWasNotAlreadyAssigned(string $eventClass): void { if (in_array($eventClass, $this->mapping, true)) { throw new EventAlreadyAssignedException( sprintf( 'Event "%s" already assigned', $eventClass, ), ); } } } Emitter/DispatchingEmitter.php 0000644 00000077700 15107470336 0012476 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\Event; use PHPUnit\Event\Code\ClassMethod; use PHPUnit\Event\Code\ComparisonFailure; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\Test\DataProviderMethodCalled; use PHPUnit\Event\Test\DataProviderMethodFinished; use PHPUnit\Event\TestSuite\Filtered as TestSuiteFiltered; use PHPUnit\Event\TestSuite\Finished as TestSuiteFinished; use PHPUnit\Event\TestSuite\Loaded as TestSuiteLoaded; use PHPUnit\Event\TestSuite\Skipped as TestSuiteSkipped; use PHPUnit\Event\TestSuite\Sorted as TestSuiteSorted; use PHPUnit\Event\TestSuite\Started as TestSuiteStarted; use PHPUnit\Event\TestSuite\TestSuite; use PHPUnit\Framework\Constraint; use PHPUnit\TextUI\Configuration\Configuration; use PHPUnit\Util\Exporter; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DispatchingEmitter implements Emitter { private readonly Dispatcher $dispatcher; private readonly Telemetry\System $system; private readonly Telemetry\Snapshot $startSnapshot; private Telemetry\Snapshot $previousSnapshot; private bool $exportObjects = false; public function __construct(Dispatcher $dispatcher, Telemetry\System $system) { $this->dispatcher = $dispatcher; $this->system = $system; $this->startSnapshot = $system->snapshot(); $this->previousSnapshot = $system->snapshot(); } public function exportObjects(): void { $this->exportObjects = true; } public function exportsObjects(): bool { return $this->exportObjects; } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function applicationStarted(): void { $this->dispatcher->dispatch( new Application\Started( $this->telemetryInfo(), new Runtime\Runtime, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerStarted(): void { $this->dispatcher->dispatch( new TestRunner\Started( $this->telemetryInfo(), ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerConfigured(Configuration $configuration): void { $this->dispatcher->dispatch( new TestRunner\Configured( $this->telemetryInfo(), $configuration, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerBootstrapFinished(string $filename): void { $this->dispatcher->dispatch( new TestRunner\BootstrapFinished( $this->telemetryInfo(), $filename, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerLoadedExtensionFromPhar(string $filename, string $name, string $version): void { $this->dispatcher->dispatch( new TestRunner\ExtensionLoadedFromPhar( $this->telemetryInfo(), $filename, $name, $version, ), ); } /** * @psalm-param class-string $className * @psalm-param array<string, string> $parameters * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerBootstrappedExtension(string $className, array $parameters): void { $this->dispatcher->dispatch( new TestRunner\ExtensionBootstrapped( $this->telemetryInfo(), $className, $parameters, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function dataProviderMethodCalled(ClassMethod $testMethod, ClassMethod $dataProviderMethod): void { $this->dispatcher->dispatch( new DataProviderMethodCalled( $this->telemetryInfo(), $testMethod, $dataProviderMethod, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function dataProviderMethodFinished(ClassMethod $testMethod, ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new DataProviderMethodFinished( $this->telemetryInfo(), $testMethod, ...$calledMethods, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testSuiteLoaded(TestSuite $testSuite): void { $this->dispatcher->dispatch( new TestSuiteLoaded( $this->telemetryInfo(), $testSuite, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testSuiteFiltered(TestSuite $testSuite): void { $this->dispatcher->dispatch( new TestSuiteFiltered( $this->telemetryInfo(), $testSuite, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testSuiteSorted(int $executionOrder, int $executionOrderDefects, bool $resolveDependencies): void { $this->dispatcher->dispatch( new TestSuiteSorted( $this->telemetryInfo(), $executionOrder, $executionOrderDefects, $resolveDependencies, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerEventFacadeSealed(): void { $this->dispatcher->dispatch( new TestRunner\EventFacadeSealed( $this->telemetryInfo(), ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerExecutionStarted(TestSuite $testSuite): void { $this->dispatcher->dispatch( new TestRunner\ExecutionStarted( $this->telemetryInfo(), $testSuite, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerDisabledGarbageCollection(): void { $this->dispatcher->dispatch( new TestRunner\GarbageCollectionDisabled($this->telemetryInfo()), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerTriggeredGarbageCollection(): void { $this->dispatcher->dispatch( new TestRunner\GarbageCollectionTriggered($this->telemetryInfo()), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testSuiteSkipped(TestSuite $testSuite, string $message): void { $this->dispatcher->dispatch( new TestSuiteSkipped( $this->telemetryInfo(), $testSuite, $message, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testSuiteStarted(TestSuite $testSuite): void { $this->dispatcher->dispatch( new TestSuiteStarted( $this->telemetryInfo(), $testSuite, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testPreparationStarted(Code\Test $test): void { $this->dispatcher->dispatch( new Test\PreparationStarted( $this->telemetryInfo(), $test, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testPreparationFailed(Code\Test $test): void { $this->dispatcher->dispatch( new Test\PreparationFailed( $this->telemetryInfo(), $test, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testBeforeFirstTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\BeforeFirstTestMethodCalled( $this->telemetryInfo(), $testClassName, $calledMethod, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testBeforeFirstTestMethodErrored(string $testClassName, Code\ClassMethod $calledMethod, Throwable $throwable): void { $this->dispatcher->dispatch( new Test\BeforeFirstTestMethodErrored( $this->telemetryInfo(), $testClassName, $calledMethod, $throwable, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testBeforeFirstTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\BeforeFirstTestMethodFinished( $this->telemetryInfo(), $testClassName, ...$calledMethods, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testBeforeTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\BeforeTestMethodCalled( $this->telemetryInfo(), $testClassName, $calledMethod, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testBeforeTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\BeforeTestMethodFinished( $this->telemetryInfo(), $testClassName, ...$calledMethods, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testPreConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\PreConditionCalled( $this->telemetryInfo(), $testClassName, $calledMethod, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testPreConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\PreConditionFinished( $this->telemetryInfo(), $testClassName, ...$calledMethods, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testPrepared(Code\Test $test): void { $this->dispatcher->dispatch( new Test\Prepared( $this->telemetryInfo(), $test, ), ); } /** * @psalm-param class-string $className * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRegisteredComparator(string $className): void { $this->dispatcher->dispatch( new Test\ComparatorRegistered( $this->telemetryInfo(), $className, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testAssertionSucceeded(mixed $value, Constraint\Constraint $constraint, string $message): void { $this->dispatcher->dispatch( new Test\AssertionSucceeded( $this->telemetryInfo(), Exporter::export($value, $this->exportObjects), $constraint->toString($this->exportObjects), $constraint->count(), $message, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testAssertionFailed(mixed $value, Constraint\Constraint $constraint, string $message): void { $this->dispatcher->dispatch( new Test\AssertionFailed( $this->telemetryInfo(), Exporter::export($value, $this->exportObjects), $constraint->toString($this->exportObjects), $constraint->count(), $message, ), ); } /** * @psalm-param class-string $className * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testCreatedMockObject(string $className): void { $this->dispatcher->dispatch( new Test\MockObjectCreated( $this->telemetryInfo(), $className, ), ); } /** * @psalm-param list<class-string> $interfaces * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testCreatedMockObjectForIntersectionOfInterfaces(array $interfaces): void { $this->dispatcher->dispatch( new Test\MockObjectForIntersectionOfInterfacesCreated( $this->telemetryInfo(), $interfaces, ), ); } /** * @psalm-param trait-string $traitName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testCreatedMockObjectForTrait(string $traitName): void { $this->dispatcher->dispatch( new Test\MockObjectForTraitCreated( $this->telemetryInfo(), $traitName, ), ); } /** * @psalm-param class-string $className * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testCreatedMockObjectForAbstractClass(string $className): void { $this->dispatcher->dispatch( new Test\MockObjectForAbstractClassCreated( $this->telemetryInfo(), $className, ), ); } /** * @psalm-param class-string $originalClassName * @psalm-param class-string $mockClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testCreatedMockObjectFromWsdl(string $wsdlFile, string $originalClassName, string $mockClassName, array $methods, bool $callOriginalConstructor, array $options): void { $this->dispatcher->dispatch( new Test\MockObjectFromWsdlCreated( $this->telemetryInfo(), $wsdlFile, $originalClassName, $mockClassName, $methods, $callOriginalConstructor, $options, ), ); } /** * @psalm-param class-string $className * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testCreatedPartialMockObject(string $className, string ...$methodNames): void { $this->dispatcher->dispatch( new Test\PartialMockObjectCreated( $this->telemetryInfo(), $className, ...$methodNames, ), ); } /** * @psalm-param class-string $className * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testCreatedTestProxy(string $className, array $constructorArguments): void { $this->dispatcher->dispatch( new Test\TestProxyCreated( $this->telemetryInfo(), $className, Exporter::export($constructorArguments, $this->exportObjects), ), ); } /** * @psalm-param class-string $className * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testCreatedStub(string $className): void { $this->dispatcher->dispatch( new Test\TestStubCreated( $this->telemetryInfo(), $className, ), ); } /** * @psalm-param list<class-string> $interfaces * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testCreatedStubForIntersectionOfInterfaces(array $interfaces): void { $this->dispatcher->dispatch( new Test\TestStubForIntersectionOfInterfacesCreated( $this->telemetryInfo(), $interfaces, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testErrored(Code\Test $test, Throwable $throwable): void { $this->dispatcher->dispatch( new Test\Errored( $this->telemetryInfo(), $test, $throwable, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testFailed(Code\Test $test, Throwable $throwable, ?ComparisonFailure $comparisonFailure): void { $this->dispatcher->dispatch( new Test\Failed( $this->telemetryInfo(), $test, $throwable, $comparisonFailure, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testPassed(Code\Test $test): void { $this->dispatcher->dispatch( new Test\Passed( $this->telemetryInfo(), $test, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testConsideredRisky(Code\Test $test, string $message): void { $this->dispatcher->dispatch( new Test\ConsideredRisky( $this->telemetryInfo(), $test, $message, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testMarkedAsIncomplete(Code\Test $test, Throwable $throwable): void { $this->dispatcher->dispatch( new Test\MarkedIncomplete( $this->telemetryInfo(), $test, $throwable, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testSkipped(Code\Test $test, string $message): void { $this->dispatcher->dispatch( new Test\Skipped( $this->telemetryInfo(), $test, $message, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testTriggeredPhpunitDeprecation(Code\Test $test, string $message): void { $this->dispatcher->dispatch( new Test\PhpunitDeprecationTriggered( $this->telemetryInfo(), $test, $message, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testTriggeredPhpDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void { $this->dispatcher->dispatch( new Test\PhpDeprecationTriggered( $this->telemetryInfo(), $test, $message, $file, $line, $suppressed, $ignoredByBaseline, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testTriggeredDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void { $this->dispatcher->dispatch( new Test\DeprecationTriggered( $this->telemetryInfo(), $test, $message, $file, $line, $suppressed, $ignoredByBaseline, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testTriggeredError(Code\Test $test, string $message, string $file, int $line, bool $suppressed): void { $this->dispatcher->dispatch( new Test\ErrorTriggered( $this->telemetryInfo(), $test, $message, $file, $line, $suppressed, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testTriggeredNotice(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void { $this->dispatcher->dispatch( new Test\NoticeTriggered( $this->telemetryInfo(), $test, $message, $file, $line, $suppressed, $ignoredByBaseline, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testTriggeredPhpNotice(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void { $this->dispatcher->dispatch( new Test\PhpNoticeTriggered( $this->telemetryInfo(), $test, $message, $file, $line, $suppressed, $ignoredByBaseline, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testTriggeredWarning(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void { $this->dispatcher->dispatch( new Test\WarningTriggered( $this->telemetryInfo(), $test, $message, $file, $line, $suppressed, $ignoredByBaseline, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testTriggeredPhpWarning(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void { $this->dispatcher->dispatch( new Test\PhpWarningTriggered( $this->telemetryInfo(), $test, $message, $file, $line, $suppressed, $ignoredByBaseline, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testTriggeredPhpunitError(Code\Test $test, string $message): void { $this->dispatcher->dispatch( new Test\PhpunitErrorTriggered( $this->telemetryInfo(), $test, $message, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testTriggeredPhpunitWarning(Code\Test $test, string $message): void { $this->dispatcher->dispatch( new Test\PhpunitWarningTriggered( $this->telemetryInfo(), $test, $message, ), ); } /** * @psalm-param non-empty-string $output * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testPrintedUnexpectedOutput(string $output): void { $this->dispatcher->dispatch( new Test\PrintedUnexpectedOutput( $this->telemetryInfo(), $output, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testFinished(Code\Test $test, int $numberOfAssertionsPerformed): void { $this->dispatcher->dispatch( new Test\Finished( $this->telemetryInfo(), $test, $numberOfAssertionsPerformed, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testPostConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\PostConditionCalled( $this->telemetryInfo(), $testClassName, $calledMethod, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testPostConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\PostConditionFinished( $this->telemetryInfo(), $testClassName, ...$calledMethods, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testAfterTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\AfterTestMethodCalled( $this->telemetryInfo(), $testClassName, $calledMethod, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testAfterTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\AfterTestMethodFinished( $this->telemetryInfo(), $testClassName, ...$calledMethods, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testAfterLastTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void { $this->dispatcher->dispatch( new Test\AfterLastTestMethodCalled( $this->telemetryInfo(), $testClassName, $calledMethod, ), ); } /** * @psalm-param class-string $testClassName * * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testAfterLastTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void { $this->dispatcher->dispatch( new Test\AfterLastTestMethodFinished( $this->telemetryInfo(), $testClassName, ...$calledMethods, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testSuiteFinished(TestSuite $testSuite): void { $this->dispatcher->dispatch( new TestSuiteFinished( $this->telemetryInfo(), $testSuite, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerTriggeredDeprecation(string $message): void { $this->dispatcher->dispatch( new TestRunner\DeprecationTriggered( $this->telemetryInfo(), $message, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerTriggeredWarning(string $message): void { $this->dispatcher->dispatch( new TestRunner\WarningTriggered( $this->telemetryInfo(), $message, ), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerEnabledGarbageCollection(): void { $this->dispatcher->dispatch( new TestRunner\GarbageCollectionEnabled($this->telemetryInfo()), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerExecutionAborted(): void { $this->dispatcher->dispatch( new TestRunner\ExecutionAborted($this->telemetryInfo()), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerExecutionFinished(): void { $this->dispatcher->dispatch( new TestRunner\ExecutionFinished($this->telemetryInfo()), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function testRunnerFinished(): void { $this->dispatcher->dispatch( new TestRunner\Finished($this->telemetryInfo()), ); } /** * @throws InvalidArgumentException * @throws UnknownEventTypeException */ public function applicationFinished(int $shellExitCode): void { $this->dispatcher->dispatch( new Application\Finished( $this->telemetryInfo(), $shellExitCode, ), ); } /** * @throws InvalidArgumentException */ private function telemetryInfo(): Telemetry\Info { $current = $this->system->snapshot(); $info = new Telemetry\Info( $current, $current->time()->duration($this->startSnapshot->time()), $current->memoryUsage()->diff($this->startSnapshot->memoryUsage()), $current->time()->duration($this->previousSnapshot->time()), $current->memoryUsage()->diff($this->previousSnapshot->memoryUsage()), ); $this->previousSnapshot = $current; return $info; } } Emitter/Emitter.php 0000644 00000021613 15107470336 0010310 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\Event; use PHPUnit\Event\Code\ClassMethod; use PHPUnit\Event\Code\ComparisonFailure; use PHPUnit\Event\Code\Throwable; use PHPUnit\Event\TestSuite\TestSuite; use PHPUnit\Framework\Constraint; use PHPUnit\TextUI\Configuration\Configuration; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ interface Emitter { public function exportObjects(): void; public function exportsObjects(): bool; public function applicationStarted(): void; public function testRunnerStarted(): void; public function testRunnerConfigured(Configuration $configuration): void; public function testRunnerBootstrapFinished(string $filename): void; public function testRunnerLoadedExtensionFromPhar(string $filename, string $name, string $version): void; /** * @psalm-param class-string $className * @psalm-param array<string, string> $parameters */ public function testRunnerBootstrappedExtension(string $className, array $parameters): void; public function dataProviderMethodCalled(ClassMethod $testMethod, ClassMethod $dataProviderMethod): void; public function dataProviderMethodFinished(ClassMethod $testMethod, ClassMethod ...$calledMethods): void; public function testSuiteLoaded(TestSuite $testSuite): void; public function testSuiteFiltered(TestSuite $testSuite): void; public function testSuiteSorted(int $executionOrder, int $executionOrderDefects, bool $resolveDependencies): void; public function testRunnerEventFacadeSealed(): void; public function testRunnerExecutionStarted(TestSuite $testSuite): void; public function testRunnerDisabledGarbageCollection(): void; public function testRunnerTriggeredGarbageCollection(): void; public function testSuiteSkipped(TestSuite $testSuite, string $message): void; public function testSuiteStarted(TestSuite $testSuite): void; public function testPreparationStarted(Code\Test $test): void; public function testPreparationFailed(Code\Test $test): void; /** * @psalm-param class-string $testClassName */ public function testBeforeFirstTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void; /** * @psalm-param class-string $testClassName */ public function testBeforeFirstTestMethodErrored(string $testClassName, Code\ClassMethod $calledMethod, Throwable $throwable): void; /** * @psalm-param class-string $testClassName */ public function testBeforeFirstTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; /** * @psalm-param class-string $testClassName */ public function testBeforeTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void; /** * @psalm-param class-string $testClassName */ public function testBeforeTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; /** * @psalm-param class-string $testClassName */ public function testPreConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void; /** * @psalm-param class-string $testClassName */ public function testPreConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; public function testPrepared(Code\Test $test): void; /** * @psalm-param class-string $className */ public function testRegisteredComparator(string $className): void; public function testAssertionSucceeded(mixed $value, Constraint\Constraint $constraint, string $message): void; public function testAssertionFailed(mixed $value, Constraint\Constraint $constraint, string $message): void; /** * @psalm-param class-string $className */ public function testCreatedMockObject(string $className): void; /** * @psalm-param list<class-string> $interfaces */ public function testCreatedMockObjectForIntersectionOfInterfaces(array $interfaces): void; /** * @psalm-param trait-string $traitName */ public function testCreatedMockObjectForTrait(string $traitName): void; /** * @psalm-param class-string $className */ public function testCreatedMockObjectForAbstractClass(string $className): void; /** * @psalm-param class-string $originalClassName * @psalm-param class-string $mockClassName */ public function testCreatedMockObjectFromWsdl(string $wsdlFile, string $originalClassName, string $mockClassName, array $methods, bool $callOriginalConstructor, array $options): void; /** * @psalm-param class-string $className */ public function testCreatedPartialMockObject(string $className, string ...$methodNames): void; /** * @psalm-param class-string $className */ public function testCreatedTestProxy(string $className, array $constructorArguments): void; /** * @psalm-param class-string $className */ public function testCreatedStub(string $className): void; /** * @psalm-param list<class-string> $interfaces */ public function testCreatedStubForIntersectionOfInterfaces(array $interfaces): void; public function testErrored(Code\Test $test, Throwable $throwable): void; public function testFailed(Code\Test $test, Throwable $throwable, ?ComparisonFailure $comparisonFailure): void; public function testPassed(Code\Test $test): void; public function testConsideredRisky(Code\Test $test, string $message): void; public function testMarkedAsIncomplete(Code\Test $test, Throwable $throwable): void; public function testSkipped(Code\Test $test, string $message): void; public function testTriggeredPhpunitDeprecation(Code\Test $test, string $message): void; public function testTriggeredPhpDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void; public function testTriggeredDeprecation(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void; public function testTriggeredError(Code\Test $test, string $message, string $file, int $line, bool $suppressed): void; public function testTriggeredNotice(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void; public function testTriggeredPhpNotice(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void; public function testTriggeredWarning(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void; public function testTriggeredPhpWarning(Code\Test $test, string $message, string $file, int $line, bool $suppressed, bool $ignoredByBaseline): void; public function testTriggeredPhpunitError(Code\Test $test, string $message): void; public function testTriggeredPhpunitWarning(Code\Test $test, string $message): void; /** * @psalm-param non-empty-string $output */ public function testPrintedUnexpectedOutput(string $output): void; public function testFinished(Code\Test $test, int $numberOfAssertionsPerformed): void; /** * @psalm-param class-string $testClassName */ public function testPostConditionCalled(string $testClassName, Code\ClassMethod $calledMethod): void; /** * @psalm-param class-string $testClassName */ public function testPostConditionFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; /** * @psalm-param class-string $testClassName */ public function testAfterTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void; /** * @psalm-param class-string $testClassName */ public function testAfterTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; /** * @psalm-param class-string $testClassName */ public function testAfterLastTestMethodCalled(string $testClassName, Code\ClassMethod $calledMethod): void; /** * @psalm-param class-string $testClassName */ public function testAfterLastTestMethodFinished(string $testClassName, Code\ClassMethod ...$calledMethods): void; public function testSuiteFinished(TestSuite $testSuite): void; public function testRunnerTriggeredDeprecation(string $message): void; public function testRunnerTriggeredWarning(string $message): void; public function testRunnerEnabledGarbageCollection(): void; public function testRunnerExecutionAborted(): void; public function testRunnerExecutionFinished(): void; public function testRunnerFinished(): void; public function applicationFinished(int $shellExitCode): void; } Tracer.php 0000644 00000000755 15107470337 0006513 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\Event\Tracer; use PHPUnit\Event\Event; /** * @no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit */ interface Tracer { public function trace(Event $event): void; } Dispatcher/DeferringDispatcher.php 0000644 00000002664 15107470337 0013276 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\Event; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DeferringDispatcher implements SubscribableDispatcher { private readonly SubscribableDispatcher $dispatcher; private EventCollection $events; private bool $recording = true; public function __construct(SubscribableDispatcher $dispatcher) { $this->dispatcher = $dispatcher; $this->events = new EventCollection; } public function registerTracer(Tracer\Tracer $tracer): void { $this->dispatcher->registerTracer($tracer); } public function registerSubscriber(Subscriber $subscriber): void { $this->dispatcher->registerSubscriber($subscriber); } public function dispatch(Event $event): void { if ($this->recording) { $this->events->add($event); return; } $this->dispatcher->dispatch($event); } public function flush(): void { $this->recording = false; foreach ($this->events as $event) { $this->dispatcher->dispatch($event); } $this->events = new EventCollection; } } Dispatcher/Dispatcher.php 0000644 00000001000 15107470337 0011427 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\Event; /** * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface Dispatcher { /** * @throws UnknownEventTypeException */ public function dispatch(Event $event): void; } Dispatcher/DirectDispatcher.php 0000644 00000006572 15107470337 0012605 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\Event; use function array_key_exists; use function dirname; use function sprintf; use function str_starts_with; use Throwable; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class DirectDispatcher implements SubscribableDispatcher { private readonly TypeMap $typeMap; /** * @psalm-var array<class-string, list<Subscriber>> */ private array $subscribers = []; /** * @psalm-var list<Tracer\Tracer> */ private array $tracers = []; public function __construct(TypeMap $map) { $this->typeMap = $map; } public function registerTracer(Tracer\Tracer $tracer): void { $this->tracers[] = $tracer; } /** * @throws MapError * @throws UnknownSubscriberTypeException */ public function registerSubscriber(Subscriber $subscriber): void { if (!$this->typeMap->isKnownSubscriberType($subscriber)) { throw new UnknownSubscriberTypeException( sprintf( 'Subscriber "%s" does not implement any known interface - did you forget to register it?', $subscriber::class, ), ); } $eventClassName = $this->typeMap->map($subscriber); if (!array_key_exists($eventClassName, $this->subscribers)) { $this->subscribers[$eventClassName] = []; } $this->subscribers[$eventClassName][] = $subscriber; } /** * @throws Throwable * @throws UnknownEventTypeException */ public function dispatch(Event $event): void { $eventClassName = $event::class; if (!$this->typeMap->isKnownEventType($event)) { throw new UnknownEventTypeException( sprintf( 'Unknown event type "%s"', $eventClassName, ), ); } foreach ($this->tracers as $tracer) { try { $tracer->trace($event); } catch (Throwable $t) { $this->handleThrowable($t); } } if (!array_key_exists($eventClassName, $this->subscribers)) { return; } foreach ($this->subscribers[$eventClassName] as $subscriber) { try { $subscriber->notify($event); } catch (Throwable $t) { $this->handleThrowable($t); } } } /** * @throws Throwable */ public function handleThrowable(Throwable $t): void { if ($this->isThrowableFromThirdPartySubscriber($t)) { Facade::emitter()->testRunnerTriggeredWarning( sprintf( 'Exception in third-party event subscriber: %s%s%s', $t->getMessage(), PHP_EOL, $t->getTraceAsString(), ), ); return; } throw $t; } private function isThrowableFromThirdPartySubscriber(Throwable $t): bool { return !str_starts_with($t->getFile(), dirname(__DIR__, 2)); } } Dispatcher/CollectingDispatcher.php 0000644 00000001470 15107470337 0013446 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\Event; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class CollectingDispatcher implements Dispatcher { private EventCollection $events; public function __construct() { $this->events = new EventCollection; } public function dispatch(Event $event): void { $this->events->add($event); } public function flush(): EventCollection { $events = $this->events; $this->events = new EventCollection; return $events; } } Dispatcher/SubscribableDispatcher.php 0000644 00000001172 15107470337 0013762 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\Event; /** * @internal This interface is not covered by the backward compatibility promise for PHPUnit */ interface SubscribableDispatcher extends Dispatcher { /** * @throws UnknownSubscriberTypeException */ public function registerSubscriber(Subscriber $subscriber): void; public function registerTracer(Tracer\Tracer $tracer): void; }