wiki.techinc.nl/tests/phpunit/unit/includes/GlobalFunctions/wfRemoveDotSegmentsTest.php
Tim Starling 363adf7df4 Fix silently skipped UrlUtilsTest
phpunit --filter UrlUtilsTest would execute no tests because the class
was already loaded by the GlobalFunctions data providers via the
autoloader, so PHPUnit sees no additional classes when it examines
UrlUtilsTest.php.

So, split out all providers in UrlUtilsTest to a separate class which
can be safely autoloaded.

Change-Id: I483736ee70e598cdb19f8203bc6885f1c234fc42
2022-05-16 14:01:22 +10:00

19 lines
488 B
PHP

<?php
/**
* @group GlobalFunctions
* @covers ::wfRemoveDotSegments
*/
class WfRemoveDotSegmentsTest extends MediaWikiUnitTestCase {
/**
* Same tests as the UrlUtils method to ensure they don't fall out of sync
* @dataProvider UrlUtilsProviders::provideRemoveDotSegments
*/
public function testWfRemoveDotSegments( $inputPath, $outputPath ) {
$this->assertEquals(
$outputPath,
wfRemoveDotSegments( $inputPath ),
"Testing $inputPath expands to $outputPath"
);
}
}