diff --git a/src/Cli/Command/NavigateCommand.php b/src/Cli/Command/NavigateCommand.php index d0f658105..0b392ccf3 100644 --- a/src/Cli/Command/NavigateCommand.php +++ b/src/Cli/Command/NavigateCommand.php @@ -27,7 +27,7 @@ class NavigateCommand extends Command // Handle request and output resonse body $response = $app->handle($request); - $output->writeln($response->getBody(), OutputInterface::OUTPUT_RAW); + $output->writeln($response->getBody() ?? '', OutputInterface::OUTPUT_RAW); // Transform HTTP status code into sensible exit code $responseCode = $response->getStatusCode(); diff --git a/tests/php/Cli/Command/NavigateCommandTest.php b/tests/php/Cli/Command/NavigateCommandTest.php index 4eeec534d..2e7b2b823 100644 --- a/tests/php/Cli/Command/NavigateCommandTest.php +++ b/tests/php/Cli/Command/NavigateCommandTest.php @@ -13,7 +13,7 @@ use Symfony\Component\Console\Output\BufferedOutput; class NavigateCommandTest extends SapphireTest { - protected $usesDatabase = false; + protected $usesDatabase = true; public static function provideExecute(): array {