X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FTitleTest.php;h=e8f08732e871bfc4e3e5257c78ce525dd5654b34;hb=b4c7f4c30db86ad74b068afc56a13a965c369540;hp=913f56de5549d70b17667cb996110adcbe2f9a46;hpb=d15ac3bd518c1e270cbd8c4f878840ad05281a4c;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/TitleTest.php b/tests/phpunit/includes/TitleTest.php index 913f56de55..e8f08732e8 100644 --- a/tests/phpunit/includes/TitleTest.php +++ b/tests/phpunit/includes/TitleTest.php @@ -296,9 +296,15 @@ class TitleTest extends MediaWikiTestCase { * @covers Title::isValidMoveOperation */ public function testIsValidMoveOperation( $source, $target, $expected ) { + global $wgMultiContentRevisionSchemaMigrationStage; + $this->hideDeprecated( 'Title::isValidMoveOperation' ); - $this->setMwGlobals( 'wgContentHandlerUseDB', false ); + if ( $wgMultiContentRevisionSchemaMigrationStage === SCHEMA_COMPAT_OLD ) { + // We can only set this to false with the old schema + $this->setMwGlobals( 'wgContentHandlerUseDB', false ); + } + $title = Title::newFromText( $source ); $nt = Title::newFromText( $target ); $errors = $title->isValidMoveOperation( $nt, false ); @@ -313,16 +319,24 @@ class TitleTest extends MediaWikiTestCase { } public static function provideTestIsValidMoveOperation() { - return [ + global $wgMultiContentRevisionSchemaMigrationStage; + $ret = [ // for Title::isValidMoveOperation [ 'Some page', '', 'badtitletext' ], [ 'Test', 'Test', 'selfmove' ], [ 'Special:FooBar', 'Test', 'immobile-source-namespace' ], [ 'Test', 'Special:FooBar', 'immobile-target-namespace' ], - [ 'MediaWiki:Common.js', 'Help:Some wikitext page', 'bad-target-model' ], [ 'Page', 'File:Test.jpg', 'nonfile-cannot-move-to-file' ], [ 'File:Test.jpg', 'Page', 'imagenocrossnamespace' ], ]; + if ( $wgMultiContentRevisionSchemaMigrationStage === SCHEMA_COMPAT_OLD ) { + // The error can only occur if $wgContentHandlerUseDB is false, which doesn't work with + // the new schema, so omit the test in that case + array_push( $ret, + [ 'MediaWiki:Common.js', 'Help:Some wikitext page', 'bad-target-model' ] + ); + } + return $ret; } /** @@ -810,7 +824,7 @@ class TitleTest extends MediaWikiTestCase { // Tell Title it doesn't know whether it exists $title->mArticleID = -1; - // Tell the link cache it doesn't exists when it really does + // Tell the link cache it doesn't exist when it really does $linkCache->clearLink( $title ); $linkCache->addBadLinkObj( $title );