test: coverage recording now needs to be explicit
[mediawiki.git] / tests / phpunit / includes / GlobalFunctions / wfBaseNameTest.php
blob3c4fa20007a2631e926d80fecdb774f6e4eebd94
1 <?php
2 /**
3 * Tests for wfBaseName()
4 */
5 class WfBaseNameTest extends MediaWikiTestCase {
6 /**
7 * @dataProvider providePaths
8 */
9 function testBaseName( $fullpath, $basename ) {
10 $this->assertEquals( $basename, wfBaseName( $fullpath ),
11 "wfBaseName('$fullpath') => '$basename'" );
14 public static function providePaths() {
15 return array(
16 array( '', '' ),
17 array( '/', '' ),
18 array( '\\', '' ),
19 array( '//', '' ),
20 array( '\\\\', '' ),
21 array( 'a', 'a' ),
22 array( 'aaaa', 'aaaa' ),
23 array( '/a', 'a' ),
24 array( '\\a', 'a' ),
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' ),