From c23ac045e4b796860f921cff18518a110d4bd423 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 14 Mar 2023 17:00:56 +0100 Subject: [PATCH 1/7] Create ConsoleServiceProviderUnitTest.php --- .../Unit/ConsoleServiceProviderUnitTest.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php diff --git a/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php b/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php new file mode 100644 index 00000000000..8a4c94995a1 --- /dev/null +++ b/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php @@ -0,0 +1,16 @@ + Date: Tue, 14 Mar 2023 17:01:48 +0100 Subject: [PATCH 2/7] Extend UnitTestCase --- .../framework/tests/Unit/ConsoleServiceProviderUnitTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php b/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php index 8a4c94995a1..9ddaaafd19f 100644 --- a/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php +++ b/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php @@ -5,12 +5,12 @@ namespace Hyde\Framework\Testing\Unit; use Hyde\Console\ConsoleServiceProvider; -use Hyde\Testing\TestCase; +use Hyde\Testing\UnitTestCase; /** * @covers \Hyde\Console\ConsoleServiceProvider */ -class ConsoleServiceProviderUnitTest extends TestCase +class ConsoleServiceProviderUnitTest extends UnitTestCase { // } From 9307e3308ddc0eb2cf6207661ae155460b3a6434 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 14 Mar 2023 17:03:52 +0100 Subject: [PATCH 3/7] Test provider registers logo --- .../Unit/ConsoleServiceProviderUnitTest.php | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php b/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php index 9ddaaafd19f..698543f05bc 100644 --- a/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php +++ b/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php @@ -12,5 +12,25 @@ */ class ConsoleServiceProviderUnitTest extends UnitTestCase { - // + public function testProviderRegistersLogo() + { + $this->assertSame(<< Date: Tue, 14 Mar 2023 17:05:12 +0100 Subject: [PATCH 4/7] Update provider to set "HydePHP" as logo when running without ANSI Fixes https://github.com/hydephp/develop/issues/1127 --- packages/framework/src/Console/ConsoleServiceProvider.php | 5 +++++ .../tests/Unit/ConsoleServiceProviderUnitTest.php | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/packages/framework/src/Console/ConsoleServiceProvider.php b/packages/framework/src/Console/ConsoleServiceProvider.php index b1eb6f53c59..4e7b319ec96 100644 --- a/packages/framework/src/Console/ConsoleServiceProvider.php +++ b/packages/framework/src/Console/ConsoleServiceProvider.php @@ -45,6 +45,11 @@ public function register(): void protected static function logo(): string { + // Check if no-ansi flag is set + if (isset($_SERVER['argv']) && in_array('--no-ansi', $_SERVER['argv'], true)) { + return 'HydePHP'; + } + return <<assertSame('HydePHP', ConsoleServiceProviderTestClass::logo()); + } } class ConsoleServiceProviderTestClass extends ConsoleServiceProvider From 2b2e655730553c92c13526a11d8ef41c2afe014b Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 14 Mar 2023 17:06:29 +0100 Subject: [PATCH 5/7] Backup server arguments --- .../framework/tests/Unit/ConsoleServiceProviderUnitTest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php b/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php index 582848f4266..4e6fafe2f9d 100644 --- a/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php +++ b/packages/framework/tests/Unit/ConsoleServiceProviderUnitTest.php @@ -28,9 +28,13 @@ public function testProviderRegistersLogo() public function testProviderRegistersNoAnsiLogo() { + $serverBackup = $_SERVER; + $_SERVER['argv'] = ['--no-ansi']; $this->assertSame('HydePHP', ConsoleServiceProviderTestClass::logo()); + + $_SERVER = $serverBackup; } } From 7804d717cf167c61191da417be1953af46ed8bac Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Tue, 14 Mar 2023 17:11:50 +0100 Subject: [PATCH 6/7] Update RELEASE_NOTES.md --- RELEASE_NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 42cdd17e25a..5144cbc380d 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -23,6 +23,7 @@ This serves two purposes: ### Fixed - Fixed "ReadingTime calculation should never be under one minute" [#1286](https://github.com/hydephp/develop/issues/1286) in [#1285](https://github.com/hydephp/develop/pull/1285) +- Fixed "The HydeCLI list command logo should respect the --no-ansi setting" [#1127](https://github.com/hydephp/develop/issues/1127) in [#1288](https://github.com/hydephp/develop/pull/1288) ### Security - in case of vulnerabilities. From 4b17a543caf895561cef06629cb0acd191a6b5b8 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Tue, 14 Mar 2023 16:12:17 +0000 Subject: [PATCH 7/7] Apply fixes from StyleCI --- packages/framework/src/Facades/Features.php | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/framework/src/Facades/Features.php b/packages/framework/src/Facades/Features.php index 609bcd88de6..0a201cf8b22 100644 --- a/packages/framework/src/Facades/Features.php +++ b/packages/framework/src/Facades/Features.php @@ -28,6 +28,7 @@ * * @todo Split facade logic to service/manager class. (Initial and mock data could be set with boot/set methods) * Based entirely on Laravel Jetstream (License MIT) + * * @see https://jetstream.laravel.com/ */ class Features implements SerializableContract