5 class WfBaseNameTest
extends MediaWikiTestCase
{
7 * @dataProvider providePaths
9 public 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' ),
31 '/mnt/upload3/wikipedia/en/thumb/8/8b/'
32 . 'Zork_Grand_Inquisitor_box_cover.jpg/93px-Zork_Grand_Inquisitor_box_cover.jpg',
33 '93px-Zork_Grand_Inquisitor_box_cover.jpg'
35 array( 'C:\\Progra~1\\Wikime~1\\Wikipe~1\\VIEWER.EXE', 'VIEWER.EXE' ),
36 array( 'Östergötland_coat_of_arms.png', 'Östergötland_coat_of_arms.png' ),