Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/230811

Change subject: Add tedivm/jshrink
......................................................................

Add tedivm/jshrink

Bug: T108702
Change-Id: If3da1baf2488aeebabdacd42f0b285729c146566
---
M composer.json
M composer.lock
M composer/autoload_classmap.php
M composer/autoload_namespaces.php
M composer/installed.json
A tedivm/jshrink/.coveralls.yml
A tedivm/jshrink/.gitignore
A tedivm/jshrink/.travis.yml
A tedivm/jshrink/CONTRIBUTING.md
A tedivm/jshrink/LICENSE
A tedivm/jshrink/README.md
A tedivm/jshrink/composer.json
A tedivm/jshrink/phpunit.xml.dist
A tedivm/jshrink/src/JShrink/Minifier.php
A tedivm/jshrink/tests/JShrink/Test/JShrinkTest.php
A tedivm/jshrink/tests/Resources/development/input/.gitkeep
A tedivm/jshrink/tests/Resources/development/output/.gitkeep
A tedivm/jshrink/tests/Resources/jshrink/input/empty_comment.js
A tedivm/jshrink/tests/Resources/jshrink/input/ending_comment.js
A tedivm/jshrink/tests/Resources/jshrink/input/prefix_increment.js
A tedivm/jshrink/tests/Resources/jshrink/input/preserve-regex.js
A tedivm/jshrink/tests/Resources/jshrink/input/preserve-strings.js
A tedivm/jshrink/tests/Resources/jshrink/input/preserve_license.js
A tedivm/jshrink/tests/Resources/jshrink/input/remove_multiline_comments.js
A tedivm/jshrink/tests/Resources/jshrink/input/remove_oneline_comments.js
A tedivm/jshrink/tests/Resources/jshrink/input/strictmode.js
A tedivm/jshrink/tests/Resources/jshrink/input/utf_chars.js
A tedivm/jshrink/tests/Resources/jshrink/output/empty_comment.js
A tedivm/jshrink/tests/Resources/jshrink/output/ending_comment.js
A tedivm/jshrink/tests/Resources/jshrink/output/prefix_increment.js
A tedivm/jshrink/tests/Resources/jshrink/output/preserve-regex.js
A tedivm/jshrink/tests/Resources/jshrink/output/preserve-strings.js
A tedivm/jshrink/tests/Resources/jshrink/output/preserve_license.js
A tedivm/jshrink/tests/Resources/jshrink/output/remove_multiline_comments.js
A tedivm/jshrink/tests/Resources/jshrink/output/remove_oneline_comments.js
A tedivm/jshrink/tests/Resources/jshrink/output/strictmode.js
A tedivm/jshrink/tests/Resources/jshrink/output/utf_chars.js
A tedivm/jshrink/tests/Resources/minify/input/144.js
A tedivm/jshrink/tests/Resources/minify/input/condcomm.js
A tedivm/jshrink/tests/Resources/minify/input/issue132.js
A tedivm/jshrink/tests/Resources/minify/output/144.js
A tedivm/jshrink/tests/Resources/minify/output/condcomm.js
A tedivm/jshrink/tests/Resources/minify/output/issue132.js
A tedivm/jshrink/tests/Resources/requests/input/.gitkeep
A tedivm/jshrink/tests/Resources/requests/input/ifreturn.js
A tedivm/jshrink/tests/Resources/requests/input/whitespace.js
A tedivm/jshrink/tests/Resources/requests/output/.gitkeep
A tedivm/jshrink/tests/Resources/requests/output/ifreturn.js
A tedivm/jshrink/tests/Resources/requests/output/whitespace.js
A tedivm/jshrink/tests/Resources/uglify/README
A tedivm/jshrink/tests/Resources/uglify/input/array1.js
A tedivm/jshrink/tests/Resources/uglify/input/array2.js
A tedivm/jshrink/tests/Resources/uglify/input/array3.js
A tedivm/jshrink/tests/Resources/uglify/input/array4.js
A tedivm/jshrink/tests/Resources/uglify/input/assignment.js
A tedivm/jshrink/tests/Resources/uglify/input/concatstring.js
A tedivm/jshrink/tests/Resources/uglify/input/empty-blocks.js
A tedivm/jshrink/tests/Resources/uglify/input/forstatement.js
A tedivm/jshrink/tests/Resources/uglify/input/if.js
A tedivm/jshrink/tests/Resources/uglify/input/ifreturn2.js
A tedivm/jshrink/tests/Resources/uglify/input/null_string.js
A tedivm/jshrink/tests/Resources/uglify/input/strict-equals.js
A tedivm/jshrink/tests/Resources/uglify/input/var.js
A tedivm/jshrink/tests/Resources/uglify/input/with.js
A tedivm/jshrink/tests/Resources/uglify/output/array1.js
A tedivm/jshrink/tests/Resources/uglify/output/array2.js
A tedivm/jshrink/tests/Resources/uglify/output/array3.js
A tedivm/jshrink/tests/Resources/uglify/output/array4.js
A tedivm/jshrink/tests/Resources/uglify/output/assignment.js
A tedivm/jshrink/tests/Resources/uglify/output/concatstring.js
A tedivm/jshrink/tests/Resources/uglify/output/empty-blocks.js
A tedivm/jshrink/tests/Resources/uglify/output/forstatement.js
A tedivm/jshrink/tests/Resources/uglify/output/if.js
A tedivm/jshrink/tests/Resources/uglify/output/ifreturn2.js
A tedivm/jshrink/tests/Resources/uglify/output/null_string.js
A tedivm/jshrink/tests/Resources/uglify/output/strict-equals.js
A tedivm/jshrink/tests/Resources/uglify/output/var.js
A tedivm/jshrink/tests/Resources/uglify/output/with.js
A tedivm/jshrink/tests/bootstrap.php
A tedivm/jshrink/tests/runTests.sh
80 files changed, 1,362 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vendor 
refs/changes/11/230811/1

diff --git a/composer.json b/composer.json
index 0cebf5d..3dac321 100644
--- a/composer.json
+++ b/composer.json
@@ -20,6 +20,7 @@
                "php": ">=5.3.3",
                "psr/log": "1.0.0",
                "ruflin/elastica": "2.2.0",
+               "tedivm/jshrink": "1.1.0",
                "wikimedia/assert": "0.2.2",
                "wikimedia/cdb": "1.0.1",
                "wikimedia/composer-merge-plugin": "1.2.1",
diff --git a/composer.lock b/composer.lock
index 27892e3..e1d4863 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at 
https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file";,
         "This file is @generated automatically"
     ],
-    "hash": "3c6847e5f640495db20d818c59775a60",
+    "hash": "5e24d353875d4194c434743968acf162",
     "packages": [
         {
             "name": "composer/semver",
@@ -528,6 +528,52 @@
             "time": "2015-07-01 11:25:50"
         },
         {
+            "name": "tedivm/jshrink",
+            "version": "v1.1.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/tedious/JShrink.git";,
+                "reference": "688527a2e854d7935f24f24c7d5eb1b604742bf9"
+            },
+            "dist": {
+                "type": "zip",
+                "url": 
"https://api.github.com/repos/tedious/JShrink/zipball/688527a2e854d7935f24f24c7d5eb1b604742bf9";,
+                "reference": "688527a2e854d7935f24f24c7d5eb1b604742bf9",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "require-dev": {
+                "fabpot/php-cs-fixer": "0.4.0",
+                "phpunit/phpunit": "4.0.*",
+                "satooshi/php-coveralls": "dev-master"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-0": {
+                    "JShrink": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/";,
+            "license": [
+                "BSD-3-Clause"
+            ],
+            "authors": [
+                {
+                    "name": "Robert Hafner",
+                    "email": "[email protected]"
+                }
+            ],
+            "description": "Javascript Minifier built in PHP",
+            "homepage": "http://github.com/tedious/JShrink";,
+            "keywords": [
+                "javascript",
+                "minifier"
+            ],
+            "time": "2015-07-04 07:35:09"
+        },
+        {
             "name": "wikimedia/assert",
             "version": "v0.2.2",
             "source": {
diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php
index 379054e..f2b17c5 100644
--- a/composer/autoload_classmap.php
+++ b/composer/autoload_classmap.php
@@ -239,6 +239,7 @@
     'Elastica\\Type\\Mapping' => $vendorDir . 
'/ruflin/elastica/lib/Elastica/Type/Mapping.php',
     'Elastica\\Util' => $vendorDir . '/ruflin/elastica/lib/Elastica/Util.php',
     'IPSet\\IPSet' => $vendorDir . '/wikimedia/ip-set/src/IPSet.php',
+    'JShrink\\Minifier' => $vendorDir . 
'/tedivm/jshrink/src/JShrink/Minifier.php',
     'KzykHys\\Pygments\\Pygments' => $vendorDir . 
'/kzykhys/pygments/src/KzykHys/Pygments/Pygments.php',
     'LCRun3' => $vendorDir . '/zordius/lightncandy/src/lightncandy.php',
     'LightnCandy' => $vendorDir . '/zordius/lightncandy/src/lightncandy.php',
diff --git a/composer/autoload_namespaces.php b/composer/autoload_namespaces.php
index 6d89746..6662e68 100644
--- a/composer/autoload_namespaces.php
+++ b/composer/autoload_namespaces.php
@@ -8,5 +8,6 @@
 return array(
     'Psr\\Log\\' => array($vendorDir . '/psr/log'),
     'Liuggio' => array($vendorDir . '/liuggio/statsd-php-client/src'),
+    'JShrink' => array($vendorDir . '/tedivm/jshrink/src'),
     '' => array($vendorDir . '/cssjanus/cssjanus/src', $vendorDir . 
'/kzykhys/pygments/src'),
 );
diff --git a/composer/installed.json b/composer/installed.json
index 1700992..b7583d2 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -865,5 +865,53 @@
         ],
         "description": "Symfony Process Component",
         "homepage": "https://symfony.com";
+    },
+    {
+        "name": "tedivm/jshrink",
+        "version": "v1.1.0",
+        "version_normalized": "1.1.0.0",
+        "source": {
+            "type": "git",
+            "url": "https://github.com/tedious/JShrink.git";,
+            "reference": "688527a2e854d7935f24f24c7d5eb1b604742bf9"
+        },
+        "dist": {
+            "type": "zip",
+            "url": 
"https://api.github.com/repos/tedious/JShrink/zipball/688527a2e854d7935f24f24c7d5eb1b604742bf9";,
+            "reference": "688527a2e854d7935f24f24c7d5eb1b604742bf9",
+            "shasum": ""
+        },
+        "require": {
+            "php": ">=5.3.0"
+        },
+        "require-dev": {
+            "fabpot/php-cs-fixer": "0.4.0",
+            "phpunit/phpunit": "4.0.*",
+            "satooshi/php-coveralls": "dev-master"
+        },
+        "time": "2015-07-04 07:35:09",
+        "type": "library",
+        "installation-source": "dist",
+        "autoload": {
+            "psr-0": {
+                "JShrink": "src/"
+            }
+        },
+        "notification-url": "https://packagist.org/downloads/";,
+        "license": [
+            "BSD-3-Clause"
+        ],
+        "authors": [
+            {
+                "name": "Robert Hafner",
+                "email": "[email protected]"
+            }
+        ],
+        "description": "Javascript Minifier built in PHP",
+        "homepage": "http://github.com/tedious/JShrink";,
+        "keywords": [
+            "javascript",
+            "minifier"
+        ]
     }
 ]
diff --git a/tedivm/jshrink/.coveralls.yml b/tedivm/jshrink/.coveralls.yml
new file mode 100644
index 0000000..cbd906c
--- /dev/null
+++ b/tedivm/jshrink/.coveralls.yml
@@ -0,0 +1,3 @@
+src_dir: src
+coverage_clover: build/logs/clover.xml
+json_path: build/logs/coveralls-upload.json
\ No newline at end of file
diff --git a/tedivm/jshrink/.gitignore b/tedivm/jshrink/.gitignore
new file mode 100644
index 0000000..aaeaf1c
--- /dev/null
+++ b/tedivm/jshrink/.gitignore
@@ -0,0 +1,8 @@
+/.idea
+/.settings
+/.buildpath
+/.project
+/composer.lock
+/vendor
+/report
+/build
\ No newline at end of file
diff --git a/tedivm/jshrink/.travis.yml b/tedivm/jshrink/.travis.yml
new file mode 100644
index 0000000..aaa1779
--- /dev/null
+++ b/tedivm/jshrink/.travis.yml
@@ -0,0 +1,15 @@
+language: php
+
+php:
+    - 5.3
+    - 5.4
+    - 5.5
+    - hhvm
+
+before_script:
+    - composer self-update && composer install --dev
+
+script: ./tests/runTests.sh
+
+after_script:
+    - php vendor/bin/coveralls -v
\ No newline at end of file
diff --git a/tedivm/jshrink/CONTRIBUTING.md b/tedivm/jshrink/CONTRIBUTING.md
new file mode 100644
index 0000000..8fe815a
--- /dev/null
+++ b/tedivm/jshrink/CONTRIBUTING.md
@@ -0,0 +1,54 @@
+# Contributions Welcome!
+
+Pull Requests and Community Contributions are the bread and butter of open 
source software. Every contribution- from bug
+reports to feature requests, typos to full new features- are greatly 
appreciated.
+
+
+## Important Guidelines
+
+* One Item Per Pull Request or Issue. This makes it much easier to review code 
and merge it back in, and prevents issues
+  with one request from blocking another.
+
+* Code Coverage is extremely important, and pull requests are much more likely 
to be accepted if testing is also improved.
+  New code should be properly tested, and all tests must pass.
+
+* Read the LICENSE document and make sure you understand it, because your code 
is going to be released under it.
+
+* Be prepared to make revisions. Don't be discouraged if you're asked to make 
changes, as that is just another step
+  towards refining the code and getting it merged back in.
+
+* Remember to add the relevant documentation, particular the docblock comments.
+
+
+## Code Styling
+
+This project follows the PSR standards set forth by the [PHP Framework Interop 
Group](http://www.php-fig.org/).
+
+* [PSR-0: Class and file naming 
conventions](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md)
+* [PSR-1: Basic coding 
standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md)
+* [PSR-2: Coding style 
guide](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
+
+All code most follow these standards to be accepted. The easiest way to 
accomplish this is to run php-cs-fixer once the
+new changes are finished. The php-cs-fixer package is installed as a 
development dependency of this project.
+
+    composer install --dev
+    vendor/bin/php-cs-fixer fix ./ --level="all" -vv
+
+
+## Running the test suite
+
+First install dependencies using Composer. It's important to include the dev 
packages:
+
+    composer install --dev
+
+The "runTests.sh" script runs the full test suite- phpunit, php-cs-fixer, as 
well as any environmental setup:
+
+    tests/runTests.sh
+
+To call phpunit directly:
+
+    vendor/bin/phpunit
+
+To call php-cs-fixer directly:
+
+    vendor/bin/php-cs-fixer fix ./ --level="all" -vv --dry-run
diff --git a/tedivm/jshrink/LICENSE b/tedivm/jshrink/LICENSE
new file mode 100644
index 0000000..68caa37
--- /dev/null
+++ b/tedivm/jshrink/LICENSE
@@ -0,0 +1,24 @@
+Copyright (c) 2009, Robert Hafner
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of the Stash Project nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Robert Hafner BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/tedivm/jshrink/README.md b/tedivm/jshrink/README.md
new file mode 100644
index 0000000..940af38
--- /dev/null
+++ b/tedivm/jshrink/README.md
@@ -0,0 +1,61 @@
+# JShrink [![Build 
Status](https://travis-ci.org/tedious/JShrink.svg?branch=master)](https://travis-ci.org/tedivm/JShrink)
+
+[![License](http://img.shields.io/packagist/l/tedivm/JShrink.svg)](https://github.com/tedivm/JShrink/blob/master/LICENSE)
+[![Latest Stable 
Version](http://img.shields.io/github/release/tedious/JShrink.svg)](https://packagist.org/packages/tedivm/JShrink)
+[![Coverage 
Status](https://coveralls.io/repos/tedious/JShrink/badge.png?branch=master)](https://coveralls.io/r/tedivm/JShrink?branch=master)
+[![Total 
Downloads](http://img.shields.io/packagist/dt/tedivm/jshrink.svg)](https://packagist.org/packages/tedivm/JShrink)
+
+
+JShrink is a php class that minifies javascript so that it can be delivered to 
the client quicker. This code can be used
+by any product looking to minify their javascript on the fly (although caching 
the results is suggested for performance
+reasons). Unlike many other products this is not a port into php but a native 
application, resulting in better
+performance.
+
+
+## Usage
+
+Minifying your code is simple call to a static function-
+
+```php
+<?php
+include('vendor/autoload.php');
+
+// Basic (default) usage.
+$minifiedCode = \JShrink\Minifier::minify($js);
+
+// Disable YUI style comment preservation.
+$minifiedCode = \JShrink\Minifier::minify($js, array('flaggedComments' => 
false));
+```
+
+
+## Results
+
+* Raw - 586,990
+* Gzip - 151,301
+* JShrink - 371,982
+* JShrink and Gzip - 93,507
+
+
+## Installing
+
+### Composer
+
+Installing JShrink can be done through a variety of methods, although Composer 
is
+recommended.
+
+```yaml
+"require": {
+  "tedivm/jshrink": "~1.0"
+}
+```
+
+### Github
+
+Releases of JShrink are available on 
[Github](https://github.com/tedious/JShrink/releases).
+
+
+## License
+
+JShrink is licensed under the BSD License. See the LICENSE file for details.
+
+In the spirit of open source, use of this library for evil is discouraged but 
not prohibited.
diff --git a/tedivm/jshrink/composer.json b/tedivm/jshrink/composer.json
new file mode 100644
index 0000000..b2778b8
--- /dev/null
+++ b/tedivm/jshrink/composer.json
@@ -0,0 +1,25 @@
+{
+  "name": "tedivm/jshrink",
+  "description": "Javascript Minifier built in PHP",
+  "keywords": ["minifier","javascript"],
+  "homepage": "http://github.com/tedious/JShrink";,
+  "type": "library",
+  "license": "BSD-3-Clause",
+  "authors": [
+    {
+      "name": "Robert Hafner",
+      "email": "[email protected]"
+    }
+  ],
+  "require": {
+    "php": ">=5.3.0"
+  },
+  "require-dev": {
+      "phpunit/phpunit": "4.0.*",
+      "fabpot/php-cs-fixer": "0.4.0",
+      "satooshi/php-coveralls": "dev-master"
+  },
+  "autoload": {
+    "psr-0": {"JShrink": "src/"}
+  }
+}
diff --git a/tedivm/jshrink/phpunit.xml.dist b/tedivm/jshrink/phpunit.xml.dist
new file mode 100644
index 0000000..72c6470
--- /dev/null
+++ b/tedivm/jshrink/phpunit.xml.dist
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<phpunit bootstrap="./tests/bootstrap.php" colors="true">
+    <testsuites>
+        <testsuite name="JShrink Test Suite">
+            <directory suffix="Test.php">./tests/JShrink/</directory>
+        </testsuite>
+    </testsuites>
+    <groups>
+        <exclude>
+            <group>requests</group>
+            <group>development</group>
+        </exclude>
+    </groups>
+    <filter>
+        <whitelist>
+            <directory suffix=".php">./src/JShrink/</directory>
+        </whitelist>
+    </filter>
+    <logging>
+        <log type="coverage-text" target="php://stdout" 
showUncoveredFiles="false"/>
+    </logging>
+</phpunit>
diff --git a/tedivm/jshrink/src/JShrink/Minifier.php 
b/tedivm/jshrink/src/JShrink/Minifier.php
new file mode 100644
index 0000000..86734da
--- /dev/null
+++ b/tedivm/jshrink/src/JShrink/Minifier.php
@@ -0,0 +1,587 @@
+<?php
+/*
+ * This file is part of the JShrink package.
+ *
+ * (c) Robert Hafner <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/**
+ * JShrink
+ *
+ *
+ * @package    JShrink
+ * @author     Robert Hafner <[email protected]>
+ */
+
+namespace JShrink;
+
+/**
+ * Minifier
+ *
+ * Usage - Minifier::minify($js);
+ * Usage - Minifier::minify($js, $options);
+ * Usage - Minifier::minify($js, array('flaggedComments' => false));
+ *
+ * @package JShrink
+ * @author Robert Hafner <[email protected]>
+ * @license http://www.opensource.org/licenses/bsd-license.php  BSD License
+ */
+class Minifier
+{
+    /**
+     * The input javascript to be minified.
+     *
+     * @var string
+     */
+    protected $input;
+
+    /**
+     * The location of the character (in the input string) that is next to be
+     * processed.
+     *
+     * @var int
+     */
+    protected $index = 0;
+
+    /**
+     * The first of the characters currently being looked at.
+     *
+     * @var string
+     */
+    protected $a = '';
+
+    /**
+     * The next character being looked at (after a);
+     *
+     * @var string
+     */
+    protected $b = '';
+
+    /**
+     * This character is only active when certain look ahead actions take 
place.
+     *
+     *  @var string
+     */
+    protected $c;
+
+    /**
+     * Contains the options for the current minification process.
+     *
+     * @var array
+     */
+    protected $options;
+
+    /**
+     * Contains the default options for minification. This array is merged with
+     * the one passed in by the user to create the request specific set of
+     * options (stored in the $options attribute).
+     *
+     * @var array
+     */
+    protected static $defaultOptions = array('flaggedComments' => true);
+
+    /**
+     * Contains lock ids which are used to replace certain code patterns and
+     * prevent them from being minified
+     *
+     * @var array
+     */
+    protected $locks = array();
+
+    /**
+     * Takes a string containing javascript and removes unneeded characters in
+     * order to shrink the code without altering it's functionality.
+     *
+     * @param  string      $js      The raw javascript to be minified
+     * @param  array       $options Various runtime options in an associative 
array
+     * @throws \Exception
+     * @return bool|string
+     */
+    public static function minify($js, $options = array())
+    {
+        try {
+            ob_start();
+
+            $jshrink = new Minifier();
+            $js = $jshrink->lock($js);
+            $jshrink->minifyDirectToOutput($js, $options);
+
+            // Sometimes there's a leading new line, so we trim that out here.
+            $js = ltrim(ob_get_clean());
+            $js = $jshrink->unlock($js);
+            unset($jshrink);
+
+            return $js;
+
+        } catch (\Exception $e) {
+
+            if (isset($jshrink)) {
+                // Since the breakdownScript function probably wasn't finished
+                // we clean it out before discarding it.
+                $jshrink->clean();
+                unset($jshrink);
+            }
+
+            // without this call things get weird, with partially outputted js.
+            ob_end_clean();
+            throw $e;
+        }
+    }
+
+    /**
+     * Processes a javascript string and outputs only the required characters,
+     * stripping out all unneeded characters.
+     *
+     * @param string $js      The raw javascript to be minified
+     * @param array  $options Various runtime options in an associative array
+     */
+    protected function minifyDirectToOutput($js, $options)
+    {
+        $this->initialize($js, $options);
+        $this->loop();
+        $this->clean();
+    }
+
+    /**
+     *  Initializes internal variables, normalizes new lines,
+     *
+     * @param string $js      The raw javascript to be minified
+     * @param array  $options Various runtime options in an associative array
+     */
+    protected function initialize($js, $options)
+    {
+        $this->options = array_merge(static::$defaultOptions, $options);
+        $js = str_replace("\r\n", "\n", $js);
+        $js = str_replace('/**/', '', $js);
+        $this->input = str_replace("\r", "\n", $js);
+
+        // We add a newline to the end of the script to make it easier to deal
+        // with comments at the bottom of the script- this prevents the 
unclosed
+        // comment error that can otherwise occur.
+        $this->input .= PHP_EOL;
+
+        // Populate "a" with a new line, "b" with the first character, before
+        // entering the loop
+        $this->a = "\n";
+        $this->b = $this->getReal();
+    }
+
+    /**
+     * The primary action occurs here. This function loops through the input 
string,
+     * outputting anything that's relevant and discarding anything that is not.
+     */
+    protected function loop()
+    {
+        while ($this->a !== false && !is_null($this->a) && $this->a !== '') {
+
+            switch ($this->a) {
+                // new lines
+                case "\n":
+                    // if the next line is something that can't stand alone 
preserve the newline
+                    if (strpos('(-+{[@', $this->b) !== false) {
+                        echo $this->a;
+                        $this->saveString();
+                        break;
+                    }
+
+                    // if B is a space we skip the rest of the switch block 
and go down to the
+                    // string/regex check below, resetting $this->b with 
getReal
+                    if($this->b === ' ')
+                        break;
+
+                // otherwise we treat the newline like a space
+
+                case ' ':
+                    if(static::isAlphaNumeric($this->b))
+                        echo $this->a;
+
+                    $this->saveString();
+                    break;
+
+                default:
+                    switch ($this->b) {
+                        case "\n":
+                            if (strpos('}])+-"\'', $this->a) !== false) {
+                                echo $this->a;
+                                $this->saveString();
+                                break;
+                            } else {
+                                if (static::isAlphaNumeric($this->a)) {
+                                    echo $this->a;
+                                    $this->saveString();
+                                }
+                            }
+                            break;
+
+                        case ' ':
+                            if(!static::isAlphaNumeric($this->a))
+                                break;
+
+                        default:
+                            // check for some regex that breaks stuff
+                            if ($this->a === '/' && ($this->b === '\'' || 
$this->b === '"')) {
+                                $this->saveRegex();
+                                continue;
+                            }
+
+                            echo $this->a;
+                            $this->saveString();
+                            break;
+                    }
+            }
+
+            // do reg check of doom
+            $this->b = $this->getReal();
+
+            if(($this->b == '/' && strpos('(,=:[!&|?', $this->a) !== false))
+                $this->saveRegex();
+        }
+    }
+
+    /**
+     * Resets attributes that do not need to be stored between requests so that
+     * the next request is ready to go. Another reason for this is to make sure
+     * the variables are cleared and are not taking up memory.
+     */
+    protected function clean()
+    {
+        unset($this->input);
+        $this->index = 0;
+        $this->a = $this->b = '';
+        unset($this->c);
+        unset($this->options);
+    }
+
+    /**
+     * Returns the next string for processing based off of the current index.
+     *
+     * @return string
+     */
+    protected function getChar()
+    {
+        // Check to see if we had anything in the look ahead buffer and use 
that.
+        if (isset($this->c)) {
+            $char = $this->c;
+            unset($this->c);
+
+        // Otherwise we start pulling from the input.
+        } else {
+            $char = substr($this->input, $this->index, 1);
+
+            // If the next character doesn't exist return false.
+            if (isset($char) && $char === false) {
+                return false;
+            }
+
+            // Otherwise increment the pointer and use this char.
+            $this->index++;
+        }
+
+        // Normalize all whitespace except for the newline character into a
+        // standard space.
+        if($char !== "\n" && ord($char) < 32)
+
+            return ' ';
+
+        return $char;
+    }
+
+    /**
+     * This function gets the next "real" character. It is essentially a 
wrapper
+     * around the getChar function that skips comments. This has significant
+     * performance benefits as the skipping is done using native functions (ie,
+     * c code) rather than in script php.
+     *
+     *
+     * @return string            Next 'real' character to be processed.
+     * @throws \RuntimeException
+     */
+    protected function getReal()
+    {
+        $startIndex = $this->index;
+        $char = $this->getChar();
+
+        // Check to see if we're potentially in a comment
+        if ($char !== '/') {
+            return $char;
+        }
+
+        $this->c = $this->getChar();
+
+        if ($this->c === '/') {
+            return $this->processOneLineComments($startIndex);
+
+        } elseif ($this->c === '*') {
+            return $this->processMultiLineComments($startIndex);
+        }
+
+        return $char;
+    }
+
+    /**
+     * Removed one line comments, with the exception of some very specific 
types of
+     * conditional comments.
+     *
+     * @param  int    $startIndex The index point where "getReal" function 
started
+     * @return string
+     */
+    protected function processOneLineComments($startIndex)
+    {
+        $thirdCommentString = substr($this->input, $this->index, 1);
+
+        // kill rest of line
+        $this->getNext("\n");
+
+        if ($thirdCommentString == '@') {
+            $endPoint = $this->index - $startIndex;
+            unset($this->c);
+            $char = "\n" . substr($this->input, $startIndex, $endPoint);
+        } else {
+            // first one is contents of $this->c
+            $this->getChar();
+            $char = $this->getChar();
+        }
+
+        return $char;
+    }
+
+    /**
+     * Skips multiline comments where appropriate, and includes them where 
needed.
+     * Conditional comments and "license" style blocks are preserved.
+     *
+     * @param  int               $startIndex The index point where "getReal" 
function started
+     * @return bool|string       False if there's no character
+     * @throws \RuntimeException Unclosed comments will throw an error
+     */
+    protected function processMultiLineComments($startIndex)
+    {
+        $this->getChar(); // current C
+        $thirdCommentString = $this->getChar();
+
+        // kill everything up to the next */ if it's there
+        if ($this->getNext('*/')) {
+
+            $this->getChar(); // get *
+            $this->getChar(); // get /
+            $char = $this->getChar(); // get next real character
+
+            // Now we reinsert conditional comments and YUI-style licensing 
comments
+            if (($this->options['flaggedComments'] && $thirdCommentString === 
'!')
+                || ($thirdCommentString === '@') ) {
+
+                // If conditional comments or flagged comments are not the 
first thing in the script
+                // we need to echo a and fill it with a space before moving on.
+                if ($startIndex > 0) {
+                    echo $this->a;
+                    $this->a = " ";
+
+                    // If the comment started on a new line we let it stay on 
the new line
+                    if ($this->input[($startIndex - 1)] === "\n") {
+                        echo "\n";
+                    }
+                }
+
+                $endPoint = ($this->index - 1) - $startIndex;
+                echo substr($this->input, $startIndex, $endPoint);
+
+                return $char;
+            }
+
+        } else {
+            $char = false;
+        }
+
+        if($char === false)
+            throw new \RuntimeException('Unclosed multiline comment at 
position: ' . ($this->index - 2));
+
+        // if we're here c is part of the comment and therefore tossed
+        if(isset($this->c))
+            unset($this->c);
+
+        return $char;
+    }
+
+    /**
+     * Pushes the index ahead to the next instance of the supplied string. If 
it
+     * is found the first character of the string is returned and the index is 
set
+     * to it's position.
+     *
+     * @param  string       $string
+     * @return string|false Returns the first character of the string or false.
+     */
+    protected function getNext($string)
+    {
+        // Find the next occurrence of "string" after the current position.
+        $pos = strpos($this->input, $string, $this->index);
+
+        // If it's not there return false.
+        if($pos === false)
+
+            return false;
+
+        // Adjust position of index to jump ahead to the asked for string
+        $this->index = $pos;
+
+        // Return the first character of that string.
+        return substr($this->input, $this->index, 1);
+    }
+
+    /**
+     * When a javascript string is detected this function crawls for the end of
+     * it and saves the whole string.
+     *
+     * @throws \RuntimeException Unclosed strings will throw an error
+     */
+    protected function saveString()
+    {
+        $startpos = $this->index;
+
+        // saveString is always called after a gets cleared, so we push b into
+        // that spot.
+        $this->a = $this->b;
+
+        // If this isn't a string we don't need to do anything.
+        if ($this->a !== "'" && $this->a !== '"') {
+            return;
+        }
+
+        // String type is the quote used, " or '
+        $stringType = $this->a;
+
+        // Echo out that starting quote
+        echo $this->a;
+
+        // Loop until the string is done
+        while (true) {
+
+            // Grab the very next character and load it into a
+            $this->a = $this->getChar();
+
+            switch ($this->a) {
+
+                // If the string opener (single or double quote) is used
+                // output it and break out of the while loop-
+                // The string is finished!
+                case $stringType:
+                    break 2;
+
+                // New lines in strings without line delimiters are bad- actual
+                // new lines will be represented by the string \n and not the 
actual
+                // character, so those will be treated just fine using the 
switch
+                // block below.
+                case "\n":
+                    throw new \RuntimeException('Unclosed string at position: 
' . $startpos );
+                    break;
+
+                // Escaped characters get picked up here. If it's an escaped 
new line it's not really needed
+                case '\\':
+
+                    // a is a slash. We want to keep it, and the next 
character,
+                    // unless it's a new line. New lines as actual strings 
will be
+                    // preserved, but escaped new lines should be reduced.
+                    $this->b = $this->getChar();
+
+                    // If b is a new line we discard a and b and restart the 
loop.
+                    if ($this->b === "\n") {
+                        break;
+                    }
+
+                    // echo out the escaped character and restart the loop.
+                    echo $this->a . $this->b;
+                    break;
+
+
+                // Since we're not dealing with any special cases we simply
+                // output the character and continue our loop.
+                default:
+                    echo $this->a;
+            }
+        }
+    }
+
+    /**
+     * When a regular expression is detected this function crawls for the end 
of
+     * it and saves the whole regex.
+     *
+     * @throws \RuntimeException Unclosed regex will throw an error
+     */
+    protected function saveRegex()
+    {
+        echo $this->a . $this->b;
+
+        while (($this->a = $this->getChar()) !== false) {
+            if($this->a === '/')
+                break;
+
+            if ($this->a === '\\') {
+                echo $this->a;
+                $this->a = $this->getChar();
+            }
+
+            if($this->a === "\n")
+                throw new \RuntimeException('Unclosed regex pattern at 
position: ' . $this->index);
+
+            echo $this->a;
+        }
+        $this->b = $this->getReal();
+    }
+
+    /**
+     * Checks to see if a character is alphanumeric.
+     *
+     * @param  string $char Just one character
+     * @return bool
+     */
+    protected static function isAlphaNumeric($char)
+    {
+        return preg_match('/^[\w\$\pL]$/', $char) === 1 || $char == '/';
+    }
+
+    /**
+     * Replace patterns in the given string and store the replacement
+     *
+     * @param  string $js The string to lock
+     * @return bool
+     */
+    protected function lock($js)
+    {
+        /* lock things like <code>"asd" + ++x;</code> */
+        $lock = '"LOCK---' . crc32(time()) . '"';
+
+        $matches = array();
+        preg_match('/([+-])(\s+)([+-])/S', $js, $matches);
+        if (empty($matches)) {
+            return $js;
+        }
+
+        $this->locks[$lock] = $matches[2];
+
+        $js = preg_replace('/([+-])\s+([+-])/S', "$1{$lock}$2", $js);
+        /* -- */
+
+        return $js;
+    }
+
+    /**
+     * Replace "locks" with the original characters
+     *
+     * @param  string $js The string to unlock
+     * @return bool
+     */
+    protected function unlock($js)
+    {
+        if (empty($this->locks)) {
+            return $js;
+        }
+
+        foreach ($this->locks as $lock => $replacement) {
+            $js = str_replace($lock, $replacement, $js);
+        }
+
+        return $js;
+    }
+
+}
diff --git a/tedivm/jshrink/tests/JShrink/Test/JShrinkTest.php 
b/tedivm/jshrink/tests/JShrink/Test/JShrinkTest.php
new file mode 100644
index 0000000..0f89fa5
--- /dev/null
+++ b/tedivm/jshrink/tests/JShrink/Test/JShrinkTest.php
@@ -0,0 +1,137 @@
+<?php
+
+/*
+ * This file is part of the JShrink package.
+ *
+ * (c) Robert Hafner <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace JShrink\Test;
+
+use JShrink\Minifier;
+
+class JShrinkTest extends \PHPUnit_Framework_TestCase
+{
+    /**
+     * @expectedException RuntimeException
+     * @expectedExceptionMessage Unclosed multiline comment at position: 1
+     */
+    public function testUnclosedCommentException()
+    {
+        \JShrink\Minifier::minify('/* This comment is hanging out.');
+    }
+
+    /**
+     * @expectedException RuntimeException
+     * @expectedExceptionMessage Unclosed string at position: 14
+     */
+    public function testUnclosedStringException()
+    {
+        \JShrink\Minifier::minify('var string = "This string is hanging out.');
+    }
+
+    /**
+     * @expectedException RuntimeException
+     * @expectedExceptionMessage Unclosed regex pattern at position: 23
+     */
+    public function testUnclosedRegexException()
+    {
+        \JShrink\Minifier::minify('var re = /[^A-Za-z0-9_
+        var string = "Another Filler"');
+    }
+
+    /**
+     * @jshrink
+     * @dataProvider JShrinkProvider
+     */
+    public function testJShrink($testName, $input, $output)
+    {
+        $this->assertEquals($output, \JShrink\Minifier::minify($input), 
'Running JShrink Test: ' . $testName);
+    }
+
+    /**
+     * @uglify
+     * @dataProvider uglifyProvider
+     */
+    public function testUglify($testName, $input, $output)
+    {
+        $this->assertEquals($output, \JShrink\Minifier::minify($input), 
'Running Uglify Test: ' . $testName);
+    }
+
+    /**
+     * @group requests
+     * @dataProvider requestProvider
+     */
+    public function testRequests($testName, $input, $output)
+    {
+        $this->assertEquals($output, \JShrink\Minifier::minify($input), 
'Running User Requested Test: ' . $testName);
+    }
+
+    /**
+     * @group development
+     * @dataProvider developmentProvider
+     */
+    public function testDevelopment($testName, $input, $output)
+    {
+        $this->assertEquals($output, \JShrink\Minifier::minify($input), 
'Running Development Test: ' . $testName);
+    }
+
+    /**
+     * This function loads all of the test cases from the specified group.
+     * Groups are created simply by populating the appropriate directories:
+     *
+     *    /tests/Resources/GROUPNAME/input/
+     *    /tests/Resources/GROUPNAME/output/
+     *
+     * Each test case should have two identically named files, with the raw
+     * javascript going in the test folder and the expected results to be in
+     * the output folder.
+     *
+     * @param $group string
+     * @return array
+     */
+    public function getTestFiles($group)
+    {
+        $baseDir = __DIR__ . '/../../Resources/' . $group . '/';
+        $testDir = $baseDir . 'input/';
+        $expectDir = $baseDir . 'output/';
+
+        $returnData = array();
+
+        $testFiles = scandir($testDir);
+        foreach ($testFiles as $testFile) {
+            if(substr($testFile, -3) !== '.js' || !file_exists(($expectDir . 
$testFile)))
+                continue;
+
+            $testInput = file_get_contents($testDir . $testFile);
+            $testOutput = file_get_contents($expectDir . $testFile);
+
+            $returnData[] = array($testFile, $testInput, $testOutput);
+        }
+
+        return $returnData;
+    }
+
+    public function uglifyProvider()
+    {
+        return $this->getTestFiles('uglify');
+    }
+
+    public function JShrinkProvider()
+    {
+        return $this->getTestFiles('jshrink');
+    }
+
+    public function requestProvider()
+    {
+        return $this->getTestFiles('requests');
+    }
+
+    public function developmentProvider()
+    {
+        return $this->getTestFiles('development');
+    }
+}
diff --git a/tedivm/jshrink/tests/Resources/development/input/.gitkeep 
b/tedivm/jshrink/tests/Resources/development/input/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/development/input/.gitkeep
diff --git a/tedivm/jshrink/tests/Resources/development/output/.gitkeep 
b/tedivm/jshrink/tests/Resources/development/output/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/development/output/.gitkeep
diff --git a/tedivm/jshrink/tests/Resources/jshrink/input/empty_comment.js 
b/tedivm/jshrink/tests/Resources/jshrink/input/empty_comment.js
new file mode 100644
index 0000000..540aed4
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/input/empty_comment.js
@@ -0,0 +1,3 @@
+/**/
+var test;
+/**/
diff --git a/tedivm/jshrink/tests/Resources/jshrink/input/ending_comment.js 
b/tedivm/jshrink/tests/Resources/jshrink/input/ending_comment.js
new file mode 100644
index 0000000..7a00154
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/input/ending_comment.js
@@ -0,0 +1 @@
+var sth = "sth"; //comment
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/input/prefix_increment.js 
b/tedivm/jshrink/tests/Resources/jshrink/input/prefix_increment.js
new file mode 100644
index 0000000..6ba9699
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/input/prefix_increment.js
@@ -0,0 +1 @@
+do{div.innerHTML="<!--[if gt IE " + ++v + "]><![endif]-->"} while(1)
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/input/preserve-regex.js 
b/tedivm/jshrink/tests/Resources/jshrink/input/preserve-regex.js
new file mode 100644
index 0000000..0a99de5
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/input/preserve-regex.js
@@ -0,0 +1,2 @@
+var re =  /[^A-Za-z0-9_\\]/
+var string = "Just a filler string";
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/input/preserve-strings.js 
b/tedivm/jshrink/tests/Resources/jshrink/input/preserve-strings.js
new file mode 100644
index 0000000..393818c
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/input/preserve-strings.js
@@ -0,0 +1,9 @@
+var test = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+
+var test = 
"abcdefg\"hijklmnopqrst\"uvwxyzABCDEFGHIJKLMNO\"PQRSTUVWXYZ0123456789";
+
+
+
+var test = "abcdefghij\
+klmnopqrstuvwxyzABCD \
+EFGHIJKLMNOPQRSTUVWXYZ0123456789";
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/input/preserve_license.js 
b/tedivm/jshrink/tests/Resources/jshrink/input/preserve_license.js
new file mode 100644
index 0000000..933e41a
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/input/preserve_license.js
@@ -0,0 +1,11 @@
+/*!
+ This comment should be preserved.
+ */
+
+var test;
+var test;
+/*!
+ This comment should be preserved.
+ */
+
+var test;
\ No newline at end of file
diff --git 
a/tedivm/jshrink/tests/Resources/jshrink/input/remove_multiline_comments.js 
b/tedivm/jshrink/tests/Resources/jshrink/input/remove_multiline_comments.js
new file mode 100644
index 0000000..397fc4d
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/input/remove_multiline_comments.js
@@ -0,0 +1,25 @@
+/* This line should not be there later. */
+
+var test;
+var test;
+var test;
+
+/*
+ Neither should this one.
+*/
+
+var test;
+var test;
+
+        /*
+         Or this one.
+         */
+
+var test;
+
+
+/**
+ *
+ * Even if this one is special!
+ *
+ */
\ No newline at end of file
diff --git 
a/tedivm/jshrink/tests/Resources/jshrink/input/remove_oneline_comments.js 
b/tedivm/jshrink/tests/Resources/jshrink/input/remove_oneline_comments.js
new file mode 100644
index 0000000..26b3e99
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/input/remove_oneline_comments.js
@@ -0,0 +1,13 @@
+// This line should not be there later.
+
+var test;
+var test;
+var test;
+
+// Neither should this one.
+var test;
+var test;
+
+           // Or this one.
+
+var test;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/input/strictmode.js 
b/tedivm/jshrink/tests/Resources/jshrink/input/strictmode.js
new file mode 100644
index 0000000..bc0bbbc
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/input/strictmode.js
@@ -0,0 +1,2 @@
+"use strict";
+var foo=22;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/input/utf_chars.js 
b/tedivm/jshrink/tests/Resources/jshrink/input/utf_chars.js
new file mode 100644
index 0000000..dd9dc8f
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/input/utf_chars.js
@@ -0,0 +1,11 @@
+var π = Math.PI,
+    ε = 1e-6,
+    radians = π / 180,
+    degrees = 180 / π;
+
+function sgn(x) {
+
+
+    var π = Math.PI;
+    return x > 0 ? 1 : x < 0 ? -1 : 0;
+}
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/output/empty_comment.js 
b/tedivm/jshrink/tests/Resources/jshrink/output/empty_comment.js
new file mode 100644
index 0000000..12e63df
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/output/empty_comment.js
@@ -0,0 +1 @@
+var test;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/output/ending_comment.js 
b/tedivm/jshrink/tests/Resources/jshrink/output/ending_comment.js
new file mode 100644
index 0000000..9b22524
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/output/ending_comment.js
@@ -0,0 +1 @@
+var sth="sth";
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/output/prefix_increment.js 
b/tedivm/jshrink/tests/Resources/jshrink/output/prefix_increment.js
new file mode 100644
index 0000000..c844682
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/output/prefix_increment.js
@@ -0,0 +1 @@
+do{div.innerHTML="<!--[if gt IE "+ ++v+"]><![endif]-->"}while(1)
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/output/preserve-regex.js 
b/tedivm/jshrink/tests/Resources/jshrink/output/preserve-regex.js
new file mode 100644
index 0000000..bcf9803
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/output/preserve-regex.js
@@ -0,0 +1,2 @@
+var re=/[^A-Za-z0-9_\\]/
+var string="Just a filler string";
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/output/preserve-strings.js 
b/tedivm/jshrink/tests/Resources/jshrink/output/preserve-strings.js
new file mode 100644
index 0000000..88f989d
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/output/preserve-strings.js
@@ -0,0 +1 @@
+var test="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";var 
test="abcdefg\"hijklmnopqrst\"uvwxyzABCDEFGHIJKLMNO\"PQRSTUVWXYZ0123456789";var 
test="abcdefghijklmnopqrstuvwxyzABCD EFGHIJKLMNOPQRSTUVWXYZ0123456789";
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/output/preserve_license.js 
b/tedivm/jshrink/tests/Resources/jshrink/output/preserve_license.js
new file mode 100644
index 0000000..dc7c751
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/output/preserve_license.js
@@ -0,0 +1,8 @@
+/*!
+ This comment should be preserved.
+ */
+var test;var test;
+/*!
+ This comment should be preserved.
+ */
+var test;
\ No newline at end of file
diff --git 
a/tedivm/jshrink/tests/Resources/jshrink/output/remove_multiline_comments.js 
b/tedivm/jshrink/tests/Resources/jshrink/output/remove_multiline_comments.js
new file mode 100644
index 0000000..ce9859b
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/output/remove_multiline_comments.js
@@ -0,0 +1 @@
+var test;var test;var test;var test;var test;var test;
\ No newline at end of file
diff --git 
a/tedivm/jshrink/tests/Resources/jshrink/output/remove_oneline_comments.js 
b/tedivm/jshrink/tests/Resources/jshrink/output/remove_oneline_comments.js
new file mode 100644
index 0000000..ce9859b
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/output/remove_oneline_comments.js
@@ -0,0 +1 @@
+var test;var test;var test;var test;var test;var test;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/output/strictmode.js 
b/tedivm/jshrink/tests/Resources/jshrink/output/strictmode.js
new file mode 100644
index 0000000..5f5a6ca
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/output/strictmode.js
@@ -0,0 +1 @@
+"use strict";var foo=22;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/jshrink/output/utf_chars.js 
b/tedivm/jshrink/tests/Resources/jshrink/output/utf_chars.js
new file mode 100644
index 0000000..7efc0e8
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/jshrink/output/utf_chars.js
@@ -0,0 +1 @@
+var π=Math.PI,ε=1e-6,radians=π/ 180,degrees=180 / π;function sgn(x){var 
π=Math.PI;return x>0?1:x<0?-1:0;}
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/minify/input/144.js 
b/tedivm/jshrink/tests/Resources/minify/input/144.js
new file mode 100644
index 0000000..204911d
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/minify/input/144.js
@@ -0,0 +1,9 @@
+a    /  ++b;
+a    *  --b;
+a++  -  b;
+a    +  --b;
+a    -  ++b;
+a    +  -b;
+a    +  ++b;
+a    +  --b;
+a    -  --b;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/minify/input/condcomm.js 
b/tedivm/jshrink/tests/Resources/minify/input/condcomm.js
new file mode 100644
index 0000000..48daa84
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/minify/input/condcomm.js
@@ -0,0 +1,18 @@
+var isWin;
+/*@cc_on
+ @if (@_win32)
+ isWin = true;
+ @else @*/ isWin = false;
+/*@end
+ @*/
+
+isWin = /*@cc_on!*/!1;
+
+var recognizesCondComm = true;
+//@cc_on/*
+recognizesCondComm = false;
+//@cc_on*/
+
+
+
+
diff --git a/tedivm/jshrink/tests/Resources/minify/input/issue132.js 
b/tedivm/jshrink/tests/Resources/minify/input/issue132.js
new file mode 100644
index 0000000..a01dd0c
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/minify/input/issue132.js
@@ -0,0 +1,7 @@
+// from jQuery tablesorter
+ts.addParser({
+    id: "currency",
+    is: function(s) {
+        return /^[£$€?.]/.test(s);
+    },
+});
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/minify/output/144.js 
b/tedivm/jshrink/tests/Resources/minify/output/144.js
new file mode 100644
index 0000000..e339d0a
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/minify/output/144.js
@@ -0,0 +1 @@
+a/++b;a*--b;a++-b;a+--b;a-++b;a+-b;a+ ++b;a+--b;a- --b;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/minify/output/condcomm.js 
b/tedivm/jshrink/tests/Resources/minify/output/condcomm.js
new file mode 100644
index 0000000..0cf1177
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/minify/output/condcomm.js
@@ -0,0 +1,11 @@
+var isWin;
+/*@cc_on
+ @if (@_win32)
+ isWin = true;
+ @else @*/ isWin=false;
+/*@end
+ @*/
+isWin=/*@cc_on!*/!1;var recognizesCondComm=true;
+//@cc_on/*
+recognizesCondComm=false;
+//@cc_on*/
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/minify/output/issue132.js 
b/tedivm/jshrink/tests/Resources/minify/output/issue132.js
new file mode 100644
index 0000000..7215187
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/minify/output/issue132.js
@@ -0,0 +1 @@
+ts.addParser({id:"currency",is:function(s){return /^[£$€?.]/.test(s);},});
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/requests/input/.gitkeep 
b/tedivm/jshrink/tests/Resources/requests/input/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/requests/input/.gitkeep
diff --git a/tedivm/jshrink/tests/Resources/requests/input/ifreturn.js 
b/tedivm/jshrink/tests/Resources/requests/input/ifreturn.js
new file mode 100644
index 0000000..eebc013
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/requests/input/ifreturn.js
@@ -0,0 +1,9 @@
+function a(b) {
+       if (b == 1) {
+               return 2;
+       } else {
+               return 17;
+       }
+
+return 3;
+}
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/requests/input/whitespace.js 
b/tedivm/jshrink/tests/Resources/requests/input/whitespace.js
new file mode 100644
index 0000000..6a15c46
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/requests/input/whitespace.js
@@ -0,0 +1,21 @@
+function id(a) {
+  // Form-Feed
+  // Vertical Tab
+   // No-Break Space
+  ᠎// Mongolian Vowel Separator
+   // En quad
+   // Em quad
+   // En space
+   // Em space
+   // Three-Per-Em Space
+   // Four-Per-Em Space
+   // Six-Per-Em Space
+   // Figure Space
+   // Punctuation Space
+   // Thin Space
+   // Hair Space
+   // Narrow No-Break Space
+   // Medium Mathematical Space
+   // Ideographic Space
+  return a;
+}
diff --git a/tedivm/jshrink/tests/Resources/requests/output/.gitkeep 
b/tedivm/jshrink/tests/Resources/requests/output/.gitkeep
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/requests/output/.gitkeep
diff --git a/tedivm/jshrink/tests/Resources/requests/output/ifreturn.js 
b/tedivm/jshrink/tests/Resources/requests/output/ifreturn.js
new file mode 100644
index 0000000..b276691
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/requests/output/ifreturn.js
@@ -0,0 +1,2 @@
+function a(b){if(b==1){return 2;}else{return 17;}
+return 3;}
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/requests/output/whitespace.js 
b/tedivm/jshrink/tests/Resources/requests/output/whitespace.js
new file mode 100644
index 0000000..22b46a3
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/requests/output/whitespace.js
@@ -0,0 +1 @@
+function id(a){return a;}
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/README 
b/tedivm/jshrink/tests/Resources/uglify/README
new file mode 100644
index 0000000..dbe80df
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/README
@@ -0,0 +1 @@
+The files contained in this subdirectory are test cases that have been copied 
from the uglify.js test suite, and then subsequently unmangled by Akshay Joshi.
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/array1.js 
b/tedivm/jshrink/tests/Resources/uglify/input/array1.js
new file mode 100644
index 0000000..ae0851d
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/array1.js
@@ -0,0 +1,3 @@
+new Array();
+new Array(1);
+new Array(1, 2, 3);
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/array2.js 
b/tedivm/jshrink/tests/Resources/uglify/input/array2.js
new file mode 100644
index 0000000..74226df
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/array2.js
@@ -0,0 +1,4 @@
+(function(){
+        var Array = function(){};
+        return new Array(1, 2, 3, 4);
+})();
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/array3.js 
b/tedivm/jshrink/tests/Resources/uglify/input/array3.js
new file mode 100644
index 0000000..6cc9742
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/array3.js
@@ -0,0 +1,4 @@
+(function(){
+        return new Array(1, 2, 3, 4);
+        function Array() {};
+})();
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/array4.js 
b/tedivm/jshrink/tests/Resources/uglify/input/array4.js
new file mode 100644
index 0000000..7392861
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/array4.js
@@ -0,0 +1,6 @@
+(function(){
+        (function(){
+                return new Array(1, 2, 3);
+        })();
+        function Array(){};
+})();
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/assignment.js 
b/tedivm/jshrink/tests/Resources/uglify/input/assignment.js
new file mode 100644
index 0000000..4e00389
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/assignment.js
@@ -0,0 +1,20 @@
+a=1;
+b=a;
+c=1;
+d=b;
+e=d;
+longname=2;
+if (longname+1) {
+    x=3;
+    if (x) var z = 7;
+}
+z=1,y=1,x=1
+
+g+=1;
+h=g;
+
+++i;
+j=i;
+
+i++;
+j=i+17;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/concatstring.js 
b/tedivm/jshrink/tests/Resources/uglify/input/concatstring.js
new file mode 100644
index 0000000..a4a0037
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/concatstring.js
@@ -0,0 +1,3 @@
+var a = a + "a" + "b" + 1 + c;
+var b = a + "c" + "ds" + 123 + c;
+var c = a + "c" + 123 + d + "ds" + c;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/empty-blocks.js 
b/tedivm/jshrink/tests/Resources/uglify/input/empty-blocks.js
new file mode 100644
index 0000000..2d679c1
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/empty-blocks.js
@@ -0,0 +1,4 @@
+var x = 5;
+function bar() { return --x; }
+function foo() { while (bar()); }
+function mak() { for(;;); }
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/forstatement.js 
b/tedivm/jshrink/tests/Resources/uglify/input/forstatement.js
new file mode 100644
index 0000000..d2a14f9
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/forstatement.js
@@ -0,0 +1,10 @@
+a=func();
+b=z;
+for (a++; i < 10; i++) { alert(i); }
+
+var z=1;
+g=2;
+for (; i < 10; i++) { alert(i); }
+
+var a = 2;
+for (var i = 1; i < 10; i++) { alert(i); }
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/if.js 
b/tedivm/jshrink/tests/Resources/uglify/input/if.js
new file mode 100644
index 0000000..6485035
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/if.js
@@ -0,0 +1,6 @@
+var a = 1;
+if (a == 1) {
+       a = 2;
+} else {
+       a = 17;
+}
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/ifreturn2.js 
b/tedivm/jshrink/tests/Resources/uglify/input/ifreturn2.js
new file mode 100644
index 0000000..5d763ea
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/ifreturn2.js
@@ -0,0 +1,16 @@
+function x(a) {
+    if (typeof a === 'object')
+        return a;
+
+    if (a === 42)
+        return 0;
+
+    return a * 2;
+}
+
+function y(a) {
+    if (typeof a === 'object')
+        return a;
+
+    return null;
+};
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/null_string.js 
b/tedivm/jshrink/tests/Resources/uglify/input/null_string.js
new file mode 100644
index 0000000..a675b1c
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/null_string.js
@@ -0,0 +1 @@
+var nullString = "\0"
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/strict-equals.js 
b/tedivm/jshrink/tests/Resources/uglify/input/strict-equals.js
new file mode 100644
index 0000000..b631f4c
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/strict-equals.js
@@ -0,0 +1,3 @@
+typeof a === 'string'
+b + "" !== c + ""
+d < e === f < g
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/var.js 
b/tedivm/jshrink/tests/Resources/uglify/input/var.js
new file mode 100644
index 0000000..5204261
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/var.js
@@ -0,0 +1,2 @@
+var a = 1;
+var b = 2;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/input/with.js 
b/tedivm/jshrink/tests/Resources/uglify/input/with.js
new file mode 100644
index 0000000..de266ed
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/input/with.js
@@ -0,0 +1,2 @@
+with({}) {
+};
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/array1.js 
b/tedivm/jshrink/tests/Resources/uglify/output/array1.js
new file mode 100644
index 0000000..534f00b
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/array1.js
@@ -0,0 +1 @@
+new Array();new Array(1);new Array(1,2,3);
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/array2.js 
b/tedivm/jshrink/tests/Resources/uglify/output/array2.js
new file mode 100644
index 0000000..323f6ab
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/array2.js
@@ -0,0 +1 @@
+(function(){var Array=function(){};return new Array(1,2,3,4);})();
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/array3.js 
b/tedivm/jshrink/tests/Resources/uglify/output/array3.js
new file mode 100644
index 0000000..19d0063
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/array3.js
@@ -0,0 +1 @@
+(function(){return new Array(1,2,3,4);function Array(){};})();
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/array4.js 
b/tedivm/jshrink/tests/Resources/uglify/output/array4.js
new file mode 100644
index 0000000..792f9db
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/array4.js
@@ -0,0 +1 @@
+(function(){(function(){return new Array(1,2,3);})();function Array(){};})();
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/assignment.js 
b/tedivm/jshrink/tests/Resources/uglify/output/assignment.js
new file mode 100644
index 0000000..f10f869
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/assignment.js
@@ -0,0 +1,3 @@
+a=1;b=a;c=1;d=b;e=d;longname=2;if(longname+1){x=3;if(x)var z=7;}
+z=1,y=1,x=1
+g+=1;h=g;++i;j=i;i++;j=i+17;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/concatstring.js 
b/tedivm/jshrink/tests/Resources/uglify/output/concatstring.js
new file mode 100644
index 0000000..faba985
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/concatstring.js
@@ -0,0 +1 @@
+var a=a+"a"+"b"+1+c;var b=a+"c"+"ds"+123+c;var c=a+"c"+123+d+"ds"+c;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/empty-blocks.js 
b/tedivm/jshrink/tests/Resources/uglify/output/empty-blocks.js
new file mode 100644
index 0000000..cb0e084
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/empty-blocks.js
@@ -0,0 +1,3 @@
+var x=5;function bar(){return--x;}
+function foo(){while(bar());}
+function mak(){for(;;);}
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/forstatement.js 
b/tedivm/jshrink/tests/Resources/uglify/output/forstatement.js
new file mode 100644
index 0000000..c3c354f
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/forstatement.js
@@ -0,0 +1,3 @@
+a=func();b=z;for(a++;i<10;i++){alert(i);}
+var z=1;g=2;for(;i<10;i++){alert(i);}
+var a=2;for(var i=1;i<10;i++){alert(i);}
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/if.js 
b/tedivm/jshrink/tests/Resources/uglify/output/if.js
new file mode 100644
index 0000000..f5b7eea
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/if.js
@@ -0,0 +1 @@
+var a=1;if(a==1){a=2;}else{a=17;}
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/ifreturn2.js 
b/tedivm/jshrink/tests/Resources/uglify/output/ifreturn2.js
new file mode 100644
index 0000000..a5e4c4f
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/ifreturn2.js
@@ -0,0 +1,5 @@
+function x(a){if(typeof a==='object')
+return a;if(a===42)
+return 0;return a*2;}
+function y(a){if(typeof a==='object')
+return a;return null;};
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/null_string.js 
b/tedivm/jshrink/tests/Resources/uglify/output/null_string.js
new file mode 100644
index 0000000..0414530
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/null_string.js
@@ -0,0 +1 @@
+var nullString="\0"
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/strict-equals.js 
b/tedivm/jshrink/tests/Resources/uglify/output/strict-equals.js
new file mode 100644
index 0000000..80dafe7
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/strict-equals.js
@@ -0,0 +1,3 @@
+typeof a==='string'
+b+""!==c+""
+d<e===f<g
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/var.js 
b/tedivm/jshrink/tests/Resources/uglify/output/var.js
new file mode 100644
index 0000000..46f5536
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/var.js
@@ -0,0 +1 @@
+var a=1;var b=2;
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/Resources/uglify/output/with.js 
b/tedivm/jshrink/tests/Resources/uglify/output/with.js
new file mode 100644
index 0000000..75ef170
--- /dev/null
+++ b/tedivm/jshrink/tests/Resources/uglify/output/with.js
@@ -0,0 +1 @@
+with({}){};
\ No newline at end of file
diff --git a/tedivm/jshrink/tests/bootstrap.php 
b/tedivm/jshrink/tests/bootstrap.php
new file mode 100644
index 0000000..6c51b87
--- /dev/null
+++ b/tedivm/jshrink/tests/bootstrap.php
@@ -0,0 +1,28 @@
+<?php
+
+/*
+ * This file is part of the JShrink package.
+ *
+ * (c) Robert Hafner <[email protected]>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+define('TESTING', true);//
+error_reporting(-1);
+
+date_default_timezone_set('UTC');
+
+$filename = __DIR__ .'/../vendor/autoload.php';
+
+if (!file_exists($filename)) {
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 
. PHP_EOL;
+    echo " You need to execute `composer install` before running the tests. " 
. PHP_EOL;
+    echo "         Vendors are required for complete test execution.        " 
. PHP_EOL;
+    echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" 
. PHP_EOL . PHP_EOL;
+    $filename = __DIR__ .'/../autoload.php';
+}
+
+$loader = require $filename;
+$loader->add('JShrink\\Test', __DIR__);
diff --git a/tedivm/jshrink/tests/runTests.sh b/tedivm/jshrink/tests/runTests.sh
new file mode 100755
index 0000000..cb79e66
--- /dev/null
+++ b/tedivm/jshrink/tests/runTests.sh
@@ -0,0 +1,12 @@
+#/usr/bin/env/sh
+set -e
+
+echo 'Running unit tests.'
+./vendor/bin/phpunit --verbose --coverage-clover build/logs/clover.xml
+ 
+echo ''
+echo ''
+echo ''
+echo 'Testing for Coding Styling Compliance.'
+echo 'All code should follow PSR standards.'
+./vendor/bin/php-cs-fixer fix ./ --level="all" -vv --dry-run
\ No newline at end of file

-- 
To view, visit https://gerrit.wikimedia.org/r/230811
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If3da1baf2488aeebabdacd42f0b285729c146566
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vendor
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to