From 4d64d19a039ba59ecef8a1a4765c6138853b845b Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Thu, 19 Oct 2023 15:56:31 +0200 Subject: [PATCH 1/2] Fix version constant tests --- .../tests/Feature/HydeKernelTest.php | 28 ++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/packages/framework/tests/Feature/HydeKernelTest.php b/packages/framework/tests/Feature/HydeKernelTest.php index d8a889527c7..f497b9aa087 100644 --- a/packages/framework/tests/Feature/HydeKernelTest.php +++ b/packages/framework/tests/Feature/HydeKernelTest.php @@ -4,6 +4,7 @@ namespace Hyde\Framework\Testing\Feature; +use Throwable; use Composer\InstalledVersions; use Hyde\Facades\Features; use Hyde\Foundation\Facades\Pages; @@ -294,11 +295,30 @@ public function test_version_constant_is_a_valid_semver_string() ); } - public function test_version_constant_is_up_to_date() + public function test_version_constant_is_up_to_date_with_composer() { - $this->assertTrue(version_compare( - HydeKernel::VERSION, InstalledVersions::getPrettyVersion('hyde/framework') - ) >= 0); + $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 test_version_constant_is_up_to_date_with_git() + { + try { + $version = trim(shell_exec('git describe --abbrev=0 --tags')); + } catch (Throwable) { + $this->markTestSkipped('Could not get version from Git'); + } + + if ('v'.HydeKernel::VERSION === $version) { + $this->assertSame('v'.HydeKernel::VERSION, $version); + } else { + $this->markTestSkipped('Version constant does not match Git version!'); + } } public function test_version_method_returns_version_constant() From ac147cfd56fbc0674bc020cb2b6d627215e21efe Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Thu, 19 Oct 2023 15:57:28 +0200 Subject: [PATCH 2/2] Fix wrong version constant --- packages/framework/src/Foundation/HydeKernel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/src/Foundation/HydeKernel.php b/packages/framework/src/Foundation/HydeKernel.php index d04d88bdd96..047ce8530b9 100644 --- a/packages/framework/src/Foundation/HydeKernel.php +++ b/packages/framework/src/Foundation/HydeKernel.php @@ -49,7 +49,7 @@ class HydeKernel implements SerializableContract use Serializable; use Macroable; - final public const VERSION = '1.1.0'; + final public const VERSION = '1.2.0'; protected static self $instance;