3 class MovePageTest
extends MediaWikiTestCase
{
6 * @dataProvider provideIsValidMove
7 * @covers MovePage::isValidMove
8 * @covers MovePage::isValidFileMove
10 public function testIsValidMove( $old, $new, $error ) {
11 $this->setMwGlobals( 'wgContentHandlerUseDB', false );
13 Title
::newFromText( $old ),
14 Title
::newFromText( $new )
16 $status = $mp->isValidMove();
17 if ( $error === true ) {
18 $this->assertTrue( $status->isGood() );
20 $this->assertTrue( $status->hasMessage( $error ) );
25 * This should be kept in sync with TitleTest::provideTestIsValidMoveOperation
27 public static function provideIsValidMove() {
29 // for MovePage::isValidMove
30 array( 'Test', 'Test', 'selfmove' ),
31 array( 'Special:FooBar', 'Test', 'immobile-source-namespace' ),
32 array( 'Test', 'Special:FooBar', 'immobile-target-namespace' ),
33 array( 'MediaWiki:Common.js', 'Help:Some wikitext page', 'bad-target-model' ),
34 array( 'Page', 'File:Test.jpg', 'nonfile-cannot-move-to-file' ),
35 // for MovePage::isValidFileMove
36 array( 'File:Test.jpg', 'Page', 'imagenocrossnamespace' ),