octicon-rss(16/)
You've already forked yii2
mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-10 23:50:38 +08:00
failing test for asset bundle publishing empty directories
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
committed by
Carsten Brandt
gitea-unlock(16/)
parent
18bc835243
commit
583a2bcb9f
octicon-diff(16/tw-mr-1) 1 changed files with 25 additions and 0 deletions
@@ -134,6 +134,31 @@ class AssetBundleTest extends \yiiunit\TestCase
|
||||
$this->assertTrue(rmdir($bundle->basePath));
|
||||
}
|
||||
|
||||
public function testSourcesPublish_publishOptions_Only()
|
||||
{
|
||||
$view = $this->getView();
|
||||
$am = $view->assetManager;
|
||||
|
||||
$bundle = new TestSourceAsset([
|
||||
'publishOptions' => [
|
||||
'only' => [
|
||||
'js/*'
|
||||
]
|
||||
],
|
||||
]);
|
||||
$bundle->publish($am);
|
||||
|
||||
$notNeededFilesDir = $bundle->basePath . DIRECTORY_SEPARATOR . 'css';
|
||||
$this->assertFileNotExists($notNeededFilesDir);
|
||||
|
||||
foreach ($bundle->js as $filename) {
|
||||
$publishedFile = $bundle->basePath . DIRECTORY_SEPARATOR . $filename;
|
||||
$this->assertTrue(unlink($publishedFile));
|
||||
}
|
||||
$this->assertTrue(rmdir($bundle->basePath . DIRECTORY_SEPARATOR . 'js'));
|
||||
$this->assertTrue(rmdir($bundle->basePath));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param View $view
|
||||
* @return AssetBundle
|
||||
|
||||
Reference in New Issue
Block a user