Bug: T228988
Change-Id: I907fe25692a74b591300b2f182ac6234c22c8071
$titlesByPageId = [];
foreach ( $rows as $row ) {
if ( isset( $rowsByRevId[$row->rev_id] ) ) {
- throw new InvalidArgumentException( "Duplicate rows in newRevisionsFromBatch {$row->rev_id}" );
+ $result->warning(
+ 'internalerror',
+ "Duplicate rows in newRevisionsFromBatch, rev_id {$row->rev_id}"
+ );
}
if ( $title && $row->rev_page != $title->getArticleID() ) {
throw new InvalidArgumentException(
/** @var Revision $rev1 */
$rev1 = $editStatus->getValue()['revision'];
- $this->setExpectedException( InvalidArgumentException::class );
- MediaWikiServices::getInstance()->getRevisionStore()
+ $status = MediaWikiServices::getInstance()->getRevisionStore()
->newRevisionsFromBatch( [ $this->revisionToRow( $rev1 ), $this->revisionToRow( $rev1 ) ] );
+
+ $this->assertFalse( $status->isGood() );
+ $this->assertTrue( $status->hasMessage( 'internalerror' ) );
}
}