mirror of
https://github.com/mrclay/minify.git
synced 2025-08-11 08:34:19 +02:00
moved tests to minify\test namespace
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use HTTP_ConditionalGet;
|
||||||
|
|
||||||
class HTTPConditionalGetTest extends TestCase
|
class HTTPConditionalGetTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use HTTP_Encoder;
|
||||||
|
|
||||||
class HTTPEncoderTest extends TestCase
|
class HTTPEncoderTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,9 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use JSMin\JSMin;
|
namespace Minify\Test;
|
||||||
use Minify\Test\TestCase;
|
|
||||||
|
|
||||||
class JsMinTest extends TestCase
|
use Exception;
|
||||||
|
use JSMin\JSMin;
|
||||||
|
|
||||||
|
class JSMinTest extends TestCase
|
||||||
{
|
{
|
||||||
public function test1()
|
public function test1()
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_JS_ClosureCompiler;
|
||||||
|
use Minify_JS_ClosureCompiler_Exception;
|
||||||
|
|
||||||
class JsClosureCompilerTest extends TestCase
|
class JsClosureCompilerTest extends TestCase
|
||||||
{
|
{
|
||||||
@@ -29,7 +32,8 @@ class JsClosureCompilerTest extends TestCase
|
|||||||
$this->compile($src);
|
$this->compile($src);
|
||||||
} catch (Minify_JS_ClosureCompiler_Exception $e) {
|
} catch (Minify_JS_ClosureCompiler_Exception $e) {
|
||||||
}
|
}
|
||||||
$this->assertInstanceOf('Minify_JS_ClosureCompiler_Exception', $e, 'Throws Minify_JS_ClosureCompiler_Exception');
|
$this->assertInstanceOf('Minify_JS_ClosureCompiler_Exception', $e,
|
||||||
|
'Throws Minify_JS_ClosureCompiler_Exception');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test maximum byte size check (default)
|
// Test maximum byte size check (default)
|
||||||
@@ -42,7 +46,8 @@ class JsClosureCompilerTest extends TestCase
|
|||||||
$this->compile($src);
|
$this->compile($src);
|
||||||
} catch (Minify_JS_ClosureCompiler_Exception $e) {
|
} catch (Minify_JS_ClosureCompiler_Exception $e) {
|
||||||
}
|
}
|
||||||
$this->assertInstanceOf('Minify_JS_ClosureCompiler_Exception', $e, 'Throws Minify_JS_ClosureCompiler_Exception');
|
$this->assertInstanceOf('Minify_JS_ClosureCompiler_Exception', $e,
|
||||||
|
'Throws Minify_JS_ClosureCompiler_Exception');
|
||||||
|
|
||||||
$expected = 'POST content larger than ' . Minify_JS_ClosureCompiler::DEFAULT_MAX_BYTES . ' bytes';
|
$expected = 'POST content larger than ' . Minify_JS_ClosureCompiler::DEFAULT_MAX_BYTES . ' bytes';
|
||||||
$this->assertEquals($expected, $e->getMessage(), 'Message must tell how big maximum byte size is');
|
$this->assertEquals($expected, $e->getMessage(), 'Message must tell how big maximum byte size is');
|
||||||
@@ -71,7 +76,8 @@ class JsClosureCompilerTest extends TestCase
|
|||||||
));
|
));
|
||||||
} catch (Minify_JS_ClosureCompiler_Exception $e) {
|
} catch (Minify_JS_ClosureCompiler_Exception $e) {
|
||||||
}
|
}
|
||||||
$this->assertInstanceOf('Minify_JS_ClosureCompiler_Exception', $e, 'Throws Minify_JS_ClosureCompiler_Exception');
|
$this->assertInstanceOf('Minify_JS_ClosureCompiler_Exception', $e,
|
||||||
|
'Throws Minify_JS_ClosureCompiler_Exception');
|
||||||
|
|
||||||
$expected = 'POST content larger than ' . $allowedBytes . ' bytes';
|
$expected = 'POST content larger than ' . $allowedBytes . ' bytes';
|
||||||
$this->assertEquals($expected, $e->getMessage(), 'Message must tell how big maximum byte size is');
|
$this->assertEquals($expected, $e->getMessage(), 'Message must tell how big maximum byte size is');
|
||||||
@@ -90,7 +96,8 @@ class JsClosureCompilerTest extends TestCase
|
|||||||
));
|
));
|
||||||
} catch (Minify_JS_ClosureCompiler_Exception $e) {
|
} catch (Minify_JS_ClosureCompiler_Exception $e) {
|
||||||
}
|
}
|
||||||
$this->assertInstanceOf('Minify_JS_ClosureCompiler_Exception', $e, 'Throws Minify_JS_ClosureCompiler_Exception');
|
$this->assertInstanceOf('Minify_JS_ClosureCompiler_Exception', $e,
|
||||||
|
'Throws Minify_JS_ClosureCompiler_Exception');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test7()
|
public function test7()
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_HTML_Helper;
|
||||||
|
|
||||||
class LessSourceTest extends TestCase
|
class LessSourceTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_Build;
|
||||||
|
use Minify_Source;
|
||||||
|
|
||||||
class MinifyBuildTest extends TestCase
|
class MinifyBuildTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_CSS_UriRewriter;
|
||||||
|
|
||||||
class MinifyCSSUriRewriterTest extends TestCase
|
class MinifyCSSUriRewriterTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_Cache_APC;
|
||||||
|
|
||||||
class MinifyCacheAPCTest extends TestCase
|
class MinifyCacheAPCTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_Cache_File;
|
||||||
|
|
||||||
class MinifyCacheFileTest extends TestCase
|
class MinifyCacheFileTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Memcache;
|
||||||
|
use Minify_Cache_Memcache;
|
||||||
|
|
||||||
class MinifyCacheMemcacheTest extends TestCase
|
class MinifyCacheMemcacheTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_Cache_WinCache;
|
||||||
|
|
||||||
class MinifyCacheWinCacheTest extends TestCase
|
class MinifyCacheWinCacheTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_Cache_ZendPlatform;
|
||||||
|
|
||||||
class MinifyCacheZendPlatformTest extends TestCase
|
class MinifyCacheZendPlatformTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Minify_ClosureCompiler;
|
||||||
|
|
||||||
class MinifyClosureCompilerTest extends TestCase
|
class MinifyClosureCompilerTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_CommentPreserver;
|
||||||
|
|
||||||
class MinifyCommentPreserverTest extends TestCase
|
class MinifyCommentPreserverTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_HTML_Helper;
|
||||||
|
use Minify_Source;
|
||||||
|
|
||||||
class MinifyHTMLHelperTest extends TestCase
|
class MinifyHTMLHelperTest extends TestCase
|
||||||
{
|
{
|
||||||
@@ -42,8 +45,10 @@ class MinifyHTMLHelperTest extends TestCase
|
|||||||
$expected = "/myApp/min/?g=css&{$maxTime}";
|
$expected = "/myApp/min/?g=css&{$maxTime}";
|
||||||
$actual = Minify_HTML_Helper::getUri('css', array(
|
$actual = Minify_HTML_Helper::getUri('css', array(
|
||||||
'rewriteWorks' => false
|
'rewriteWorks' => false
|
||||||
, 'minAppUri' => '/myApp/min/'
|
,
|
||||||
, 'groupsConfigFile' => self::$test_files . '/htmlHelper_groupsConfig.php'
|
'minAppUri' => '/myApp/min/'
|
||||||
|
,
|
||||||
|
'groupsConfigFile' => self::$test_files . '/htmlHelper_groupsConfig.php'
|
||||||
));
|
));
|
||||||
$this->assertEquals($expected, $actual, 'existing group');
|
$this->assertEquals($expected, $actual, 'existing group');
|
||||||
|
|
||||||
@@ -69,7 +74,8 @@ class MinifyHTMLHelperTest extends TestCase
|
|||||||
));
|
));
|
||||||
$output = Minify_mtime(array(
|
$output = Minify_mtime(array(
|
||||||
$obj
|
$obj
|
||||||
, 'css'
|
,
|
||||||
|
'css'
|
||||||
), self::$test_files . '/htmlHelper_groupsConfig.php');
|
), self::$test_files . '/htmlHelper_groupsConfig.php');
|
||||||
$this->assertEquals($maxTime, $output, 'utils.php : Minify_mtime w/ obj & group');
|
$this->assertEquals($maxTime, $output, 'utils.php : Minify_mtime w/ obj & group');
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_HTML;
|
||||||
|
|
||||||
class MinifyHTMLTest extends TestCase
|
class MinifyHTMLTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_ImportProcessor;
|
||||||
|
|
||||||
class MinifyImportProcessorTest extends TestCase
|
class MinifyImportProcessorTest extends TestCase
|
||||||
{
|
{
|
||||||
@@ -21,6 +23,7 @@ class MinifyImportProcessorTest extends TestCase
|
|||||||
realpath($linDir . '/lib/css/example.css'),
|
realpath($linDir . '/lib/css/example.css'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->assertEquals($expectedIncludes, Minify_ImportProcessor::$filesIncluded, 'included right files in right order');
|
$this->assertEquals($expectedIncludes, Minify_ImportProcessor::$filesIncluded,
|
||||||
|
'included right files in right order');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify;
|
||||||
|
use Minify_Cache_Null;
|
||||||
|
use Minify_Controller_Files;
|
||||||
|
use Minify_Env;
|
||||||
|
use Minify_Source_Factory;
|
||||||
|
|
||||||
class MinifyLinesTest extends TestCase
|
class MinifyLinesTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Minify_ClosureCompiler;
|
||||||
|
use Minify_NailgunClosureCompiler;
|
||||||
|
|
||||||
class MinifyNailgunClosureCompilerTest extends TestCase
|
class MinifyNailgunClosureCompilerTest extends TestCase
|
||||||
{
|
{
|
||||||
|
@@ -1,6 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify;
|
||||||
|
use Minify_Cache_Null;
|
||||||
|
use Minify_Controller_Files;
|
||||||
|
use Minify_Env;
|
||||||
|
use Minify_Source_Factory;
|
||||||
|
|
||||||
class MinifyTest extends TestCase
|
class MinifyTest extends TestCase
|
||||||
{
|
{
|
||||||
@@ -148,7 +154,8 @@ class MinifyTest extends TestCase
|
|||||||
));
|
));
|
||||||
$output = $output['content'];
|
$output = $output['content'];
|
||||||
|
|
||||||
$this->assertFalse(strpos($output, $defaultOptions['importWarning']), 'Issue 89 : don\'t warn about valid imports');
|
$this->assertFalse(strpos($output, $defaultOptions['importWarning']),
|
||||||
|
'Issue 89 : don\'t warn about valid imports');
|
||||||
|
|
||||||
// Test Issue 132
|
// Test Issue 132
|
||||||
if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
|
if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
|
||||||
@@ -158,7 +165,8 @@ class MinifyTest extends TestCase
|
|||||||
'encodeOutput' => false,
|
'encodeOutput' => false,
|
||||||
));
|
));
|
||||||
|
|
||||||
$this->assertEquals(77, $output['headers']['Content-Length'], 'Issue 132 : mbstring.func_overload shouldn\'t cause incorrect Content-Length');
|
$this->assertEquals(77, $output['headers']['Content-Length'],
|
||||||
|
'Issue 132 : mbstring.func_overload shouldn\'t cause incorrect Content-Length');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test minifying CSS and responding with Etag/Last-Modified
|
// Test minifying CSS and responding with Etag/Last-Modified
|
||||||
|
@@ -1,6 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use Minify_YUICompressor;
|
||||||
|
|
||||||
class MinifyYuiCSSTest extends TestCase
|
class MinifyYuiCSSTest extends TestCase
|
||||||
{
|
{
|
||||||
@@ -15,7 +18,8 @@ class MinifyYuiCSSTest extends TestCase
|
|||||||
Minify_YUICompressor::$tempDir = sys_get_temp_dir();
|
Minify_YUICompressor::$tempDir = sys_get_temp_dir();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setUp() {
|
public function setUp()
|
||||||
|
{
|
||||||
$this->assertHasJar();
|
$this->assertHasJar();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,7 +55,7 @@ class MinifyYuiCSSTest extends TestCase
|
|||||||
{
|
{
|
||||||
$this->assertNotEmpty(Minify_YUICompressor::$jarFile);
|
$this->assertNotEmpty(Minify_YUICompressor::$jarFile);
|
||||||
try {
|
try {
|
||||||
$this->assertFileExists(Minify_YUICompressor::$jarFile , "Have YUI yuicompressor.jar");
|
$this->assertFileExists(Minify_YUICompressor::$jarFile, "Have YUI yuicompressor.jar");
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$this->markTestSkipped($e->getMessage());
|
$this->markTestSkipped($e->getMessage());
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Minify\Test\TestCase;
|
namespace Minify\Test;
|
||||||
|
|
||||||
|
use Minify_HTML_Helper;
|
||||||
|
|
||||||
class ScssSourceTest extends TestCase
|
class ScssSourceTest extends TestCase
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user