3 * @group GlobalFunctions
6 class WfBaseNameTest
extends MediaWikiTestCase
{
8 * @dataProvider providePaths
10 public function testBaseName( $fullpath, $basename ) {
11 $this->assertEquals( $basename, wfBaseName( $fullpath ),
12 "wfBaseName('$fullpath') => '$basename'" );
15 public static function providePaths() {
23 array( 'aaaa', 'aaaa' ),
26 array( '/aaaa', 'aaaa' ),
27 array( '\\aaaa', 'aaaa' ),
28 array( '/aaaa/', 'aaaa' ),
29 array( '\\aaaa\\', 'aaaa' ),
30 array( '\\aaaa\\', 'aaaa' ),
32 '/mnt/upload3/wikipedia/en/thumb/8/8b/'
33 . 'Zork_Grand_Inquisitor_box_cover.jpg/93px-Zork_Grand_Inquisitor_box_cover.jpg',
34 '93px-Zork_Grand_Inquisitor_box_cover.jpg'
36 array( 'C:\\Progra~1\\Wikime~1\\Wikipe~1\\VIEWER.EXE', 'VIEWER.EXE' ),
37 array( 'Östergötland_coat_of_arms.png', 'Östergötland_coat_of_arms.png' ),