mirror of
https://github.com/mrclay/minify.git
synced 2025-08-09 07:36:56 +02:00
moved tests to minify\test namespace
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use HTTP_ConditionalGet;
|
||||
|
||||
class HTTPConditionalGetTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use HTTP_Encoder;
|
||||
|
||||
class HTTPEncoderTest extends TestCase
|
||||
{
|
||||
|
@@ -1,9 +1,11 @@
|
||||
<?php
|
||||
|
||||
use JSMin\JSMin;
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
class JsMinTest extends TestCase
|
||||
use Exception;
|
||||
use JSMin\JSMin;
|
||||
|
||||
class JSMinTest extends TestCase
|
||||
{
|
||||
public function test1()
|
||||
{
|
||||
|
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_JS_ClosureCompiler;
|
||||
use Minify_JS_ClosureCompiler_Exception;
|
||||
|
||||
class JsClosureCompilerTest extends TestCase
|
||||
{
|
||||
@@ -29,7 +32,8 @@ class JsClosureCompilerTest extends TestCase
|
||||
$this->compile($src);
|
||||
} 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)
|
||||
@@ -42,7 +46,8 @@ class JsClosureCompilerTest extends TestCase
|
||||
$this->compile($src);
|
||||
} 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';
|
||||
$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) {
|
||||
}
|
||||
$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';
|
||||
$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) {
|
||||
}
|
||||
$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()
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_HTML_Helper;
|
||||
|
||||
class LessSourceTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_Build;
|
||||
use Minify_Source;
|
||||
|
||||
class MinifyBuildTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_CSS_UriRewriter;
|
||||
|
||||
class MinifyCSSUriRewriterTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_Cache_APC;
|
||||
|
||||
class MinifyCacheAPCTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_Cache_File;
|
||||
|
||||
class MinifyCacheFileTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Memcache;
|
||||
use Minify_Cache_Memcache;
|
||||
|
||||
class MinifyCacheMemcacheTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_Cache_WinCache;
|
||||
|
||||
class MinifyCacheWinCacheTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_Cache_ZendPlatform;
|
||||
|
||||
class MinifyCacheZendPlatformTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Exception;
|
||||
use Minify_ClosureCompiler;
|
||||
|
||||
class MinifyClosureCompilerTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_CommentPreserver;
|
||||
|
||||
class MinifyCommentPreserverTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_HTML_Helper;
|
||||
use Minify_Source;
|
||||
|
||||
class MinifyHTMLHelperTest extends TestCase
|
||||
{
|
||||
@@ -42,8 +45,10 @@ class MinifyHTMLHelperTest extends TestCase
|
||||
$expected = "/myApp/min/?g=css&{$maxTime}";
|
||||
$actual = Minify_HTML_Helper::getUri('css', array(
|
||||
'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');
|
||||
|
||||
@@ -69,7 +74,8 @@ class MinifyHTMLHelperTest extends TestCase
|
||||
));
|
||||
$output = Minify_mtime(array(
|
||||
$obj
|
||||
, 'css'
|
||||
,
|
||||
'css'
|
||||
), self::$test_files . '/htmlHelper_groupsConfig.php');
|
||||
$this->assertEquals($maxTime, $output, 'utils.php : Minify_mtime w/ obj & group');
|
||||
}
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_HTML;
|
||||
|
||||
class MinifyHTMLTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_ImportProcessor;
|
||||
|
||||
class MinifyImportProcessorTest extends TestCase
|
||||
{
|
||||
@@ -21,6 +23,7 @@ class MinifyImportProcessorTest extends TestCase
|
||||
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
|
||||
|
||||
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
|
||||
{
|
||||
|
@@ -1,6 +1,10 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Exception;
|
||||
use Minify_ClosureCompiler;
|
||||
use Minify_NailgunClosureCompiler;
|
||||
|
||||
class MinifyNailgunClosureCompilerTest extends TestCase
|
||||
{
|
||||
|
@@ -1,6 +1,12 @@
|
||||
<?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
|
||||
{
|
||||
@@ -148,7 +154,8 @@ class MinifyTest extends TestCase
|
||||
));
|
||||
$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
|
||||
if (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) {
|
||||
@@ -158,7 +165,8 @@ class MinifyTest extends TestCase
|
||||
'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
|
||||
|
@@ -1,6 +1,9 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Exception;
|
||||
use Minify_YUICompressor;
|
||||
|
||||
class MinifyYuiCSSTest extends TestCase
|
||||
{
|
||||
@@ -15,7 +18,8 @@ class MinifyYuiCSSTest extends TestCase
|
||||
Minify_YUICompressor::$tempDir = sys_get_temp_dir();
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
public function setUp()
|
||||
{
|
||||
$this->assertHasJar();
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
<?php
|
||||
|
||||
use Minify\Test\TestCase;
|
||||
namespace Minify\Test;
|
||||
|
||||
use Minify_HTML_Helper;
|
||||
|
||||
class ScssSourceTest extends TestCase
|
||||
{
|
||||
|
Reference in New Issue
Block a user