Permalink
Please sign in to comment.
Showing
with
47 additions
and 0 deletions.
@@ -0,0 +1,36 @@ | ||
+<?php | ||
+ | ||
+/* | ||
+ * This file is part of the Assetic package, an OpenSky project. | ||
+ * | ||
+ * (c) 2010-2011 OpenSky Project Inc | ||
+ * | ||
+ * For the full copyright and license information, please view the LICENSE | ||
+ * file that was distributed with this source code. | ||
+ */ | ||
+ | ||
+namespace Assetic\Test\Filter; | ||
+ | ||
+use Assetic\Asset\FileAsset; | ||
+use Assetic\Filter\PackerFilter; | ||
+ | ||
+class PackerFilterTest extends \PHPUnit_Framework_TestCase | ||
+{ | ||
+ protected function setUp() | ||
+ { | ||
+ if (!class_exists('JavaScriptPacker')) { | ||
+ $this->markTestSkipped('JavaScriptPacker is not installed.'); | ||
+ } | ||
+ } | ||
+ | ||
+ public function testPacker() | ||
+ { | ||
+ $asset = new FileAsset(__DIR__.'/fixtures/packer/example.js'); | ||
+ $asset->load(); | ||
+ | ||
+ $filter = new PackerFilter(); | ||
+ $filter->filterDump($asset); | ||
+ | ||
+ $this->assertEquals("var exampleFunction=function(arg1,arg2){alert('exampleFunction called!')}", $asset->getContent()); | ||
+ } | ||
+} |
@@ -0,0 +1,7 @@ | ||
+/** | ||
+ * Example function | ||
+ */ | ||
+var exampleFunction = function(arg1, arg2) { | ||
+ // Some comment... | ||
+ alert('exampleFunction called!'); | ||
+} |
0 comments on commit
0de70c0