class BeforeFirstTestMethodErrored
@psalm-immutable
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit
Hierarchy
- class \PHPUnit\Event\Test\BeforeFirstTestMethodErrored implements \PHPUnit\Event\Event
Expanded class hierarchy of BeforeFirstTestMethodErrored
5 files declare their use of BeforeFirstTestMethodErrored
- BeforeTestClassMethodErroredSubscriber.php in vendor/
phpunit/ phpunit/ src/ TextUI/ Output/ Default/ ProgressPrinter/ Subscriber/ BeforeTestClassMethodErroredSubscriber.php - BeforeTestClassMethodErroredSubscriber.php in vendor/
phpunit/ phpunit/ src/ Runner/ TestResult/ Subscriber/ BeforeTestClassMethodErroredSubscriber.php - 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
File
-
vendor/
phpunit/ phpunit/ src/ Event/ Events/ Test/ HookMethod/ BeforeFirstTestMethodErrored.php, line 24
Namespace
PHPUnit\Event\TestView source
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);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
BeforeFirstTestMethodErrored::$calledMethod | private | property | ||
BeforeFirstTestMethodErrored::$telemetryInfo | private | property | ||
BeforeFirstTestMethodErrored::$testClassName | private | property | @psalm-var class-string | |
BeforeFirstTestMethodErrored::$throwable | private | property | ||
BeforeFirstTestMethodErrored::asString | public | function | Overrides Event::asString | |
BeforeFirstTestMethodErrored::calledMethod | public | function | ||
BeforeFirstTestMethodErrored::telemetryInfo | public | function | Overrides Event::telemetryInfo | |
BeforeFirstTestMethodErrored::testClassName | public | function | @psalm-return class-string | |
BeforeFirstTestMethodErrored::throwable | public | function | ||
BeforeFirstTestMethodErrored::__construct | public | function | @psalm-param class-string $testClassName |