1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-31 09:31:48 +02:00

port HTTPEncoderTest to phpunit

This commit is contained in:
Elan Ruusamäe
2015-11-19 11:22:57 +02:00
committed by Steve Clay
parent ec22663e3e
commit 79bcb7d5fe
3 changed files with 145 additions and 135 deletions

View File

@@ -10,6 +10,19 @@ class TestCase extends PHPUnit_Framework_TestCase
self::$test_files = __DIR__ . '/../min_unit_tests/_test_files';
}
/**
* 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))
? mb_strlen($str, '8bit')
: strlen($str);
}
/**
* Excluding from phpunit.xml does not work, even using dir,
* hence this dummy test.