MediaWiki REL1_31
wfBaseNameTest.php
Go to the documentation of this file.
1<?php
10 public function testBaseName( $fullpath, $basename ) {
11 $this->assertEquals( $basename, wfBaseName( $fullpath ),
12 "wfBaseName('$fullpath') => '$basename'" );
13 }
14
15 public static function providePaths() {
16 return [
17 [ '', '' ],
18 [ '/', '' ],
19 [ '\\', '' ],
20 [ '//', '' ],
21 [ '\\\\', '' ],
22 [ 'a', 'a' ],
23 [ 'aaaa', 'aaaa' ],
24 [ '/a', 'a' ],
25 [ '\\a', 'a' ],
26 [ '/aaaa', 'aaaa' ],
27 [ '\\aaaa', 'aaaa' ],
28 [ '/aaaa/', 'aaaa' ],
29 [ '\\aaaa\\', 'aaaa' ],
30 [ '\\aaaa\\', 'aaaa' ],
31 [
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'
35 ],
36 [ 'C:\\Progra~1\\Wikime~1\\Wikipe~1\\VIEWER.EXE', 'VIEWER.EXE' ],
37 [ 'Östergötland_coat_of_arms.png', 'Östergötland_coat_of_arms.png' ],
38 ];
39 }
40}
wfBaseName( $path, $suffix='')
Return the final portion of a pathname.
GlobalFunctions wfBaseName.
static providePaths()
testBaseName( $fullpath, $basename)
providePaths