mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-25 04:23:33 +00:00
61fac2fb44
Change-Id: I871f3d9616a40300ee306f58b4bae5a58b57b53f
38 lines
819 B
PHP
38 lines
819 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\VisualEditor\Tests;
|
|
|
|
use MediaWikiIntegrationTestCase;
|
|
use SpecialCollabPad;
|
|
use Title;
|
|
|
|
/**
|
|
* @covers \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 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 ],
|
|
];
|
|
}
|
|
|
|
}
|