From: Thiemo Kreuz Date: Wed, 27 Mar 2019 10:22:49 +0000 (+0100) Subject: Remove broken explode() from MediaWikiMediaTestCase::dataFile() X-Git-Tag: 1.34.0-rc.0~2145^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/modifier.php?a=commitdiff_plain;h=0d043194cc523c282dc92520bb0316b4f5ae03b0;p=lhc%2Fweb%2Fwiklou.git Remove broken explode() from MediaWikiMediaTestCase::dataFile() It appears this is unused. Providing false is enough. When all tests go green, this should be proof enough that all tests are fine with this fallback code being removed. Change-Id: I1fdeb26c61d67f5564377770c6d5e11d789971bb --- diff --git a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php index 7a536df944..2e9acfade4 100644 --- a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php +++ b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php @@ -70,16 +70,10 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase { * * File must be in the path returned by getFilePath() * @param string $name File name - * @param string|null $type MIME type [optional] + * @param string|false $type MIME type [optional] * @return UnregisteredLocalFile */ - protected function dataFile( $name, $type = null ) { - if ( !$type ) { - // Autodetect by file extension for the lazy. - $magic = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer(); - $parts = explode( $name, '.' ); - $type = $magic->guessTypesForExtension( $parts[count( $parts ) - 1] ); - } + protected function dataFile( $name, $type = false ) { return new UnregisteredLocalFile( false, $this->repo, "mwstore://localtesting/data/$name", $type ); }