From 333d50709dccb2aa42540860a9ff6a9177c573c8 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 28 Jun 2024 21:31:56 +0200 Subject: [PATCH 1/3] Fix string check causing test to unintentionally be skipped --- .../framework/tests/Unit/HydeConfigFilesAreMatchingTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php b/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php index ff906d2c717..5a692548ad6 100644 --- a/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php +++ b/packages/framework/tests/Unit/HydeConfigFilesAreMatchingTest.php @@ -18,7 +18,7 @@ protected function setUp(): void { parent::setUp(); - if (file_exists(Hyde::path('README.md')) && ! str_contains(file_get_contents(Hyde::path('README.md')), 'HydePHP - Source Monorepo')) { + if (file_exists(Hyde::path('README.md')) && ! str_contains(file_get_contents(Hyde::path('README.md')), 'HydePHP - Source Code Monorepo')) { $this->markTestSkipped('Test skipped when not running in the monorepo.'); } } From fd1e7e6a282afd46f8bc3e87907af846f59d8029 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 28 Jun 2024 21:49:05 +0200 Subject: [PATCH 2/3] Remove tests for if the version constant is up to date or not This was useful way back when when we used a manual versioning system and this could catch cases where I messed up, but now that versioning is automated this is not needed. --- .../tests/Feature/HydeKernelTest.php | 30 ------------------- 1 file changed, 30 deletions(-) diff --git a/packages/framework/tests/Feature/HydeKernelTest.php b/packages/framework/tests/Feature/HydeKernelTest.php index d59dc86f679..117d455ff46 100644 --- a/packages/framework/tests/Feature/HydeKernelTest.php +++ b/packages/framework/tests/Feature/HydeKernelTest.php @@ -4,9 +4,7 @@ namespace Hyde\Framework\Testing\Feature; -use Throwable; use Hyde\Enums\Feature; -use Composer\InstalledVersions; use Hyde\Facades\Features; use Hyde\Foundation\Facades\Pages; use Hyde\Foundation\Facades\Routes; @@ -306,34 +304,6 @@ public function testVersionConstantIsAValidSemverString() ); } - public function testVersionConstantIsUpToDateWithComposer() - { - $version = InstalledVersions::getPrettyVersion('hyde/framework'); - - if (str_starts_with($version, 'dev-')) { - $this->markTestSkipped('Installed version is for development'); - } - - $this->assertSame(HydeKernel::VERSION, $version); - } - - public function testVersionConstantIsUpToDateWithGit() - { - try { - $version = trim(shell_exec('git describe --abbrev=0 --tags')); - } catch (Throwable) { - // Gracefully skip the test if the version cannot be fetched - $this->markTestSkipped('Could not get version from Git'); - } - - if ('v'.HydeKernel::VERSION === $version) { - $this->assertSame('v'.HydeKernel::VERSION, $version); - } else { - // Gracefully skip the test if the version is not up-to-date - $this->markTestSkipped('Version constant does not match Git version!'); - } - } - public function testVersionMethodReturnsVersionConstant() { $this->assertSame(HydeKernel::VERSION, Hyde::version()); From 266fb1743ed19fb56072cda4ff8ad6e3e9acd24d Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 28 Jun 2024 21:59:44 +0200 Subject: [PATCH 3/3] Remove conditional test skip based on class existence Want to know what this is about, and if it actually gets triggered --- .../framework/tests/Feature/Commands/ServeCommandTest.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/framework/tests/Feature/Commands/ServeCommandTest.php b/packages/framework/tests/Feature/Commands/ServeCommandTest.php index aee041919e3..c8569cc38ae 100644 --- a/packages/framework/tests/Feature/Commands/ServeCommandTest.php +++ b/packages/framework/tests/Feature/Commands/ServeCommandTest.php @@ -9,7 +9,6 @@ use Hyde\Testing\TestCase; use Illuminate\Support\Facades\Process; use TypeError; -use Hyde\RealtimeCompiler\ConsoleOutput; /** * @covers \Hyde\Console\Commands\ServeCommand @@ -166,10 +165,6 @@ public function testHydeServeCommandPassesThroughProcessOutput() public function testWithFancyOutput() { - if (! class_exists(ConsoleOutput::class)) { - $this->markTestSkipped('ConsoleOutput class not found.'); - } - Process::fake(['php -S localhost:8080 {$this->binaryPath()}' => 'foo']); $this->artisan('serve')