Login   Register  
PHP Classes
elePHPant
Icontem

File: apibuilder/clients/jsmin-php-master/test/test.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Rodolfo Pereira Romano  >  PHP API Server Builder  >  apibuilder/clients/jsmin-php-master/test/test.php  >  Download  
File: apibuilder/clients/jsmin-php-master/test/test.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: PHP API Server Builder
Build a REST server API from custom classes
Author: By
Last change:
Date: 5 months ago
Size: 531 bytes
 

Contents

Class file image Download
#!/usr/bin/env php
<?php
error_reporting
(E_STRICT);
require 
'../jsmin.php';

$libs = array(
  
'dojo',
  
'ext',
  
'jquery',
  
'mootools',
  
'yui',
  
'utf8-with-bom'
);

foreach (
$libs as $lib) {
  echo 
"Testing $lib ";

  
$jsmin_c   shell_exec(__DIR__ "/jsmin < libs/$lib.js");
  
$jsmin_php JSMin::minify(file_get_contents(__DIR__ "/libs/$lib.js"));

  if (
$jsmin_c === $jsmin_php) {
    echo 
"[PASS]\n";
  } else {
    echo 
"[FAIL]\n";
    echo 
"==> Output differs between jsmin.c and jsmin.php.\n";
  }
}

echo 
"Done.\n";