From: Platonides Date: Thu, 30 Dec 2010 16:24:29 +0000 (+0000) Subject: Follow up r79109. Do not use create_function. X-Git-Tag: 1.31.0-rc.0~32977 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/fiche.php?a=commitdiff_plain;h=c97d18b7ea084074682b508747ee539d31c7a98e;p=lhc%2Fweb%2Fwiklou.git Follow up r79109. Do not use create_function. --- 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; }