diff --git a/tests/AssetTest.php b/tests/AssetTest.php index 992022f..2245c9e 100644 --- a/tests/AssetTest.php +++ b/tests/AssetTest.php @@ -44,12 +44,6 @@ public function testDateTimePickerAssetSimpleDependency(): void public function testDateTimePickerAssetRegister(): void { - $this->assertEmpty($this->view->assetBundles); - - JQueryProviderAsset::register($this->view); - - $this->assertCount(3, $this->view->assetBundles); - $result = $this->view->renderFile( __DIR__ . '/Support/main.php', [ @@ -62,11 +56,11 @@ public function testDateTimePickerAssetRegister(): void ], ); - $this->assertStringNotContainsString('css/tempus-dominus.min.css', $result); - $this->assertStringNotContainsString('js/tempus-dominus.min.js', $result); - $this->assertStringNotContainsString('jQuery-provider.min.js', $result); - $this->assertStringNotContainsString('popper.min.js', $result); - $this->assertStringNotContainsString('jquery.min.js', $result); + $directory = __DIR__ . '/Support/runtime/16b8de20'; + + $this->assertDirectoryDoesNotExist("$directory/css/tempus-dominus.min.css"); + $this->assertDirectoryDoesNotExist("$directory/css/js/tempus-dominus.min.js"); + $this->assertDirectoryDoesNotExist("$directory/css/js/jQuery-provider.min.js"); $this->assertStringContainsString('css/tempus-dominus.css', $result); $this->assertStringContainsString('js/tempus-dominus.js', $result); $this->assertStringContainsString('jQuery-provider.js', $result); diff --git a/tests/Support/TestSupport.php b/tests/Support/TestSupport.php index c180a6f..a4a55e8 100644 --- a/tests/Support/TestSupport.php +++ b/tests/Support/TestSupport.php @@ -38,6 +38,7 @@ protected function mockApplication(): void 'appendTimestamp' => false, 'basePath' => __DIR__ . '/runtime', 'baseUrl' => '/', + 'forceCopy' => true, ], 'i18n' => [ 'translations' => [ @@ -55,6 +56,10 @@ protected function mockApplication(): void ], ], ); + + Yii::$app->assetManager->hashCallback = static function (string $path) { + return '16b8de20'; + }; } /**