From 10407d43d0b799e4f5a892cf9f3c23b78b209233 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Fri, 26 Jul 2024 10:14:07 +0200 Subject: [PATCH] Update AssetServiceUnitTest.php --- .../tests/Unit/AssetServiceUnitTest.php | 67 ------------------- 1 file changed, 67 deletions(-) diff --git a/packages/framework/tests/Unit/AssetServiceUnitTest.php b/packages/framework/tests/Unit/AssetServiceUnitTest.php index 9267b4715a6..0363a43c567 100644 --- a/packages/framework/tests/Unit/AssetServiceUnitTest.php +++ b/packages/framework/tests/Unit/AssetServiceUnitTest.php @@ -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/hydefront@v3.4/dist/styles.css', - (new AssetService())->cdnLink('styles.css') - ); - } - public function testHasMediaFileHelper() { $this->assertFalse((new AssetService())->hasMediaFile('styles.css'));