Skip to content

Commit 9e6fa3e

Browse files
authored
Merge pull request #1391 from hydephp/fix-wrong-version-constant
Fix wrong version constant
2 parents 9bc02d2 + ac147cf commit 9e6fa3e

File tree

2 files changed

+25
-5
lines changed

2 files changed

+25
-5
lines changed

packages/framework/src/Foundation/HydeKernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class HydeKernel implements SerializableContract
4949
use Serializable;
5050
use Macroable;
5151

52-
final public const VERSION = '1.1.0';
52+
final public const VERSION = '1.2.0';
5353

5454
protected static self $instance;
5555

packages/framework/tests/Feature/HydeKernelTest.php

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace Hyde\Framework\Testing\Feature;
66

7+
use Throwable;
78
use Composer\InstalledVersions;
89
use Hyde\Facades\Features;
910
use Hyde\Foundation\Facades\Pages;
@@ -294,11 +295,30 @@ public function test_version_constant_is_a_valid_semver_string()
294295
);
295296
}
296297

297-
public function test_version_constant_is_up_to_date()
298+
public function test_version_constant_is_up_to_date_with_composer()
298299
{
299-
$this->assertTrue(version_compare(
300-
HydeKernel::VERSION, InstalledVersions::getPrettyVersion('hyde/framework')
301-
) >= 0);
300+
$version = InstalledVersions::getPrettyVersion('hyde/framework');
301+
302+
if (str_starts_with($version, 'dev-')) {
303+
$this->markTestSkipped('Installed version is for development');
304+
}
305+
306+
$this->assertSame(HydeKernel::VERSION, $version);
307+
}
308+
309+
public function test_version_constant_is_up_to_date_with_git()
310+
{
311+
try {
312+
$version = trim(shell_exec('git describe --abbrev=0 --tags'));
313+
} catch (Throwable) {
314+
$this->markTestSkipped('Could not get version from Git');
315+
}
316+
317+
if ('v'.HydeKernel::VERSION === $version) {
318+
$this->assertSame('v'.HydeKernel::VERSION, $version);
319+
} else {
320+
$this->markTestSkipped('Version constant does not match Git version!');
321+
}
302322
}
303323

304324
public function test_version_method_returns_version_constant()

0 commit comments

Comments
 (0)