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