MediaWiki  1.23.2
GlobalWithDBTest.php
Go to the documentation of this file.
1 <?php
2 
11  public function testWfIsBadImage( $name, $title, $blacklist, $expected, $desc ) {
12  $this->assertEquals( $expected, wfIsBadImage( $name, $title, $blacklist ), $desc );
13  }
14 
15  public static function provideWfIsBadImageList() {
16  $blacklist = '* [[File:Bad.jpg]] except [[Nasty page]]';
17 
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:' ),
29  );
30  }
31 }
Title\makeTitle
static & makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:398
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
NS_MAIN
const NS_MAIN
Definition: Defines.php:79
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
wfIsBadImage
wfIsBadImage( $name, $contextTitle=false, $blacklist=null)
Determine if an image exists on the 'bad image list'.
Definition: GlobalFunctions.php:4055
$title
presenting them properly to the user as errors is done by the caller $title
Definition: hooks.txt:1324
$name
Allows to change the fields on the form that will be generated $name
Definition: hooks.txt:336
GlobalWithDBTest\testWfIsBadImage
testWfIsBadImage( $name, $title, $blacklist, $expected, $desc)
@dataProvider provideWfIsBadImageList @covers wfIsBadImage
Definition: GlobalWithDBTest.php:11
GlobalWithDBTest\provideWfIsBadImageList
static provideWfIsBadImageList()
Definition: GlobalWithDBTest.php:15
GlobalWithDBTest
@group Database
Definition: GlobalWithDBTest.php:6