Skip to content

Commit

Permalink
add test - not yet working
Browse files Browse the repository at this point in the history
  • Loading branch information
mrothauer committed Jul 9, 2022
1 parent b4d6dca commit 40f3dd9
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/TestCase/Filter/CleanCssTest.php
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);
}
}

0 comments on commit 40f3dd9

Please sign in to comment.