Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. PhpunitErrorTriggered.php

class PhpunitErrorTriggered

@psalm-immutable

@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Hierarchy

  • class \PHPUnit\Event\Test\PhpunitErrorTriggered implements \PHPUnit\Event\Event

Expanded class hierarchy of PhpunitErrorTriggered

6 files declare their use of PhpunitErrorTriggered
Collector.php in vendor/phpunit/phpunit/src/Runner/TestResult/Collector.php
ResultPrinter.php in vendor/phpunit/phpunit/src/TextUI/Output/Default/ResultPrinter.php
TestResult.php in vendor/phpunit/phpunit/src/Runner/TestResult/TestResult.php
TestResultCollector.php in vendor/phpunit/phpunit/src/Logging/TestDox/TestResult/TestResultCollector.php
TestTriggeredPhpunitErrorSubscriber.php in vendor/phpunit/phpunit/src/Logging/TestDox/TestResult/Subscriber/TestTriggeredPhpunitErrorSubscriber.php

... See full list

File

vendor/phpunit/phpunit/src/Event/Events/Test/Issue/PhpunitErrorTriggered.php, line 24

Namespace

PHPUnit\Event\Test
View source
final class PhpunitErrorTriggered implements Event {
    private readonly Telemetry\Info $telemetryInfo;
    private readonly Test $test;
    
    /**
     * @psalm-var non-empty-string
     */
    private readonly string $message;
    
    /**
     * @psalm-param non-empty-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;
    }
    
    /**
     * @psalm-return non-empty-string
     */
    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);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
PhpunitErrorTriggered::$message private property @psalm-var non-empty-string
PhpunitErrorTriggered::$telemetryInfo private property
PhpunitErrorTriggered::$test private property
PhpunitErrorTriggered::asString public function Overrides Event::asString
PhpunitErrorTriggered::message public function @psalm-return non-empty-string
PhpunitErrorTriggered::telemetryInfo public function Overrides Event::telemetryInfo
PhpunitErrorTriggered::test public function
PhpunitErrorTriggered::__construct public function @psalm-param non-empty-string $message

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal