MediaWikiIntegrationTestCase::getExistingTestPage: Throw if the requested page isn't wikitext

Change-Id: I8910d870a8ef226f22a3d5cbd6deb01405fdd80b
This commit is contained in:
James D. Forrester 2024-05-17 09:32:06 -04:00
parent f33a0cdda2
commit 31b5732860

View file

@ -333,6 +333,9 @@ abstract class MediaWikiIntegrationTestCase extends PHPUnit\Framework\TestCase {
$title = Title::newFromText( $title );
}
}
if ( $title->getContentModel() !== CONTENT_MODEL_WIKITEXT ) {
throw new LogicException( "Requested page {$title->getPrefixedText()} isn't in the wikitext content model." );
}
$page = $this->getServiceContainer()->getWikiPageFactory()->newFromTitle( $title );
if ( !$page->exists() ) {