* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Pest\Logging\TeamCity\Subscriber; use PHPUnit\Event\Test\Skipped; use PHPUnit\Event\Test\SkippedSubscriber; use ReflectionClass; /** * @internal This class is not covered by the backward compatibility promise for PHPUnit */ final class TestSkippedSubscriber extends Subscriber implements SkippedSubscriber { public function notify(Skipped $event): void { if (str_contains($event->message(), '__TODO__')) { $this->printTodoItem(); } $this->logger()->testSkipped($event); } /** * Prints a "T" to the standard PHPUnit output to indicate a todo item. */ private function printTodoItem(): void { $mirror = new ReflectionClass($this->printer()); $printerMirror = $mirror->getMethod('printProgress'); $printerMirror->invoke($this->printer(), 'T'); } }