From de97d92367a549ddb4ba008ef7fe1c2d4427618e Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 12 Nov 2023 10:42:03 +0100 Subject: [PATCH] Test start message method --- .../tests/ConsoleOutputTest.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/realtime-compiler/tests/ConsoleOutputTest.php b/packages/realtime-compiler/tests/ConsoleOutputTest.php index b554e1e56cf..5a30fe55bf2 100644 --- a/packages/realtime-compiler/tests/ConsoleOutputTest.php +++ b/packages/realtime-compiler/tests/ConsoleOutputTest.php @@ -14,3 +14,22 @@ Styles::flush(); }); + +test('printStartMessage method', function () { + // Todo handle version dynamically + + $output = new \Hyde\RealtimeCompiler\ConsoleOutput(); + $output->printStartMessage('localhost', 8000); + $this->assertSame(<<<'TXT' + + ╭────────────────────────────────────╮ + │ │ + │ HydePHP Realtime Compiler v1.3.3 │ + │ │ + │ Listening on http://localhost:8000 │ + │ │ + ╰────────────────────────────────────╯ + + + TXT, str_replace(["\u{A0}", "\r"], [' ', ''], $this->output->fetch())); +});