diff --git a/tests/unit/framework/console/controllers/AssetControllerTest.php b/tests/unit/framework/console/controllers/AssetControllerTest.php index c798409..1b2fdcc 100644 --- a/tests/unit/framework/console/controllers/AssetControllerTest.php +++ b/tests/unit/framework/console/controllers/AssetControllerTest.php @@ -96,8 +96,10 @@ class AssetControllerTest extends TestCase 'all' => array( 'basePath' => $assetsBasePath, 'baseUrl' => $baseUrl, - 'js' => 'all-{ts}.js', - 'css' => 'all-{ts}.css', + 'js' => 'all.js', + //'js' => 'all-{ts}.js', + 'css' => 'all.css', + //'css' => 'all-{ts}.css', ), ), 'assetManager' => array( @@ -201,6 +203,10 @@ class AssetControllerTest extends TestCase $this->runAssetControllerAction('compress', array($configFile, $bundleFile)); - $this->markTestIncomplete(); + $assetsBasePath = $this->testFilePath.DIRECTORY_SEPARATOR.'assets'; + $compressedCssFileName = $assetsBasePath.DIRECTORY_SEPARATOR.'all.css'; + $this->assertTrue(file_exists($compressedCssFileName), 'Unable to compress CSS files!'); + $compressedJsFileName = $assetsBasePath.DIRECTORY_SEPARATOR.'all.js'; + $this->assertTrue(file_exists($compressedJsFileName), 'Unable to compress JS files!'); } } diff --git a/yii/console/controllers/AssetController.php b/yii/console/controllers/AssetController.php index 0dd8181..cbf160c 100644 --- a/yii/console/controllers/AssetController.php +++ b/yii/console/controllers/AssetController.php @@ -291,9 +291,10 @@ EOD $tmpFile = $outputFile . '.tmp'; $this->combineCssFiles($inputFiles, $tmpFile); $log = shell_exec(strtr($this->cssCompressor, array( - '{from}' => $inputFiles, + '{from}' => $tmpFile, '{to}' => $outputFile, ))); + @unlink($tmpFile); } else { $log = call_user_func($this->cssCompressor, $this, $inputFiles, $outputFile); }