1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-30 09:09:54 +02:00

add testcase for js minify that produces $jscomp polyfills

with recent closure compiler default input language has changed from ES3 to ES6 produces $jscomp polyfills
This commit is contained in:
Elan Ruusamäe
2016-12-06 14:46:46 +02:00
parent b8c79ac8d4
commit 8949df33dd
4 changed files with 38 additions and 1 deletions

View File

@@ -47,4 +47,23 @@ class TestCase extends PHPUnit_Framework_TestCase
$this->assertSame($data, $displayed, "$id display");
$this->assertEquals($data, $cache->fetch($id), "$id fetch");
}
/**
* Read data file, assert that it exists and is not empty.
* As a side effect calls trim() to fight against different Editors that insert or strip final newline.
*
* @param string $filename
* @return string
*/
protected function getDataFile($filename)
{
$path = self::$test_files . '/' . $filename;
$this->assertFileExists($path);
$contents = file_get_contents($path);
$this->assertNotEmpty($contents);
$contents = trim($contents);
$this->assertNotEmpty($contents);
return $contents;
}
}