From 6d29c573321ebe9a8af568ef7734b6cb55400b64 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sun, 12 Nov 2023 12:32:06 +0100 Subject: [PATCH] Get version from instance so it can be mocked Just saves on testing logic as we can fix the version --- packages/realtime-compiler/src/ConsoleOutput.php | 2 +- .../realtime-compiler/tests/ConsoleOutputTest.php | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/realtime-compiler/src/ConsoleOutput.php b/packages/realtime-compiler/src/ConsoleOutput.php index ba700699024..9f089c9a469 100644 --- a/packages/realtime-compiler/src/ConsoleOutput.php +++ b/packages/realtime-compiler/src/ConsoleOutput.php @@ -28,7 +28,7 @@ public function printStartMessage(string $host, int $port): void $url = sprintf('%s://%s:%d', $port === 443 ? 'https' : 'http', $host, $port); $lines = [ - sprintf('%s %s', 'HydePHP Realtime Compiler', 'v'.Hyde::version()), + sprintf('%s %s', 'HydePHP Realtime Compiler', 'v'.Hyde::getInstance()->version()), '', sprintf('Listening on %s', $url, $url), ]; diff --git a/packages/realtime-compiler/tests/ConsoleOutputTest.php b/packages/realtime-compiler/tests/ConsoleOutputTest.php index 5a30fe55bf2..a567615b012 100644 --- a/packages/realtime-compiler/tests/ConsoleOutputTest.php +++ b/packages/realtime-compiler/tests/ConsoleOutputTest.php @@ -1,5 +1,6 @@ printStartMessage('localhost', 8000); @@ -24,7 +32,7 @@ ╭────────────────────────────────────╮ │ │ - │ HydePHP Realtime Compiler v1.3.3 │ + │ HydePHP Realtime Compiler v1.2.3 │ │ │ │ Listening on http://localhost:8000 │ │ │