From c97d18b7ea084074682b508747ee539d31c7a98e Mon Sep 17 00:00:00 2001 From: Platonides Date: Thu, 30 Dec 2010 16:24:29 +0000 Subject: [PATCH] Follow up r79109. Do not use create_function. --- tests/phpunit/MediaWikiTestCase.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/MediaWikiTestCase.php b/tests/phpunit/MediaWikiTestCase.php index d58ebc8ad2..71b8d2a6a0 100644 --- a/tests/phpunit/MediaWikiTestCase.php +++ b/tests/phpunit/MediaWikiTestCase.php @@ -165,11 +165,16 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase { } } + static private function unprefixTable( $tableName ) { + global $wgDBprefix; + return substr( $tableName, strlen( $wgDBprefix ) ); + } + protected function listTables() { global $wgDBprefix; $tables = $this->db->listTables( $wgDBprefix, __METHOD__ ); - $tables = array_map( create_function( '$table', 'global $wgDBprefix; return substr( $table, strlen( $wgDBprefix ) );' ), $tables ); + $tables = array_map( array( __CLASS__, 'unprefixTable' ), $tables ); return $tables; } -- 2.20.1