-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/** | ||
* MiniAsset | ||
* Copyright (c) Mark Story (http://mark-story.com) | ||
* | ||
* Licensed under The MIT License | ||
* For full copyright and license information, please see the LICENSE.txt | ||
* Redistributions of files must retain the above copyright notice. | ||
* | ||
* @copyright Copyright (c) Mark Story (http://mark-story.com) | ||
* @since 0.0.1 | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
namespace MiniAsset\Test\TestCase\Filter; | ||
|
||
use MiniAsset\Filter\CleanCss; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class CleanCssTest extends TestCase | ||
{ | ||
|
||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
$this->_cssDir = APP . 'css' . DS; | ||
$this->filter = new CleanCss(); | ||
} | ||
|
||
public function testUnminified() | ||
{ | ||
$content = file_get_contents($this->_cssDir . 'unminified.css'); | ||
$result = $this->filter->output($this->_cssDir . 'unminified.css', $content); | ||
|
||
$expected = file_get_contents($this->_cssDir . 'minified.css'); | ||
$this->assertEquals(trim($expected), $result); | ||
} | ||
|
||
public function testAlreadyMinified() | ||
{ | ||
$content = file_get_contents($this->_cssDir . 'minified.css'); | ||
$result = $this->filter->output($this->_cssDir . 'minified.css', $content); | ||
|
||
$expected = file_get_contents($this->_cssDir . 'minified.css'); | ||
$this->assertEquals(trim($expected), $result); | ||
} | ||
} |