mirror of
https://github.com/mrclay/minify.git
synced 2025-02-22 16:04:08 +01:00
(more) Refactoring CSS/Linearizer.php to Minify/ImportProcessor.php
This commit is contained in:
parent
b1747b13db
commit
560bcfd440
@ -15,7 +15,7 @@ class Minify_ImportProcessor {
|
||||
|
||||
public static $filesIncluded = array();
|
||||
|
||||
public static function linearize($file)
|
||||
public static function process($file)
|
||||
{
|
||||
self::$filesIncluded = array();
|
||||
self::$_isCss = (strtolower(substr($file, -4)) === '.css');
|
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
return; // being refactored
|
||||
return; // refactoring
|
||||
|
||||
require_once '_inc.php';
|
||||
|
||||
require_once 'Minify/CSS/Linearizer.php';
|
||||
require_once 'Minify/ImportProcessor.php';
|
||||
|
||||
function test_Minify_CSS_Linearizer()
|
||||
function test_Minify_ImportProcessor()
|
||||
{
|
||||
global $thisDir;
|
||||
|
||||
@ -24,9 +24,9 @@ function test_Minify_CSS_Linearizer()
|
||||
,file_get_contents($linDir . '/output.css')
|
||||
);
|
||||
|
||||
$actual = Minify_CSS_Linearizer::linearize($linDir . '/input.css');
|
||||
$actual = Minify_ImportProcessor::process($linDir . '/input.css');
|
||||
|
||||
$passed = assertTrue($expected === $actual, 'Minify_CSS_Linearizer');
|
||||
$passed = assertTrue($expected === $actual, 'ImportProcessor');
|
||||
|
||||
if (__FILE__ === realpath($_SERVER['SCRIPT_FILENAME'])) {
|
||||
echo "\n---Output: " .strlen($actual). " bytes\n\n{$actual}\n\n";
|
||||
@ -43,8 +43,8 @@ function test_Minify_CSS_Linearizer()
|
||||
,realpath($linDir . '/1/adjacent.css')
|
||||
);
|
||||
|
||||
$passed = assertTrue($expectedIncludes === Minify_CSS_Linearizer::$filesIncluded
|
||||
, 'Minify_CSS_Linearizer : included right files in right order');
|
||||
$passed = assertTrue($expectedIncludes === Minify_ImportProcessor::$filesIncluded
|
||||
, 'ImportProcessor : included right files in right order');
|
||||
}
|
||||
|
||||
test_Minify_CSS_Linearizer();
|
||||
test_Minify_ImportProcessor();
|
@ -5,8 +5,8 @@ require 'test_Minify_Build.php';
|
||||
require 'test_Minify_Cache_File.php';
|
||||
require 'test_Minify_Cache_Memcache.php';
|
||||
require 'test_Minify_CSS.php';
|
||||
require 'test_Minify_CSS_Linearizer.php';
|
||||
require 'test_Minify_HTML.php';
|
||||
require 'test_Minify_ImportProcessor.php';
|
||||
require 'test_Minify_Javascript.php';
|
||||
require 'test_Minify_Lines.php';
|
||||
require 'test_HTTP_Encoder.php';
|
||||
|
Loading…
x
Reference in New Issue
Block a user