markTestSkipped('There is no uglifyJs configuration.'); } $this->asset = new FileAsset(__DIR__.'/fixtures/uglifyjs/script.js'); $this->asset->load(); if (isset($_SERVER['NODE_BIN'])) { $this->filter = new UglifyJsFilter($_SERVER['UGLIFYJS_BIN'], $_SERVER['NODE_BIN']); } else { $this->filter = new UglifyJsFilter($_SERVER['UGLIFYJS_BIN']); } } protected function tearDown() { $this->asset = null; $this->filter = null; } public function testUglify() { $this->filter->filterDump($this->asset); $expected = <<assertSame($expected, $this->asset->getContent()); } public function testUnsafeUglify() { $this->filter->setUnsafe(true); $this->filter->filterDump($this->asset); $expected = <<assertSame($expected, $this->asset->getContent()); } public function testBeautifyUglify() { $this->filter->setBeautify(true); $this->filter->filterDump($this->asset); $expected = <<assertSame($expected, $this->asset->getContent()); } public function testNoCopyrightUglify() { $this->filter->setNoCopyright(true); $this->filter->filterDump($this->asset); $expected = 'function bar(a){return var2.push(a),a}var foo=new Array(1,2,3,4),bar=Array(a,b,c),var1=new Array(5),var2=new Array(a),foo=function(a){return a};'; $this->assertSame($expected, $this->asset->getContent()); } }