mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-30 19:16:39 +00:00
Ignore warnings about legacy IDs in tests
Change-Id: I3c74b4e65aac9b84494917547cce7eb6a75995b4
This commit is contained in:
parent
59fa9a5927
commit
a103abb8ae
|
@ -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"] ) ) {
|
||||||
|
|
|
@ -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 ) {
|
||||||
|
|
Loading…
Reference in a new issue