If a parser test tries to create a page with invalid content (rejected
by Content::prepareSave() or Content::isValid()), throw an exception
instead of silently failing.
Change-Id: I89642604216699f27884120b3c297a0b277c47a6
throw new MWException( "duplicate article '$name' at $file:$line\n" );
}
- $page->doEditContent( ContentHandler::makeContent( $text, $title ), '', EDIT_NEW );
+ $status = $page->doEditContent( ContentHandler::makeContent( $text, $title ), '', EDIT_NEW );
+ if ( !$status->isOK() ) {
+ throw new MWException( $status->getWikiText( false, false, 'en' ) );
+ }
// The RepoGroup cache is invalidated by the creation of file redirects
if ( $title->getNamespace() === NS_IMAGE ) {