mediawiki-extensions-Visual.../tests/phpunit/SpecialCollabPadTest.php
Umherirrender 60e3706f09 tests: Make PHPUnit data providers static
Initally used a new sniff with autofix (T333745)

Bug: T332865
Change-Id: Iad05a3579ec60c576c4aa99567eb3e4fa4c30550
2023-05-20 17:02:35 +02:00

38 lines
892 B
PHP

<?php
namespace MediaWiki\Extension\VisualEditor\Tests;
use MediaWiki\Extension\VisualEditor\SpecialCollabPad;
use MediaWikiIntegrationTestCase;
use Title;
/**
* @covers \MediaWiki\Extension\VisualEditor\SpecialCollabPad
*/
class SpecialCollabPadTest extends MediaWikiIntegrationTestCase {
/**
* @dataProvider provideSubPages
*/
public function testGetSubPage( string $title, ?string $expected ) {
$result = SpecialCollabPad::getSubPage( Title::newFromText( $title ) );
$this->assertSame(
$expected,
$result ? $result->getPrefixedText() : $result
);
}
public static function provideSubPages() {
return [
[ 'Special:CollabPad', null ],
[ 'Special:CollabPad/', null ],
[ 'Special:CollabPad/B_b', 'B b' ],
[ 'Special:CollabPad/B b', 'B b' ],
[ 'Special:CollabPad/B/C', 'B/C' ],
[ 'Special:CollabPad/B/C/', 'B/C/' ],
[ '/B/C', null ],
];
}
}