MediaWiki
REL1_31
GlobalWithDBTest.php
Go to the documentation of this file.
1
<?php
2
7
class
GlobalWithDBTest
extends
MediaWikiTestCase
{
12
public
function
testWfIsBadImage
( $name, $title, $blacklist, $expected, $desc ) {
13
$this->assertEquals( $expected,
wfIsBadImage
( $name, $title, $blacklist ), $desc );
14
}
15
16
public
static
function
provideWfIsBadImageList
() {
17
$blacklist =
'* [[File:Bad.jpg]] except [[Nasty page]]'
;
18
19
return
[
20
[
'Bad.jpg'
,
false
, $blacklist,
true
,
21
'Called on a bad image'
],
22
[
'Bad.jpg'
, Title::makeTitle(
NS_MAIN
,
'A page'
), $blacklist,
true
,
23
'Called on a bad image'
],
24
[
'NotBad.jpg'
,
false
, $blacklist,
false
,
25
'Called on a non-bad image'
],
26
[
'Bad.jpg'
, Title::makeTitle(
NS_MAIN
,
'Nasty page'
), $blacklist,
false
,
27
'Called on a bad image but is on a whitelisted page'
],
28
[
'File:Bad.jpg'
,
false
, $blacklist,
false
,
29
'Called on a bad image with File:'
],
30
];
31
}
32
}
wfIsBadImage
wfIsBadImage( $name, $contextTitle=false, $blacklist=null)
Determine if an image exists on the 'bad image list'.
Definition
GlobalFunctions.php:3238
GlobalWithDBTest
GlobalFunctions Database.
Definition
GlobalWithDBTest.php:7
GlobalWithDBTest\testWfIsBadImage
testWfIsBadImage( $name, $title, $blacklist, $expected, $desc)
provideWfIsBadImageList wfIsBadImage
Definition
GlobalWithDBTest.php:12
GlobalWithDBTest\provideWfIsBadImageList
static provideWfIsBadImageList()
Definition
GlobalWithDBTest.php:16
MediaWikiTestCase
Definition
MediaWikiTestCase.php:17
NS_MAIN
const NS_MAIN
Definition
Defines.php:74
tests
phpunit
includes
GlobalFunctions
GlobalWithDBTest.php
Generated on Mon Nov 25 2024 15:36:22 for MediaWiki by
1.10.0