Merge "Ignore warnings about legacy IDs in tests"

This commit is contained in:
jenkins-bot 2021-03-20 15:28:20 +00:00 committed by Gerrit Code Review
commit 37979df1a1
2 changed files with 3 additions and 1 deletions

View file

@ -1149,7 +1149,7 @@ class CommentParser {
if ( isset( $this->threadItemsById[$id] ) ) {
// Well, that's tough
$threadItem->addWarning( 'Duplicate comment ID' );
$threadItem->addWarning( 'Duplicate comment legacy ID' );
// Finally, disambiguate by adding sequential numbers, to allow replying to both comments
$number = 1;
while ( isset( $this->threadItemsById["$id|$number"] ) ) {

View file

@ -89,6 +89,8 @@ class CommentParserTest extends IntegrationTestCase {
$serialized->id = $threadItem->getId();
$serialized->warnings = $threadItem->getWarnings();
// Ignore warnings about legacy IDs (we don't have them in JS)
$serialized->warnings = array_values( array_diff( $serialized->warnings, [ 'Duplicate comment legacy ID' ] ) );
$serialized->replies = [];
foreach ( $threadItem->getReplies() as $reply ) {