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