3 * Tests for wfBaseName()
5 class WfBaseNameTest
extends MediaWikiTestCase
{
7 * @dataProvider providePaths
9 function testBaseName( $fullpath, $basename ) {
10 $this->assertEquals( $basename, wfBaseName( $fullpath ),
11 "wfBaseName('$fullpath') => '$basename'" );
14 public static function providePaths() {
22 array( 'aaaa', 'aaaa' ),
25 array( '/aaaa', 'aaaa' ),
26 array( '\\aaaa', 'aaaa' ),
27 array( '/aaaa/', 'aaaa' ),
28 array( '\\aaaa\\', 'aaaa' ),
29 array( '\\aaaa\\', 'aaaa' ),
30 array( '/mnt/upload3/wikipedia/en/thumb/8/8b/Zork_Grand_Inquisitor_box_cover.jpg/93px-Zork_Grand_Inquisitor_box_cover.jpg',
31 '93px-Zork_Grand_Inquisitor_box_cover.jpg' ),
32 array( 'C:\\Progra~1\\Wikime~1\\Wikipe~1\\VIEWER.EXE', 'VIEWER.EXE' ),
33 array( 'Östergötland_coat_of_arms.png', 'Östergötland_coat_of_arms.png' ),