From 678e2ff6f8af3aaf932f94be33ac5134f5b82e0d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 27 Mar 2006 22:59:18 +0000 Subject: [PATCH] removing tests for unnecessary, removed dupe of php's ctype functions --- tests/CtypeTest.php | 64 --------------------------------------------- tests/RunTests.php | 1 - 2 files changed, 65 deletions(-) delete mode 100644 tests/CtypeTest.php diff --git a/tests/CtypeTest.php b/tests/CtypeTest.php deleted file mode 100644 index 1b628e2317..0000000000 --- a/tests/CtypeTest.php +++ /dev/null @@ -1,64 +0,0 @@ -PHPUnit_TestCase( $name ); - } - - function setUp() { - $cont = file_get_contents( '../includes/compatability/ctype.php' ); - - preg_match_all( '~function (ctype_[a-z]+)~', $cont, $m ); - $this->populateFunctions( $m[1] ); - - // Will get called before each test* function - if ( function_exists( '_ctype_alnum' ) ) - return; - else { - $cont = preg_replace( '~^<\?php~', '', $cont ); - $cont = preg_replace( '~\?>$~', '', $cont ); - - // Rename the custom functions so they don't conflict - $cont = preg_replace( '~(function )(ctype_)~', '\1_\2', $cont ); - - eval( $cont ); - } - } - - function populateFunctions( $functions ) { - $this->functions = array(); - foreach ( $functions as $function ) - $this->functions[$function] = "_$function"; - } - - function tearDown() {} - -// function testInteger256_to_big() {} - - function testInteger0_to_255() { - foreach ( $this->functions as $phpfunc => $mwfunc ) - foreach ( range( 0, 255 ) as $i ) - $this->assertEquals( - _ctype_alnum( $i ), - ctype_alnum( $i ), - "On $i ($phpfunc)" - ); - } - - function testChr0_to_255() { - foreach ( $this->functions as $phpfunc => $mwfunc ) - foreach ( range( 0, 255 ) as $i ) { - $i = chr( $i ); - $this->assertEquals( - _ctype_alnum( $i ), - ctype_alnum( $i ), - "On $i ($phpfunc)" - ); - } - } - -} -?> diff --git a/tests/RunTests.php b/tests/RunTests.php index e3486ef5b5..538b62df7a 100644 --- a/tests/RunTests.php +++ b/tests/RunTests.php @@ -35,7 +35,6 @@ $tests = array( 'SearchMySQL4Test', 'ArticleTest', 'SanitizerTest', - 'CtypeTest', 'ImageTest' ); -- 2.20.1