protected ?\Exception $error
) { }
+ public function getStderr(): string
+ {
+ return $this->error?->getMessage() ?? '';
+ }
+
public function assertSuccessfulExit(): void
{
Assert::assertEquals(0, $this->tester->getStatusCode());
public function assertStderrContains(string $needle): void
{
- Assert::assertStringContainsString($needle, $this->error->getMessage() ?? '');
+ Assert::assertStringContainsString($needle, $this->getStderr());
}