Refactoring
This commit is contained in:
24
lib/composer/vendor/consolidation/robo/tests/cli/AssetsCept.php
vendored
Normal file
24
lib/composer/vendor/consolidation/robo/tests/cli/AssetsCept.php
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
$I = new CliGuy($scenario);
|
||||
|
||||
$I->wantTo('minify a css file');
|
||||
$I->amInPath(codecept_data_dir().'sandbox');
|
||||
|
||||
$sampleCss = dirname(__DIR__) . '/_data/sample.css';
|
||||
$outputCss = 'minifiedSample.css';
|
||||
|
||||
$initialFileSize = filesize($sampleCss);
|
||||
|
||||
$I->taskMinify($sampleCss)
|
||||
->to('minifiedSample.css')
|
||||
->run();
|
||||
|
||||
$I->seeFileFound($outputCss);
|
||||
$minifiedFileSize = filesize($outputCss);
|
||||
$outputCssContents = file_get_contents($outputCss);
|
||||
|
||||
$I->assertLessThan($initialFileSize, $minifiedFileSize, 'Minified file is smaller than the source file');
|
||||
$I->assertGreaterThan(0, $minifiedFileSize, 'Minified file is not empty');
|
||||
$I->assertContains('body', $outputCssContents, 'Minified file has some content from the source file');
|
||||
$I->assertNotContains('Sample css file', $outputCssContents, 'Minified file does not contain comment from source file');
|
||||
Reference in New Issue
Block a user