From 44069f0c276f855d9a3151e4f82f525c9e6ba7df Mon Sep 17 00:00:00 2001 From: edalzell Date: Thu, 19 Mar 2020 16:48:40 -0700 Subject: [PATCH 1/2] phpunit upgrade and related changes --- composer.json | 15 +++--- phpunit.xml | 1 - tests/LessSourceTest.php | 8 ++-- tests/MinifyCSSUriRewriterTest.php | 29 ++++++------ tests/MinifyCacheAPCTest.php | 10 ++-- tests/MinifyCacheMemcacheTest.php | 19 ++++---- tests/MinifyCacheWinCacheTest.php | 10 ++-- tests/MinifyCacheZendPlatformTest.php | 10 ++-- tests/MinifyClosureCompilerTest.php | 34 +++++++------- tests/MinifyHTMLHelperTest.php | 54 ++++++++++------------ tests/MinifyNailgunClosureCompilerTest.php | 20 ++++---- tests/MinifyYuiCSSTest.php | 14 +++--- tests/ScssSourceTest.php | 8 ++-- tests/TestCase.php | 13 +++--- 14 files changed, 119 insertions(+), 126 deletions(-) diff --git a/composer.json b/composer.json index b52286bf..00bdd951 100644 --- a/composer.json +++ b/composer.json @@ -17,15 +17,16 @@ "wiki": "https://github.com/mrclay/minify/blob/master/docs" }, "autoload": { - "classmap": ["lib/"] + "classmap": [ + "lib/" + ] }, "autoload-dev": { - "psr-4": {"Minify\\Test\\": "tests/"} + "psr-4": { + "Minify\\Test\\": "tests/" + } }, "config": { - "platform": { - "php": "5.3.29" - }, "sort-packages": true }, "require": { @@ -42,7 +43,7 @@ "firephp/firephp-core": "~0.4.0", "leafo/scssphp": "^0.3 || ^0.6 || ^0.7", "meenie/javascript-packer": "~1.1", - "phpunit/phpunit": "^4.8.36", + "phpunit/phpunit": "^8.0", "tedivm/jshrink": "~1.1.0" }, "suggest": { @@ -57,4 +58,4 @@ "dev-master": "3.0.x-dev" } } -} +} \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml index b6c77a56..26d7f1e2 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -10,7 +10,6 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" - syntaxCheck="false" bootstrap="vendor/autoload.php"> diff --git a/tests/LessSourceTest.php b/tests/LessSourceTest.php index 037d055a..eeddb62e 100644 --- a/tests/LessSourceTest.php +++ b/tests/LessSourceTest.php @@ -6,7 +6,7 @@ class LessSourceTest extends TestCase { - public function setUp() + public function setUp(): void { $this->realDocRoot = $_SERVER['DOCUMENT_ROOT']; $_SERVER['DOCUMENT_ROOT'] = self::$document_root; @@ -32,11 +32,11 @@ public function testLessTimestamp() $max = max($mtime1, $mtime2); - $options = array( + $options = [ 'groupsConfigFile' => "$baseDir/htmlHelper_groupsConfig.php", - ); + ]; $res = Minify_HTML_Helper::getUri('less', $options); $this->assertEquals("/min/g=less&{$max}", $res); } -} \ No newline at end of file +} diff --git a/tests/MinifyCSSUriRewriterTest.php b/tests/MinifyCSSUriRewriterTest.php index 83871bf1..bc3d46e2 100644 --- a/tests/MinifyCSSUriRewriterTest.php +++ b/tests/MinifyCSSUriRewriterTest.php @@ -6,40 +6,39 @@ class MinifyCSSUriRewriterTest extends TestCase { - public function setUp() + public function setUp(): void { Minify_CSS_UriRewriter::$debugText = ''; } public function test1() { - $in = file_get_contents(self::$test_files . '/css_uriRewriter/in.css'); - $expected = file_get_contents(self::$test_files . '/css_uriRewriter/exp.css'); + $in = file_get_contents(self::$test_files.'/css_uriRewriter/in.css'); + $expected = file_get_contents(self::$test_files.'/css_uriRewriter/exp.css'); $actual = Minify_CSS_UriRewriter::rewrite( - $in - , self::$test_files . '/css_uriRewriter' // currentDir + $in, self::$test_files.'/css_uriRewriter' // currentDir , self::$document_root // use DOCUMENT_ROOT = '/full/path/to/min_unit_tests' ); - $this->assertEquals($expected, $actual, 'rewrite, debug: ' . Minify_CSS_UriRewriter::$debugText); + $this->assertEquals($expected, $actual, 'rewrite, debug: '.Minify_CSS_UriRewriter::$debugText); } public function test2() { - $in = file_get_contents(self::$test_files . '/css_uriRewriter/in.css'); - $expected = file_get_contents(self::$test_files . '/css_uriRewriter/exp_prepend.css'); + $in = file_get_contents(self::$test_files.'/css_uriRewriter/in.css'); + $expected = file_get_contents(self::$test_files.'/css_uriRewriter/exp_prepend.css'); $actual = Minify_CSS_UriRewriter::prepend($in, 'http://cnd.com/A/B/'); - $this->assertEquals($expected, $actual, 'prepend1, debug: ' . Minify_CSS_UriRewriter::$debugText); + $this->assertEquals($expected, $actual, 'prepend1, debug: '.Minify_CSS_UriRewriter::$debugText); } public function test3() { - $in = file_get_contents(self::$test_files . '/css_uriRewriter/in.css'); - $expected = file_get_contents(self::$test_files . '/css_uriRewriter/exp_prepend2.css'); + $in = file_get_contents(self::$test_files.'/css_uriRewriter/in.css'); + $expected = file_get_contents(self::$test_files.'/css_uriRewriter/exp_prepend2.css'); $actual = Minify_CSS_UriRewriter::prepend($in, '//cnd.com/A/B/'); - $this->assertEquals($expected, $actual, 'prepend2, debug: ' . Minify_CSS_UriRewriter::$debugText); + $this->assertEquals($expected, $actual, 'prepend2, debug: '.Minify_CSS_UriRewriter::$debugText); } public function test4() @@ -47,11 +46,9 @@ public function test4() $in = '../../../../assets/skins/sam/sprite.png'; $exp = '/yui/assets/skins/sam/sprite.png'; $actual = Minify_CSS_UriRewriter::rewriteRelative( - $in - , 'sf_root_dir\web\yui\menu\assets\skins\sam' - , 'sf_root_dir\web' + $in, 'sf_root_dir\web\yui\menu\assets\skins\sam', 'sf_root_dir\web' ); - $this->assertEquals($exp, $actual, 'Issue 99, debug: ' . Minify_CSS_UriRewriter::$debugText); + $this->assertEquals($exp, $actual, 'Issue 99, debug: '.Minify_CSS_UriRewriter::$debugText); } } diff --git a/tests/MinifyCacheAPCTest.php b/tests/MinifyCacheAPCTest.php index 447f72b3..6b09bf84 100644 --- a/tests/MinifyCacheAPCTest.php +++ b/tests/MinifyCacheAPCTest.php @@ -6,20 +6,20 @@ class MinifyCacheAPCTest extends TestCase { - public function setUp() + public function setUp(): void { - if (!function_exists('apc_store')) { + if (! function_exists('apc_store')) { // FIXME: is APCu extension ok too? - $this->markTestSkipped("To test this component, install APC extension"); + $this->markTestSkipped('To test this component, install APC extension'); } } public function test1() { - $data = str_repeat(md5(time()) . 'í', 100); // 3400 bytes in UTF-8 + $data = str_repeat(md5(time()).'í', 100); // 3400 bytes in UTF-8 $id = 'Minify_test_cache'; $cache = new Minify_Cache_APC(); $this->assertTestCache($cache, $id, $data); } -} \ No newline at end of file +} diff --git a/tests/MinifyCacheMemcacheTest.php b/tests/MinifyCacheMemcacheTest.php index 6d71c27d..419e7ee5 100644 --- a/tests/MinifyCacheMemcacheTest.php +++ b/tests/MinifyCacheMemcacheTest.php @@ -10,21 +10,21 @@ class MinifyCacheMemcacheTest extends TestCase /** @var Memcache */ private $mc; - public function setUp() + public function setUp(): void { - if (!function_exists('memcache_set')) { - $this->markTestSkipped("To test this component, install memcache in PHP"); + if (! function_exists('memcache_set')) { + $this->markTestSkipped('To test this component, install memcache in PHP'); } $this->mc = new Memcache(); - if (!$this->mc->connect('localhost', 11211)) { - $this->markTestSkipped("Memcache server not found on localhost:11211"); + if (! $this->mc->connect('localhost', 11211)) { + $this->markTestSkipped('Memcache server not found on localhost:11211'); } } public function test1() { - $data = str_repeat(md5(time()) . 'í', 100); // 3400 bytes in UTF-8 + $data = str_repeat(md5(time()).'í', 100); // 3400 bytes in UTF-8 $id = 'Minify_test_memcache'; $cache = new Minify_Cache_Memcache($this->mc); @@ -33,11 +33,11 @@ public function test1() public function test2() { - if (!function_exists('gzencode')) { - $this->markTestSkipped("enable gzip extension to test this"); + if (! function_exists('gzencode')) { + $this->markTestSkipped('enable gzip extension to test this'); } - $data = str_repeat(md5(time()) . 'í', 100); // 3400 bytes in UTF-8 + $data = str_repeat(md5(time()).'í', 100); // 3400 bytes in UTF-8 $id = 'Minify_test_memcache.gz'; $cache = new Minify_Cache_Memcache($this->mc); @@ -45,4 +45,3 @@ public function test2() $this->assertTestCache($cache, $id, $data); } } - diff --git a/tests/MinifyCacheWinCacheTest.php b/tests/MinifyCacheWinCacheTest.php index 4ef00e32..b64cdb0e 100644 --- a/tests/MinifyCacheWinCacheTest.php +++ b/tests/MinifyCacheWinCacheTest.php @@ -6,19 +6,19 @@ class MinifyCacheWinCacheTest extends TestCase { - public function setUp() + public function setUp(): void { - if (!function_exists('wincache_ucache_info')) { - $this->markTestSkipped("To test this component, install WinCache extension"); + if (! function_exists('wincache_ucache_info')) { + $this->markTestSkipped('To test this component, install WinCache extension'); } } public function test1() { - $data = str_repeat(md5(time()) . 'í', 100); // 3400 bytes in UTF-8 + $data = str_repeat(md5(time()).'í', 100); // 3400 bytes in UTF-8 $id = 'Minify_test_cache'; $cache = new Minify_Cache_WinCache(); $this->assertTestCache($cache, $id, $data); } -} \ No newline at end of file +} diff --git a/tests/MinifyCacheZendPlatformTest.php b/tests/MinifyCacheZendPlatformTest.php index e93f800b..10ed8976 100644 --- a/tests/MinifyCacheZendPlatformTest.php +++ b/tests/MinifyCacheZendPlatformTest.php @@ -6,20 +6,20 @@ class MinifyCacheZendPlatformTest extends TestCase { - public function setUp() + public function setUp(): void { - if (!function_exists('output_cache_put')) { + if (! function_exists('output_cache_put')) { // FIXME: be specific what to actually install - $this->markTestSkipped("To test this component, install ZendPlatform"); + $this->markTestSkipped('To test this component, install ZendPlatform'); } } public function test1() { - $data = str_repeat(md5(time()) . 'í', 100); // 3400 bytes in UTF-8 + $data = str_repeat(md5(time()).'í', 100); // 3400 bytes in UTF-8 $id = 'Minify_test_cache'; $cache = new Minify_Cache_ZendPlatform(); $this->assertTestCache($cache, $id, $data); } -} \ No newline at end of file +} diff --git a/tests/MinifyClosureCompilerTest.php b/tests/MinifyClosureCompilerTest.php index f933075e..b687fc99 100644 --- a/tests/MinifyClosureCompilerTest.php +++ b/tests/MinifyClosureCompilerTest.php @@ -7,7 +7,7 @@ class MinifyClosureCompilerTest extends TestCase { - public static function setupBeforeClass() + public static function setupBeforeClass(): void { parent::setupBeforeClass(); Minify_ClosureCompiler::$isDebug = true; @@ -17,7 +17,7 @@ public static function setupBeforeClass() // put it under tests dir as 'compiler.jar' // set minimum necessary settings - Minify_ClosureCompiler::$jarFile = __DIR__ . DIRECTORY_SEPARATOR . 'compiler.jar'; + Minify_ClosureCompiler::$jarFile = __DIR__.DIRECTORY_SEPARATOR.'compiler.jar'; Minify_ClosureCompiler::$tempDir = sys_get_temp_dir(); } @@ -40,12 +40,12 @@ public function test1() } /** - * Test minimisation with the minimum necessary settings + * Test minimisation with the minimum necessary settings. */ public function test2() { $this->assertHasJar(); - $src = " + $src = ' (function (window, undefined){ function addOne(input) { return 1 + input; @@ -53,29 +53,29 @@ function addOne(input) { window.addOne = addOne; window.undefined = undefined; })(window); - "; - $minExpected = "(function(a,b){a.addOne=function(a){return 1+a};a.undefined=b})(window);"; + '; + $minExpected = '(function(a,b){a.addOne=function(a){return 1+a};a.undefined=b})(window);'; $minOutput = Minify_ClosureCompiler::minify($src); $this->assertSame($minExpected, $minOutput, 'minimum necessary settings'); } /** - * Test minimisation with advanced compilation level + * Test minimisation with advanced compilation level. */ public function test3() { $this->assertHasJar(); - $src = "function unused() {};"; + $src = 'function unused() {};'; $minExpected = ''; - $options = array( - 'compilation_level' => 'ADVANCED_OPTIMIZATIONS' - ); + $options = [ + 'compilation_level' => 'ADVANCED_OPTIMIZATIONS', + ]; $minOutput = Minify_ClosureCompiler::minify($src, $options); $this->assertSame($minExpected, $minOutput, 'advanced optimizations'); } /** - * Test that closure compiler does not produce unneeded noise + * Test that closure compiler does not produce unneeded noise. * * @see https://code.google.com/p/closure-compiler/issues/detail?id=513 * @@ -100,16 +100,16 @@ public function testLanguageOptions() $src = $this->getDataFile('js/jscomp.polyfill.js'); $exp = $this->getDataFile('js/jscomp.polyfill.min.js'); - $options = array( + $options = [ 'language_in' => 'ECMASCRIPT3', - ); + ]; $res = Minify_ClosureCompiler::minify($src, $options); $this->assertSame($exp, $res); - $options = array( + $options = [ 'language_in' => 'ECMASCRIPT6', - ); + ]; $exp = $this->getDataFile('js/jscomp.polyfilled.min.js'); $res = Minify_ClosureCompiler::minify($src, $options); $this->assertSame($exp, $res); @@ -119,7 +119,7 @@ protected function assertHasJar() { $this->assertNotEmpty(Minify_ClosureCompiler::$jarFile); try { - $this->assertFileExists(Minify_ClosureCompiler::$jarFile, "Have closure compiler compiler.jar"); + $this->assertFileExists(Minify_ClosureCompiler::$jarFile, 'Have closure compiler compiler.jar'); } catch (Exception $e) { $this->markTestSkipped($e->getMessage()); } diff --git a/tests/MinifyHTMLHelperTest.php b/tests/MinifyHTMLHelperTest.php index 94e336b6..6118d332 100644 --- a/tests/MinifyHTMLHelperTest.php +++ b/tests/MinifyHTMLHelperTest.php @@ -2,82 +2,78 @@ namespace Minify\Test; -use Minify_HTML_Helper; use Minify_Source; +use Minify_HTML_Helper; class MinifyHTMLHelperTest extends TestCase { private $realDocRoot; - public function setUp() + public function setUp(): void { $this->realDocRoot = $_SERVER['DOCUMENT_ROOT']; $_SERVER['DOCUMENT_ROOT'] = self::$document_root; } // TODO: this is probably not needed if backupGlobals is enabled? - public function tearDown() + public function tearDown(): void { $_SERVER['DOCUMENT_ROOT'] = $this->realDocRoot; } public function test1() { - $file1 = self::$test_files . '/css/paths_prepend.css'; - $file2 = self::$test_files . '/css/styles.css'; + $file1 = self::$test_files.'/css/paths_prepend.css'; + $file2 = self::$test_files.'/css/styles.css'; $maxTime = max(filemtime($file1), filemtime($file2)); $uri1 = '//_test_files/css/paths_prepend.css'; $uri2 = '//_test_files/css/styles.css'; $expected = "/min/b=_test_files/css&f=paths_prepend.css,styles.css&{$maxTime}"; - $actual = Minify_HTML_Helper::getUri(array($uri1, $uri2)); + $actual = Minify_HTML_Helper::getUri([$uri1, $uri2]); $this->assertEquals($expected, $actual, 'given URIs'); $expected = "/min/b=_test_files/css&f=paths_prepend.css,styles.css&{$maxTime}"; - $actual = Minify_HTML_Helper::getUri(array($file1, $file2)); + $actual = Minify_HTML_Helper::getUri([$file1, $file2]); $this->assertEquals($expected, $actual, 'given filepaths'); - $expected = "/min/g=notRealGroup&debug"; - $actual = Minify_HTML_Helper::getUri('notRealGroup', array('debug' => true)); + $expected = '/min/g=notRealGroup&debug'; + $actual = Minify_HTML_Helper::getUri('notRealGroup', ['debug' => true]); $this->assertEquals($expected, $actual, 'non-existent group & debug'); $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' - )); + $actual = Minify_HTML_Helper::getUri('css', [ + 'rewriteWorks' => false, + 'minAppUri' => '/myApp/min/', + 'groupsConfigFile' => self::$test_files.'/htmlHelper_groupsConfig.php', + ]); $this->assertEquals($expected, $actual, 'existing group'); - - $utilsFile = dirname(__DIR__) . '/min/utils.php'; + $utilsFile = dirname(__DIR__).'/min/utils.php'; if (is_file($utilsFile)) { require_once $utilsFile; $fiveSecondsAgo = $_SERVER['REQUEST_TIME'] - 5; - $obj = new Minify_Source(array( + $obj = new Minify_Source([ 'id' => '1', 'content' => '1', 'lastModified' => $fiveSecondsAgo, - )); + ]); - $output = Minify_mtime(array($uri1, $uri2, $obj)); + $output = Minify_mtime([$uri1, $uri2, $obj]); $this->assertEquals($fiveSecondsAgo, $output, 'utils.php : Minify_mtime w/ files & obj'); - $obj = new Minify_Source(array( + $obj = new Minify_Source([ 'id' => '2', 'content' => '2', 'lastModified' => strtotime('2000-01-01'), - )); - $output = Minify_mtime(array( - $obj - , - 'css' - ), self::$test_files . '/htmlHelper_groupsConfig.php'); + ]); + $output = Minify_mtime([ + $obj, + 'css', + ], self::$test_files.'/htmlHelper_groupsConfig.php'); $this->assertEquals($maxTime, $output, 'utils.php : Minify_mtime w/ obj & group'); } } -} \ No newline at end of file +} diff --git a/tests/MinifyNailgunClosureCompilerTest.php b/tests/MinifyNailgunClosureCompilerTest.php index 1b1dc41c..749c17f0 100644 --- a/tests/MinifyNailgunClosureCompilerTest.php +++ b/tests/MinifyNailgunClosureCompilerTest.php @@ -8,7 +8,7 @@ class MinifyNailgunClosureCompilerTest extends TestCase { - public static function setupBeforeClass() + public static function setupBeforeClass(): void { parent::setupBeforeClass(); Minify_ClosureCompiler::$isDebug = true; @@ -18,18 +18,18 @@ public static function setupBeforeClass() // put it under tests dir as 'compiler.jar' // set minimum necessary settings - Minify_ClosureCompiler::$jarFile = __DIR__ . DIRECTORY_SEPARATOR . 'compiler.jar'; + Minify_ClosureCompiler::$jarFile = __DIR__.DIRECTORY_SEPARATOR.'compiler.jar'; Minify_ClosureCompiler::$tempDir = sys_get_temp_dir(); - Minify_NailgunClosureCompiler::$ngJarFile = __DIR__ . DIRECTORY_SEPARATOR . 'nailgun.jar'; + Minify_NailgunClosureCompiler::$ngJarFile = __DIR__.DIRECTORY_SEPARATOR.'nailgun.jar'; } /** - * Test minimisation with the minimum necessary settings + * Test minimisation with the minimum necessary settings. */ public function test1() { $this->assertHasJar(); - $src = " + $src = ' (function (window, undefined){ function addOne(input) { return 1 + input; @@ -37,8 +37,8 @@ function addOne(input) { window.addOne = addOne; window.undefined = undefined; })(window); - "; - $minExpected = "(function(a,b){a.addOne=function(a){return 1+a};a.undefined=b})(window);"; + '; + $minExpected = '(function(a,b){a.addOne=function(a){return 1+a};a.undefined=b})(window);'; $minOutput = Minify_NailgunClosureCompiler::minify($src); $this->assertSame($minExpected, $minOutput, 'minimum necessary settings'); } @@ -48,10 +48,10 @@ protected function assertHasJar() $this->assertNotEmpty(Minify_ClosureCompiler::$jarFile); $this->assertNotEmpty(Minify_NailgunClosureCompiler::$ngJarFile); try { - $this->assertFileExists(Minify_ClosureCompiler::$jarFile, "Have closure compiler compiler.jar"); - $this->assertFileExists(Minify_NailgunClosureCompiler::$ngJarFile, "Have nailgun.jar"); + $this->assertFileExists(Minify_ClosureCompiler::$jarFile, 'Have closure compiler compiler.jar'); + $this->assertFileExists(Minify_NailgunClosureCompiler::$ngJarFile, 'Have nailgun.jar'); } catch (Exception $e) { $this->markTestSkipped($e->getMessage()); } } -} \ No newline at end of file +} diff --git a/tests/MinifyYuiCSSTest.php b/tests/MinifyYuiCSSTest.php index b26cb159..90e79c96 100644 --- a/tests/MinifyYuiCSSTest.php +++ b/tests/MinifyYuiCSSTest.php @@ -7,18 +7,18 @@ class MinifyYuiCSSTest extends TestCase { - public static function setupBeforeClass() + public static function setupBeforeClass(): void { parent::setupBeforeClass(); // To test more functionality, download a yuicompressor.jar from // https://github.com/yui/yuicompressor/releases // put it under tests dir as 'yuicompressor.jar' - Minify_YUICompressor::$jarFile = __DIR__ . DIRECTORY_SEPARATOR . 'yuicompressor.jar'; + Minify_YUICompressor::$jarFile = __DIR__.DIRECTORY_SEPARATOR.'yuicompressor.jar'; Minify_YUICompressor::$tempDir = sys_get_temp_dir(); } - public function setUp() + public function setUp(): void { $this->assertHasJar(); } @@ -44,9 +44,9 @@ public function test1() $this->assertEquals('YUI compressor execution failed.', $e->getMessage()); } - $options = array( + $options = [ 'stack-size' => '2m', - ); + ]; $minOutput = Minify_YUICompressor::minifyCss($src, $options); $this->assertEquals($minExpected, $minOutput); } @@ -55,9 +55,9 @@ protected function assertHasJar() { $this->assertNotEmpty(Minify_YUICompressor::$jarFile); try { - $this->assertFileExists(Minify_YUICompressor::$jarFile, "Have YUI yuicompressor.jar"); + $this->assertFileExists(Minify_YUICompressor::$jarFile, 'Have YUI yuicompressor.jar'); } catch (Exception $e) { $this->markTestSkipped($e->getMessage()); } } -} \ No newline at end of file +} diff --git a/tests/ScssSourceTest.php b/tests/ScssSourceTest.php index 2a2dec95..3c8bef36 100644 --- a/tests/ScssSourceTest.php +++ b/tests/ScssSourceTest.php @@ -6,7 +6,7 @@ class ScssSourceTest extends TestCase { - public function setUp() + public function setUp(): void { $this->realDocRoot = $_SERVER['DOCUMENT_ROOT']; $_SERVER['DOCUMENT_ROOT'] = self::$document_root; @@ -32,11 +32,11 @@ public function testTimestamp() $max = max($mtime1, $mtime2); - $options = array( + $options = [ 'groupsConfigFile' => "$baseDir/htmlHelper_groupsConfig.php", - ); + ]; $res = Minify_HTML_Helper::getUri('scss', $options); $this->assertEquals("/min/g=scss&{$max}", $res); } -} \ No newline at end of file +} diff --git a/tests/TestCase.php b/tests/TestCase.php index fda57d32..f5cf1608 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -11,21 +11,22 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase /** @var string */ protected static $test_files; - public static function setupBeforeClass() + public static function setupBeforeClass(): void { + parent::setUpBeforeClass(); self::$document_root = __DIR__; - self::$test_files = __DIR__ . '/_test_files'; + self::$test_files = __DIR__.'/_test_files'; } /** - * Get number of bytes in a string regardless of mbstring.func_overload + * Get number of bytes in a string regardless of mbstring.func_overload. * * @param string $str * @return int */ protected function countBytes($str) { - return (function_exists('mb_strlen') && ((int)ini_get('mbstring.func_overload') & 2)) + return (function_exists('mb_strlen') && ((int) ini_get('mbstring.func_overload') & 2)) ? mb_strlen($str, '8bit') : strlen($str); } @@ -61,7 +62,7 @@ protected function assertTestCache(Minify_CacheInterface $cache, $id, $data) */ protected function getDataFile($filename) { - $path = self::$test_files . '/' . $filename; + $path = self::$test_files.'/'.$filename; $this->assertFileExists($path); $contents = file_get_contents($path); $this->assertNotEmpty($contents); @@ -70,4 +71,4 @@ protected function getDataFile($filename) return $contents; } -} \ No newline at end of file +} From cf50c4197fcd31e238a42a951d59e69d9e9e8b15 Mon Sep 17 00:00:00 2001 From: edalzell Date: Thu, 19 Mar 2020 16:53:56 -0700 Subject: [PATCH 2/2] update intervention/httpauth --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 00bdd951..0f05e7fc 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,7 @@ "require": { "php": "^5.3.0 || ^7.0", "ext-pcre": "*", - "intervention/httpauth": "~2.0", + "intervention/httpauth": "^3.0", "marcusschwarz/lesserphp": "^0.5.1", "monolog/monolog": "~1.1|~2.0", "mrclay/jsmin-php": "~2",