MediaWiki  REL1_19
GlobalWithDBTest.php
Go to the documentation of this file.
00001 <?php
00002 
00006 class GlobalWithDBTest extends MediaWikiTestCase {
00010         function testWfIsBadImage( $name, $title, $blacklist, $expected, $desc ) {
00011                 $this->assertEquals( $expected, wfIsBadImage( $name, $title, $blacklist ), $desc );
00012         }
00013 
00014         function provideWfIsBadImageList() {
00015                 $blacklist = '* [[File:Bad.jpg]] except [[Nasty page]]';
00016                 return array(
00017                         array( 'Bad.jpg', false, $blacklist, true,
00018                                 'Called on a bad image' ),
00019                         array( 'Bad.jpg', Title::makeTitle( NS_MAIN, 'A page' ), $blacklist, true,
00020                                 'Called on a bad image' ),
00021                         array( 'NotBad.jpg', false, $blacklist, false,
00022                                 'Called on a non-bad image' ),
00023                         array( 'Bad.jpg', Title::makeTitle( NS_MAIN, 'Nasty page' ), $blacklist, false,
00024                                 'Called on a bad image but is on a whitelisted page' ),
00025                         array( 'File:Bad.jpg', false, $blacklist, false,
00026                                 'Called on a bad image with File:' ),
00027                 );
00028         }
00029 }