mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-30 17:14:42 +00:00
60e3706f09
Initally used a new sniff with autofix (T333745) Bug: T332865 Change-Id: Iad05a3579ec60c576c4aa99567eb3e4fa4c30550
38 lines
892 B
PHP
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 ],
|
|
];
|
|
}
|
|
|
|
}
|