Beispiel #1
0
    public function test_none()
    {
        $test = <<<EOT
var test = {};
test.test = function( e ) {
\ttest.testValue = e;
};

EOT;
        $test2 = \Difra\Minify::getInstance('none')->minify($test);
        $this->assertEquals($test, $test2);
    }
Beispiel #2
0
 /**
  * Choose most suitable file
  * @param $file
  * @return mixed|string
  */
 private function getFile($file)
 {
     $debuggerEnabled = Debugger::isEnabled();
     if (!$debuggerEnabled and !empty($file['min'])) {
         return file_get_contents($file['min']);
     } elseif (!$debuggerEnabled and !empty($file['raw'])) {
         return Minify::getInstance($this->type)->minify(file_get_contents($file['raw']));
     } elseif ($debuggerEnabled and !empty($file['raw'])) {
         return file_get_contents($file['raw']);
     } elseif ($debuggerEnabled and !empty($file['min'])) {
         return file_get_contents($file['min']);
     }
     return '';
 }