-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78a748e
commit 10407d4
Showing
1 changed file
with
0 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,73 +21,6 @@ protected function setUp(): void | |
self::mockConfig(); | ||
} | ||
|
||
public function testVersionStringConstant() | ||
{ | ||
$this->assertSame('v3.4', AssetService::HYDEFRONT_VERSION); | ||
} | ||
|
||
public function testServiceHasVersionString() | ||
{ | ||
$this->assertIsString((new AssetService())->version()); | ||
} | ||
|
||
public function testVersionStringDefaultsToConstant() | ||
{ | ||
$this->assertSame(AssetService::HYDEFRONT_VERSION, (new AssetService())->version()); | ||
} | ||
|
||
public function testVersionCanBeSetInConfig() | ||
{ | ||
self::mockConfig(['hyde.hydefront_version' => '1.0.0']); | ||
$this->assertSame('1.0.0', (new AssetService())->version()); | ||
} | ||
|
||
public function testCdnPatternConstant() | ||
{ | ||
$this->assertSame('https://cdn.jsdelivr.net/npm/hydefront@{{ $version }}/dist/{{ $file }}', AssetService::HYDEFRONT_CDN_URL); | ||
} | ||
|
||
public function testCanSetCustomCdnUrlInConfig() | ||
{ | ||
self::mockConfig(['hyde.hydefront_url' => 'https://example.com']); | ||
$this->assertSame('https://example.com', (new AssetService())->cdnLink('')); | ||
} | ||
|
||
public function testCanUseCustomCdnUrlWithVersion() | ||
{ | ||
self::mockConfig(['hyde.hydefront_url' => '{{ $version }}']); | ||
$this->assertSame('v3.4', (new AssetService())->cdnLink('')); | ||
} | ||
|
||
public function testCanUseCustomCdnUrlWithFile() | ||
{ | ||
self::mockConfig(['hyde.hydefront_url' => '{{ $file }}']); | ||
$this->assertSame('styles.css', (new AssetService())->cdnLink('styles.css')); | ||
} | ||
|
||
public function testCanUseCustomCdnUrlWithVersionAndFile() | ||
{ | ||
self::mockConfig(['hyde.hydefront_url' => '{{ $version }}/{{ $file }}']); | ||
$this->assertSame('v3.4/styles.css', (new AssetService())->cdnLink('styles.css')); | ||
} | ||
|
||
public function testCanUseCustomCdnUrlWithCustomVersion() | ||
{ | ||
self::mockConfig([ | ||
'hyde.hydefront_url' => '{{ $version }}', | ||
'hyde.hydefront_version' => '1.0.0', | ||
]); | ||
$this->assertSame('1.0.0', (new AssetService())->cdnLink('')); | ||
} | ||
|
||
public function testCdnLinkHelper() | ||
{ | ||
$this->assertSame( | ||
'https://cdn.jsdelivr.net/npm/[email protected]/dist/styles.css', | ||
(new AssetService())->cdnLink('styles.css') | ||
); | ||
} | ||
|
||
public function testHasMediaFileHelper() | ||
{ | ||
$this->assertFalse((new AssetService())->hasMediaFile('styles.css')); | ||
|