1
0
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:
Elan Ruusamäe
2017-12-22 18:04:34 +02:00
parent 7d60fb9d0f
commit 9ee5fb7701
22 changed files with 107 additions and 36 deletions

View File

@@ -1,6 +1,8 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use HTTP_ConditionalGet;
class HTTPConditionalGetTest extends TestCase
{

View File

@@ -1,6 +1,8 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use HTTP_Encoder;
class HTTPEncoderTest extends TestCase
{

View File

@@ -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()
{

View File

@@ -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()

View File

@@ -1,6 +1,8 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Minify_HTML_Helper;
class LessSourceTest extends TestCase
{

View File

@@ -1,6 +1,9 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Minify_Build;
use Minify_Source;
class MinifyBuildTest extends TestCase
{

View File

@@ -1,6 +1,8 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Minify_CSS_UriRewriter;
class MinifyCSSUriRewriterTest extends TestCase
{

View File

@@ -1,6 +1,8 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Minify_Cache_APC;
class MinifyCacheAPCTest extends TestCase
{

View File

@@ -1,6 +1,8 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Minify_Cache_File;
class MinifyCacheFileTest extends TestCase
{

View File

@@ -1,6 +1,9 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Memcache;
use Minify_Cache_Memcache;
class MinifyCacheMemcacheTest extends TestCase
{

View File

@@ -1,6 +1,8 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Minify_Cache_WinCache;
class MinifyCacheWinCacheTest extends TestCase
{

View File

@@ -1,6 +1,8 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Minify_Cache_ZendPlatform;
class MinifyCacheZendPlatformTest extends TestCase
{

View File

@@ -1,6 +1,9 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Exception;
use Minify_ClosureCompiler;
class MinifyClosureCompilerTest extends TestCase
{

View File

@@ -1,6 +1,8 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Minify_CommentPreserver;
class MinifyCommentPreserverTest extends TestCase
{

View File

@@ -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&amp;{$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');
}

View File

@@ -1,6 +1,8 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Minify_HTML;
class MinifyHTMLTest extends TestCase
{

View File

@@ -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');
}
}

View File

@@ -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
{

View File

@@ -1,6 +1,10 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Exception;
use Minify_ClosureCompiler;
use Minify_NailgunClosureCompiler;
class MinifyNailgunClosureCompilerTest extends TestCase
{

View File

@@ -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

View File

@@ -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();
}

View File

@@ -1,6 +1,8 @@
<?php
use Minify\Test\TestCase;
namespace Minify\Test;
use Minify_HTML_Helper;
class ScssSourceTest extends TestCase
{