Skip to content

Commit

Permalink
Merge pull request #571 from hydephp/fix-wrong-HydeFront-version-cons…
Browse files Browse the repository at this point in the history
…tant

Fix wrong HydeFront version constant
  • Loading branch information
caendesilva authored Mar 20, 2023
2 parents 439a1bd + 6f6e2f9 commit 8c47864
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Framework/Services/AssetService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
class AssetService
{
/** @var string The default HydeFront SemVer tag to load. This constant is set to match the styles used for the installed framework version. */
final public const HYDEFRONT_VERSION = 'v2.0';
final public const HYDEFRONT_VERSION = 'v3.3';

/** @var string The default HydeFront CDN path pattern. The Blade-style placeholders are replaced with the proper values. */
final public const HYDEFRONT_CDN_URL = 'https://cdn.jsdelivr.net/npm/hydefront@{{ $version }}/dist/{{ $file }}';
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/AssetServiceUnitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected function setUp(): void

public function testVersionStringConstant()
{
$this->assertSame('v2.0', AssetService::HYDEFRONT_VERSION);
$this->assertSame('v3.3', AssetService::HYDEFRONT_VERSION);
}

public function testServiceHasVersionString()
Expand Down Expand Up @@ -55,7 +55,7 @@ public function testCanSetCustomCdnUrlInConfig()
public function testCanUseCustomCdnUrlWithVersion()
{
self::mockConfig(['hyde.hydefront_url' => '{{ $version }}']);
$this->assertSame('v2.0', (new AssetService())->cdnLink(''));
$this->assertSame('v3.3', (new AssetService())->cdnLink(''));
}

public function testCanUseCustomCdnUrlWithFile()
Expand All @@ -67,7 +67,7 @@ public function testCanUseCustomCdnUrlWithFile()
public function testCanUseCustomCdnUrlWithVersionAndFile()
{
self::mockConfig(['hyde.hydefront_url' => '{{ $version }}/{{ $file }}']);
$this->assertSame('v2.0/styles.css', (new AssetService())->cdnLink('styles.css'));
$this->assertSame('v3.3/styles.css', (new AssetService())->cdnLink('styles.css'));
}

public function testCanUseCustomCdnUrlWithCustomVersion()
Expand All @@ -82,7 +82,7 @@ public function testCanUseCustomCdnUrlWithCustomVersion()
public function testCdnLinkHelper()
{
$this->assertSame(
'https://cdn.jsdelivr.net/npm/hydefront@v2.0/dist/styles.css',
'https://cdn.jsdelivr.net/npm/hydefront@v3.3/dist/styles.css',
(new AssetService())->cdnLink('styles.css')
);
}
Expand Down

0 comments on commit 8c47864

Please sign in to comment.