From aa2b8c380e5e3720b92faaa849b33c6c786a80a0 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Tue, 1 Oct 2024 13:51:33 +1300 Subject: [PATCH] FIX Fix NavigateCommandTest and don't try to write null (#11412) --- src/Cli/Command/NavigateCommand.php | 2 +- tests/php/Cli/Command/NavigateCommandTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 {