Ignore warnings about legacy IDs in tests

Change-Id: I3c74b4e65aac9b84494917547cce7eb6a75995b4
This commit is contained in:
Bartosz Dziewoński 2021-03-18 20:41:46 +01:00
parent 59fa9a5927
commit a103abb8ae
2 changed files with 3 additions and 1 deletions

View file

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

View file

@ -89,6 +89,8 @@ class CommentParserTest extends IntegrationTestCase {
$serialized->id = $threadItem->getId(); $serialized->id = $threadItem->getId();
$serialized->warnings = $threadItem->getWarnings(); $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 = []; $serialized->replies = [];
foreach ( $threadItem->getReplies() as $reply ) { foreach ( $threadItem->getReplies() as $reply ) {