Remove messages.inc, rebuildLanguage.php, writeMessagesArray.inc
[mediawiki.git] / tests / phpunit / includes / GlobalFunctions / GlobalWithDBTest.php
blobcf891e7b4f4d04ed4063a6ba22a376d92b4a8626
1 <?php
3 /**
4 * @group Database
5 */
6 class GlobalWithDBTest extends MediaWikiTestCase {
7 /**
8 * @dataProvider provideWfIsBadImageList
9 * @covers ::wfIsBadImage
11 public function testWfIsBadImage( $name, $title, $blacklist, $expected, $desc ) {
12 $this->assertEquals( $expected, wfIsBadImage( $name, $title, $blacklist ), $desc );
15 public static function provideWfIsBadImageList() {
16 $blacklist = '* [[File:Bad.jpg]] except [[Nasty page]]';
18 return array(
19 array( 'Bad.jpg', false, $blacklist, true,
20 'Called on a bad image' ),
21 array( 'Bad.jpg', Title::makeTitle( NS_MAIN, 'A page' ), $blacklist, true,
22 'Called on a bad image' ),
23 array( 'NotBad.jpg', false, $blacklist, false,
24 'Called on a non-bad image' ),
25 array( 'Bad.jpg', Title::makeTitle( NS_MAIN, 'Nasty page' ), $blacklist, false,
26 'Called on a bad image but is on a whitelisted page' ),
27 array( 'File:Bad.jpg', false, $blacklist, false,
28 'Called on a bad image with File:' ),