MediaWiki  REL1_19
wfBaseNameTest.php
Go to the documentation of this file.
00001 <?php
00005 class wfBaseName extends MediaWikiTestCase {
00009         function testBaseName( $fullpath, $basename ) {
00010                 $this->assertEquals( $basename, wfBaseName( $fullpath ),
00011                                 "wfBaseName('$fullpath') => '$basename'" );
00012         }
00013         
00014         function providePaths() {
00015                 return array(
00016                         array( '', '' ),
00017                         array( '/', '' ),
00018                         array( '\\', '' ),
00019                         array( '//', '' ),
00020                         array( '\\\\', '' ),
00021                         array( 'a', 'a' ),
00022                         array( 'aaaa', 'aaaa' ),
00023                         array( '/a', 'a' ),
00024                         array( '\\a', 'a' ),
00025                         array( '/aaaa', 'aaaa' ),
00026                         array( '\\aaaa', 'aaaa' ),
00027                         array( '/aaaa/', 'aaaa' ),
00028                         array( '\\aaaa\\', 'aaaa' ),
00029                         array( '\\aaaa\\', 'aaaa' ),
00030                         array( '/mnt/upload3/wikipedia/en/thumb/8/8b/Zork_Grand_Inquisitor_box_cover.jpg/93px-Zork_Grand_Inquisitor_box_cover.jpg',
00031                                 '93px-Zork_Grand_Inquisitor_box_cover.jpg' ),
00032                         array( 'C:\\Progra~1\\Wikime~1\\Wikipe~1\\VIEWER.EXE', 'VIEWER.EXE' ),
00033                         array( 'Östergötland_coat_of_arms.png', 'Östergötland_coat_of_arms.png' ),
00034                 );
00035         }
00036 }