diff --git a/framework/core/tests/integration/extenders/ConsoleTest.php b/framework/core/tests/integration/extenders/ConsoleTest.php index c7d1257b2..f1e71fb40 100644 --- a/framework/core/tests/integration/extenders/ConsoleTest.php +++ b/framework/core/tests/integration/extenders/ConsoleTest.php @@ -14,6 +14,7 @@ use Flarum\Extend; use Flarum\Testing\integration\ConsoleTestCase; use Illuminate\Console\Scheduling\Event; use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Exception\CommandNotFoundException; class ConsoleTest extends ConsoleTestCase { @@ -26,7 +27,8 @@ class ConsoleTest extends ConsoleTestCase 'command' => 'customTestCommand' ]; - $this->assertEquals('Command "customTestCommand" is not defined.', $this->runCommand($input)); + $this->expectException(CommandNotFoundException::class); + $this->runCommand($input); } /** diff --git a/php-packages/testing/src/integration/ConsoleTestCase.php b/php-packages/testing/src/integration/ConsoleTestCase.php index a29db0895..ba925b704 100644 --- a/php-packages/testing/src/integration/ConsoleTestCase.php +++ b/php-packages/testing/src/integration/ConsoleTestCase.php @@ -23,6 +23,7 @@ abstract class ConsoleTestCase extends TestCase if (is_null($this->console)) { $this->console = new ConsoleApplication('Flarum', Application::VERSION); $this->console->setAutoExit(false); + $this->console->setCatchExceptions(false); foreach ($this->app()->getConsoleCommands() as $command) { $this->console->add($command);