mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-02 13:02:24 +08:00
failing test for asset bundle publishing empty directories
This commit is contained in:
@ -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