setApplication($shell); $tester = new CommandTester($command); $tester->execute([]); $this->assertStringContainsString('Show a list of commands. Type `help [foo]` for information about [foo].', $tester->getDisplay()); foreach ($shell->all() as $command) { $pattern = \sprintf('/^\s*%s/m', \preg_quote($command->getName())); $this->assertMatchesRegularExpression($pattern, $tester->getDisplay()); } $this->assertStringContainsString('End the current session and return to caller.', $tester->getDisplay()); $this->assertStringContainsString('Aliases: quit, q', $tester->getDisplay()); } }