]> BookStack Code Mirror - system-cli/blobdiff - tests/CommandResult.php
Added testing for the update command
[system-cli] / tests / CommandResult.php
index b8ee3b01d2a85db87dce862a46106a8936b170f4..492e216e3022dcbf054eb4a57f768502e4613933 100644 (file)
@@ -13,6 +13,11 @@ class CommandResult
         protected ?\Exception $error
     ) { }
 
+    public function getStderr(): string
+    {
+        return $this->error?->getMessage() ?? '';
+    }
+
     public function assertSuccessfulExit(): void
     {
         Assert::assertEquals(0, $this->tester->getStatusCode());
@@ -30,7 +35,7 @@ class CommandResult
 
     public function assertStderrContains(string $needle): void
     {
-        Assert::assertStringContainsString($needle, $this->error->getMessage() ?? '');
+        Assert::assertStringContainsString($needle, $this->getStderr());
     }