1
0
mirror of https://github.com/mrclay/minify.git synced 2025-01-17 21:28:14 +01:00
minify/tests/MinifyCommentPreserverTest.php
Elan Ruusamäe b31855f6b8 Apply php-cs-fixer fixers
- braces
- function_declaration
- lowercase_keywords
- method_argument_space
- no_spaces_inside_parenthesis
- no_trailing_whitespace
- no_trailing_whitespace_in_comment
- single_blank_line_at_eof
2020-04-03 10:47:27 +03:00

35 lines
873 B
PHP

<?php
namespace Minify\Test;
use Minify_CommentPreserver;
class MinifyCommentPreserverTest extends TestCase
{
public function test()
{
$inOut = array(
'/*!*/' => "\n/*!*/\n",
'/*!*/a' => "\n/*!*/\n1A",
'a/*!*//*!*/b' => "2A\n/*!*/\n\n/*!*/\n3B",
'a/*!*/b/*!*/' => "4A\n/*!*/\n5B\n/*!*/\n",
);
$processor = array(__CLASS__, '_test_MCP_processor');
foreach ($inOut as $in => $expected) {
$actual = Minify_CommentPreserver::process($in, $processor);
$this->assertSame($expected, $actual, 'Minify_CommentPreserver');
}
}
/**
* @internal
*/
public static function _test_MCP_processor($content, $options = array())
{
static $callCount = 0;
++$callCount;
return $callCount . strtoupper($content);
}
}