5 use PHPUnit\Framework\Assert;
6 use Symfony\Component\Console\Tester\CommandTester;
11 public function __construct(
12 protected CommandTester $tester,
13 protected ?\Exception $error
16 public function assertSuccessfulExit(): void
18 Assert::assertEquals(0, $this->tester->getStatusCode());
21 public function assertErrorExit(): void
23 Assert::assertTrue($this->error !== null);
26 public function assertStdoutContains(string $needle): void
28 Assert::assertStringContainsString($needle, $this->tester->getDisplay());
31 public function assertStderrContains(string $needle): void
33 Assert::assertStringContainsString($needle, $this->error->getMessage() ?? '');