2013-04-14 23:38:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use MatthiasMullie\Minify;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* JS minifier test case.
|
|
|
|
*/
|
|
|
|
class JSTest extends PHPUnit_Framework_TestCase
|
|
|
|
{
|
2014-10-12 21:10:12 +02:00
|
|
|
/**
|
|
|
|
* @var Minify\JS
|
|
|
|
*/
|
2013-04-14 23:38:24 +02:00
|
|
|
private $minifier;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prepares the environment before running a test.
|
|
|
|
*/
|
|
|
|
protected function setUp()
|
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
$this->minifier = new Minify\JS();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cleans up the environment after running a test.
|
|
|
|
*/
|
|
|
|
protected function tearDown()
|
|
|
|
{
|
|
|
|
$this->minifier = null;
|
|
|
|
parent::tearDown();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Test JS minifier rules, provided by dataProvider
|
|
|
|
*
|
|
|
|
* @test
|
|
|
|
* @dataProvider dataProvider
|
|
|
|
*/
|
2014-10-12 17:42:22 +02:00
|
|
|
public function minify($input, $expected)
|
2013-04-14 23:38:24 +02:00
|
|
|
{
|
2015-02-06 11:14:02 +01:00
|
|
|
$input = (array) $input;
|
|
|
|
foreach ($input as $js) {
|
|
|
|
$this->minifier->add($js);
|
|
|
|
}
|
2014-10-07 18:21:22 +02:00
|
|
|
$result = $this->minifier->minify();
|
2013-04-14 23:38:24 +02:00
|
|
|
|
2013-12-26 20:39:10 +01:00
|
|
|
$this->assertEquals($expected, $result);
|
2013-04-14 23:38:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2014-10-12 21:10:12 +02:00
|
|
|
* @return array [input, expected result]
|
2013-04-14 23:38:24 +02:00
|
|
|
*/
|
|
|
|
public function dataProvider()
|
|
|
|
{
|
|
|
|
$tests = array();
|
|
|
|
|
2014-10-07 18:21:22 +02:00
|
|
|
// escaped quotes should not terminate string
|
2013-04-14 23:38:24 +02:00
|
|
|
$tests[] = array(
|
2013-12-26 20:39:10 +01:00
|
|
|
'alert("Escaped quote which is same as string quotes: \"; should not match")',
|
|
|
|
'alert("Escaped quote which is same as string quotes: \"; should not match")',
|
2013-12-26 23:59:56 +01:00
|
|
|
);
|
|
|
|
|
2015-01-24 18:24:45 -08:00
|
|
|
// backtick string (allow string interpolation)
|
|
|
|
$tests[] = array(
|
|
|
|
'var str=`Hi, ${name}`',
|
|
|
|
'var str=`Hi, ${name}`',
|
|
|
|
);
|
|
|
|
|
2014-10-07 18:21:22 +02:00
|
|
|
// regex delimiters need to be treated as strings
|
|
|
|
// (two forward slashes could look like a comment)
|
2013-12-26 23:59:56 +01:00
|
|
|
$tests[] = array(
|
|
|
|
'/abc\/def\//.test("abc")',
|
|
|
|
'/abc\/def\//.test("abc")',
|
2013-04-14 23:38:24 +02:00
|
|
|
);
|
2014-10-08 10:53:34 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'var a = /abc\/def\//.test("abc")',
|
|
|
|
'var a=/abc\/def\//.test("abc")',
|
|
|
|
);
|
2014-10-13 10:10:44 +02:00
|
|
|
|
2014-10-10 08:18:47 +02:00
|
|
|
// don't confuse multiple slashes for regexes
|
|
|
|
$tests[] = array(
|
|
|
|
'a = b / c; d = e / f',
|
|
|
|
'a=b/c;d=e/f',
|
|
|
|
);
|
2014-10-08 10:53:34 +02:00
|
|
|
|
2014-10-07 18:21:22 +02:00
|
|
|
// mixture of quotes starting in comment/regex, to make sure strings are
|
|
|
|
// matched correctly, not inside comment/regex.
|
|
|
|
$tests[] = array(
|
|
|
|
'/abc"def/.test("abc")',
|
|
|
|
'/abc"def/.test("abc")',
|
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'/* Bogus " */var test="test";',
|
|
|
|
'var test="test"',
|
|
|
|
);
|
|
|
|
|
2013-12-27 02:12:30 +01:00
|
|
|
// replace comments
|
2013-04-14 23:38:24 +02:00
|
|
|
$tests[] = array(
|
2013-12-26 20:39:10 +01:00
|
|
|
'/* This is a JS comment */',
|
|
|
|
'',
|
2013-04-14 23:38:24 +02:00
|
|
|
);
|
2013-12-01 23:25:52 +01:00
|
|
|
|
2014-10-07 18:21:22 +02:00
|
|
|
// make sure no ; is added in places it shouldn't
|
|
|
|
$tests[] = array(
|
|
|
|
'if(true){}else{}',
|
2015-02-01 12:21:23 -08:00
|
|
|
'if(!0){}else{}',
|
2014-10-07 18:21:22 +02:00
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'do{i++}while(i<1)',
|
|
|
|
'do{i++}while(i<1)',
|
|
|
|
);
|
2014-10-11 02:06:09 +02:00
|
|
|
|
2014-10-07 18:21:22 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'if(true)statement;else statement',
|
2015-02-01 12:21:23 -08:00
|
|
|
'if(!0)statement;else statement',
|
2014-10-07 18:21:22 +02:00
|
|
|
);
|
2014-10-11 02:06:09 +02:00
|
|
|
|
2014-10-07 18:21:22 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'for (i = 0; (i < 10); i++) statement',
|
2014-10-09 09:08:21 +02:00
|
|
|
'for(i=0;(i<10);i++)statement',
|
2014-10-07 18:21:22 +02:00
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'-1
|
|
|
|
+2',
|
|
|
|
'-1+2',
|
|
|
|
);
|
2014-10-14 11:30:23 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'-1+
|
|
|
|
2',
|
|
|
|
'-1+2',
|
|
|
|
);
|
2014-10-07 18:21:22 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'alert("this is a test");',
|
|
|
|
'alert("this is a test")',
|
|
|
|
);
|
|
|
|
|
2014-10-09 09:08:21 +02:00
|
|
|
// test where newline should be preserved (for ASI) or semicolon added
|
2014-10-07 18:21:22 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'function(){console.log("this is a test");}',
|
|
|
|
'function(){console.log("this is a test")}',
|
|
|
|
);
|
2013-12-26 20:39:10 +01:00
|
|
|
$tests[] = array(
|
2013-12-27 02:12:30 +01:00
|
|
|
'alert("this is a test")
|
|
|
|
alert("this is another test")',
|
2014-10-08 09:57:41 +02:00
|
|
|
'alert("this is a test")
|
|
|
|
alert("this is another test")',
|
2013-12-26 20:39:10 +01:00
|
|
|
);
|
|
|
|
$tests[] = array(
|
2013-12-27 02:12:30 +01:00
|
|
|
'a=b+c
|
|
|
|
d=e+f',
|
2014-10-08 09:57:41 +02:00
|
|
|
'a=b+c
|
|
|
|
d=e+f',
|
2013-12-26 23:59:56 +01:00
|
|
|
);
|
2014-10-07 18:21:22 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'a++
|
2013-12-26 23:59:56 +01:00
|
|
|
|
2014-10-07 18:21:22 +02:00
|
|
|
++b',
|
2014-10-08 09:57:41 +02:00
|
|
|
'a++
|
|
|
|
++b',
|
2014-10-07 18:21:22 +02:00
|
|
|
);
|
2013-12-26 23:59:56 +01:00
|
|
|
$tests[] = array(
|
2014-10-07 18:21:22 +02:00
|
|
|
'!a
|
|
|
|
!b',
|
2014-10-08 09:57:41 +02:00
|
|
|
'!a
|
|
|
|
!b',
|
2013-12-26 23:59:56 +01:00
|
|
|
);
|
|
|
|
$tests[] = array(
|
2014-10-07 18:21:22 +02:00
|
|
|
// don't confuse with 'if'
|
|
|
|
'digestif
|
|
|
|
(true)
|
|
|
|
statement',
|
2015-02-01 12:21:23 -08:00
|
|
|
'digestif(!0)
|
2014-10-08 09:57:41 +02:00
|
|
|
statement',
|
2013-12-26 20:39:10 +01:00
|
|
|
);
|
2013-12-27 02:12:30 +01:00
|
|
|
$tests[] = array(
|
2014-10-07 18:21:22 +02:00
|
|
|
'if
|
|
|
|
(
|
|
|
|
(
|
|
|
|
true
|
|
|
|
)
|
|
|
|
&&
|
|
|
|
(
|
|
|
|
true
|
|
|
|
)
|
|
|
|
)
|
|
|
|
statement',
|
2015-02-01 12:21:23 -08:00
|
|
|
'if((!0)&&(!0))
|
2014-10-08 09:57:41 +02:00
|
|
|
statement',
|
2013-12-27 02:12:30 +01:00
|
|
|
);
|
2014-10-07 18:21:22 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'if
|
|
|
|
(
|
|
|
|
true
|
|
|
|
)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
}',
|
2015-02-01 12:21:23 -08:00
|
|
|
'if(!0){}
|
2014-10-08 09:57:41 +02:00
|
|
|
else{}',
|
2014-10-07 18:21:22 +02:00
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'do
|
|
|
|
{
|
|
|
|
i++
|
|
|
|
}
|
|
|
|
while
|
|
|
|
(
|
|
|
|
i<1
|
|
|
|
)',
|
2014-10-08 09:57:41 +02:00
|
|
|
'do{i++}
|
|
|
|
while(i<1)',
|
2014-10-07 18:21:22 +02:00
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'if ( true )
|
|
|
|
statement
|
|
|
|
else
|
|
|
|
statement',
|
2015-02-01 12:21:23 -08:00
|
|
|
'if(!0)
|
2014-10-08 09:57:41 +02:00
|
|
|
statement
|
|
|
|
else statement',
|
2013-12-26 23:59:56 +01:00
|
|
|
);
|
|
|
|
|
2014-10-09 09:08:21 +02:00
|
|
|
// test if whitespace around keywords is properly collapsed
|
|
|
|
$tests[] = array(
|
|
|
|
'var
|
|
|
|
variable
|
|
|
|
=
|
|
|
|
"value";',
|
|
|
|
'var variable="value"',
|
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'var variable = {
|
|
|
|
test:
|
|
|
|
{
|
|
|
|
}
|
|
|
|
}',
|
|
|
|
'var variable={test:{}}',
|
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'if ( true ) {
|
|
|
|
} else {
|
|
|
|
}',
|
2015-02-01 12:21:23 -08:00
|
|
|
'if(!0){}else{}',
|
2014-10-09 09:08:21 +02:00
|
|
|
);
|
2014-10-12 19:41:16 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'53 instanceof String',
|
2015-03-06 13:17:33 +01:00
|
|
|
'53 instanceof String',
|
2014-10-12 19:41:16 +02:00
|
|
|
);
|
2014-10-09 09:08:21 +02:00
|
|
|
|
2013-12-27 02:12:30 +01:00
|
|
|
// remove whitespace around operators
|
|
|
|
$tests[] = array(
|
|
|
|
'a = 1 + 2',
|
|
|
|
'a=1+2',
|
|
|
|
);
|
2014-10-07 18:21:22 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'object . property',
|
|
|
|
'object.property',
|
|
|
|
);
|
2013-12-26 23:59:56 +01:00
|
|
|
$tests[] = array(
|
|
|
|
'object
|
|
|
|
.property',
|
|
|
|
'object.property',
|
|
|
|
);
|
2013-12-27 02:12:30 +01:00
|
|
|
$tests[] = array(
|
|
|
|
'alert ( "this is a test" );',
|
|
|
|
'alert("this is a test")',
|
|
|
|
);
|
2013-12-26 23:59:56 +01:00
|
|
|
|
2014-10-10 08:38:18 +02:00
|
|
|
// mix of ++ and +: three consecutive +es will be interpreted as ++ +
|
|
|
|
$tests[] = array(
|
|
|
|
'a++ +b',
|
2014-10-14 11:30:23 +02:00
|
|
|
'a++ +b',
|
2014-10-10 08:38:18 +02:00
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'a+ ++b',
|
2014-10-14 11:30:23 +02:00
|
|
|
'a+ ++b', // +++ would actually be allowed as well
|
2014-10-10 08:38:18 +02:00
|
|
|
);
|
|
|
|
|
2014-10-11 02:06:09 +02:00
|
|
|
// SyntaxError: identifier starts immediately after numeric literal
|
|
|
|
$tests[] = array(
|
|
|
|
'42 .toString()',
|
|
|
|
'42 .toString()',
|
|
|
|
);
|
|
|
|
|
2014-10-07 18:21:22 +02:00
|
|
|
// add comment in between whitespace that needs to be stripped
|
2013-12-26 23:59:56 +01:00
|
|
|
$tests[] = array(
|
2014-10-07 18:21:22 +02:00
|
|
|
'object
|
|
|
|
// haha, some comment, just to make things harder!
|
|
|
|
.property',
|
|
|
|
'object.property',
|
2013-12-26 23:59:56 +01:00
|
|
|
);
|
|
|
|
|
2015-02-01 12:21:23 -08:00
|
|
|
// add comment in between whitespace that needs to be stripped
|
|
|
|
$tests[] = array(
|
|
|
|
'var test=true,test2=false',
|
|
|
|
'var test=!0,test2=!1',
|
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'var testtrue="testing if true as part of varname is ignored as it should"',
|
|
|
|
'var testtrue="testing if true as part of varname is ignored as it should"',
|
|
|
|
);
|
|
|
|
|
2014-10-09 09:08:21 +02:00
|
|
|
// random bits of code that tripped errors during development
|
2013-12-26 23:59:56 +01:00
|
|
|
$tests[] = array(
|
|
|
|
'
|
2013-12-27 02:12:30 +01:00
|
|
|
// check if it isn\'t a text-element
|
|
|
|
if(currentElement.attr(\'type\') != \'text\')
|
|
|
|
{
|
|
|
|
// remove the current one
|
|
|
|
currentElement.remove();
|
|
|
|
}
|
|
|
|
|
|
|
|
// already a text element
|
|
|
|
else newElement = currentElement;
|
2013-12-26 23:59:56 +01:00
|
|
|
',
|
2014-10-08 09:57:41 +02:00
|
|
|
'if(currentElement.attr(\'type\')!=\'text\'){currentElement.remove()}
|
|
|
|
else newElement=currentElement',
|
2013-12-26 17:04:42 +01:00
|
|
|
);
|
2014-10-07 19:49:16 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'var jsBackend =
|
|
|
|
{
|
|
|
|
debug: false,
|
|
|
|
current: {}
|
|
|
|
}',
|
2015-02-01 12:21:23 -08:00
|
|
|
'var jsBackend={debug:!1,current:{}}',
|
2014-10-07 19:49:16 +02:00
|
|
|
);
|
2014-10-08 09:57:41 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'var utils =
|
|
|
|
{
|
|
|
|
debug: false
|
|
|
|
}
|
|
|
|
utils.array =
|
|
|
|
{
|
|
|
|
}',
|
2015-02-01 12:21:23 -08:00
|
|
|
'var utils={debug:!1}
|
2014-10-08 10:19:33 +02:00
|
|
|
utils.array={}',
|
|
|
|
);
|
2014-10-09 10:56:39 +02:00
|
|
|
$tests[] = array(
|
|
|
|
'rescape = /\'|\\\\/g,
|
|
|
|
|
|
|
|
// blablabla here was some more code but the point was that somewhere
|
|
|
|
// down below, there would be a closing quote which would cause the
|
|
|
|
// regex (confused for escaped closing tag) not to be recognized,
|
|
|
|
// taking the opening single quote & looking for a string.
|
|
|
|
// So here\'s <-- the closing quote
|
|
|
|
runescape = \'blabla\'',
|
|
|
|
'rescape=/\'|\\\\/g,runescape=\'blabla\'',
|
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/)',
|
|
|
|
'var rsingleTag=(/^<(\w+)\s*\/?>(?:<\/\1>|)$/)',
|
|
|
|
);
|
2015-02-02 16:10:30 -08:00
|
|
|
$tests[] = array(
|
|
|
|
'if (this.sliding) return this.$element.one(\'slid.bs.carousel\', function () { that.to(pos) }) // yes, "slid"
|
|
|
|
if (activeIndex == pos) return this.pause().cycle()',
|
|
|
|
'if(this.sliding)return this.$element.one(\'slid.bs.carousel\',function(){that.to(pos)})
|
|
|
|
if(activeIndex==pos)return this.pause().cycle()',
|
|
|
|
);
|
2015-02-02 19:28:35 -08:00
|
|
|
$tests[] = array(
|
|
|
|
'if (e.which == 38 && index > 0) index-- // up
|
|
|
|
if (e.which == 40 && index < $items.length - 1) index++ // down',
|
|
|
|
'if(e.which==38&&index>0)index--
|
|
|
|
if(e.which==40&&index<$items.length-1)index++',
|
|
|
|
);
|
2014-10-08 10:19:33 +02:00
|
|
|
|
2014-12-31 16:07:08 +01:00
|
|
|
// replace associative array key references by property notation
|
|
|
|
$tests[] = array(
|
|
|
|
'array["key"][\'key2\']',
|
|
|
|
'array.key.key2',
|
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'array[ "key" ][ \'key2\' ]',
|
|
|
|
'array.key.key2',
|
|
|
|
);
|
2015-01-11 17:39:46 +01:00
|
|
|
$tests[] = array(
|
|
|
|
'array["a","b","c"]',
|
|
|
|
'array["a","b","c"]',
|
|
|
|
);
|
2015-01-23 08:58:51 -08:00
|
|
|
//
|
|
|
|
$tests[] = array(
|
|
|
|
"['loader']",
|
|
|
|
"['loader']",
|
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
'array["dont-replace"][\'key2\']',
|
|
|
|
'array["dont-replace"].key2',
|
|
|
|
);
|
2014-12-31 16:07:08 +01:00
|
|
|
|
2014-10-09 09:08:21 +02:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/10
|
2014-10-08 10:19:33 +02:00
|
|
|
$tests[] = array(
|
2014-10-09 09:08:21 +02:00
|
|
|
'// first mutation patch
|
|
|
|
// second mutation patch
|
|
|
|
// third mutation patch
|
|
|
|
// fourth mutation patch',
|
|
|
|
'',
|
2014-10-08 10:19:33 +02:00
|
|
|
);
|
|
|
|
$tests[] = array(
|
2014-10-09 09:08:21 +02:00
|
|
|
'/////////////////////////
|
|
|
|
// first mutation patch
|
|
|
|
// second mutation patch
|
|
|
|
// third mutation patch
|
|
|
|
// fourth mutation patch
|
|
|
|
/////////////////////////',
|
|
|
|
'',
|
2014-10-08 09:57:41 +02:00
|
|
|
);
|
|
|
|
|
2014-10-08 10:53:34 +02:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/14
|
|
|
|
$tests[] = array(
|
2014-10-09 08:56:14 +02:00
|
|
|
'function foo (a, b)
|
|
|
|
{
|
2014-10-08 10:53:34 +02:00
|
|
|
return a / b;
|
|
|
|
}
|
2014-10-09 08:56:14 +02:00
|
|
|
function foo (a, b)
|
|
|
|
{
|
2014-10-08 10:53:34 +02:00
|
|
|
return a / b;
|
|
|
|
}',
|
|
|
|
'function foo(a,b){return a/b}
|
|
|
|
function foo(a,b){return a/b}',
|
|
|
|
);
|
|
|
|
|
2014-10-09 09:08:21 +02:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/15
|
|
|
|
$tests[] = array(
|
|
|
|
'if ( !data.success )
|
|
|
|
deferred.reject(); else
|
|
|
|
deferred.resolve(data);',
|
|
|
|
'if(!data.success)
|
|
|
|
deferred.reject();else deferred.resolve(data)',
|
|
|
|
);
|
|
|
|
$tests[] = array(
|
|
|
|
"if ( typeof jQuery === 'undefined' )
|
|
|
|
throw new Error('.editManager.js: jQuery is required and must be loaded first');",
|
|
|
|
"if(typeof jQuery==='undefined')
|
|
|
|
throw new Error('.editManager.js: jQuery is required and must be loaded first')",
|
|
|
|
);
|
|
|
|
|
2015-01-09 11:19:22 +01:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/27
|
|
|
|
$tests[] = array(
|
|
|
|
'$.expr[":"]',
|
|
|
|
'$.expr[":"]',
|
|
|
|
);
|
|
|
|
|
2015-01-23 08:58:51 -08:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/31
|
|
|
|
$tests[] = array(
|
|
|
|
"$(_this).attr('src',this.src).trigger('adapt',['loader'])",
|
|
|
|
"$(_this).attr('src',this.src).trigger('adapt',['loader'])",
|
|
|
|
);
|
|
|
|
|
2015-02-02 15:29:57 -08:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/33
|
|
|
|
$tests[] = array(
|
|
|
|
'$.fn.alert = Plugin
|
|
|
|
$.fn.alert.Constructor = Alert',
|
|
|
|
'$.fn.alert=Plugin
|
|
|
|
$.fn.alert.Constructor=Alert',
|
|
|
|
);
|
|
|
|
|
2015-02-03 18:27:28 +01:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/34
|
|
|
|
$tests[] = array(
|
|
|
|
'a.replace("\\\\","");hi="This is a string"',
|
|
|
|
'a.replace("\\\\","");hi="This is a string"',
|
|
|
|
);
|
|
|
|
|
2015-02-06 11:14:02 +01:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/35
|
|
|
|
$tests[] = array(
|
|
|
|
array(
|
|
|
|
'// script that ends with comment',
|
|
|
|
'var test=1',
|
|
|
|
),
|
|
|
|
'var test=1',
|
|
|
|
);
|
|
|
|
|
2015-02-16 21:12:29 +01:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/37
|
|
|
|
$tests[] = array(
|
|
|
|
'function () { ;;;;;;;; }',
|
|
|
|
'function(){}',
|
|
|
|
);
|
|
|
|
|
2015-02-26 09:07:17 +01:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/40
|
|
|
|
$tests[] = array(
|
|
|
|
"for(v=1,_=b;;){}",
|
|
|
|
"for(v=1,_=b;;){}",
|
|
|
|
);
|
|
|
|
|
2015-02-26 08:41:14 +01:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/41
|
|
|
|
$tests[] = array(
|
|
|
|
"conf.zoomHoverIcons['default']",
|
|
|
|
"conf.zoomHoverIcons['default']",
|
|
|
|
);
|
|
|
|
|
2015-03-10 10:00:28 +01:00
|
|
|
// https://github.com/matthiasmullie/minify/issues/43
|
|
|
|
$tests[] = array(
|
|
|
|
'{"key":"3","key2":"value","key3":"3"}',
|
|
|
|
'{"key":"3","key2":"value","key3":"3"}',
|
|
|
|
);
|
|
|
|
|
2013-04-14 23:38:24 +02:00
|
|
|
return $tests;
|
|
|
|
}
|
|
|
|
}
|