Skip to content

Commit 38e8f42

Browse files
refactor(tests): add test for compareItems() for AbstractList
1 parent 894a05e commit 38e8f42

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Quant/Core/Tests/AbstractListTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,24 @@ public function getType(): string
340340

341341
$cmpB2->a = 0;
342342
$this->assertFalse($listCmpA->equals($listCmpB));
343+
344+
// plain
345+
$abstractListA = $this->getAbstractListClass();
346+
$abstractListB = $this->getAbstractListClass();
347+
348+
$this->assertTrue($abstractListA->equals($abstractListB));
349+
350+
$itemA = new stdClass();
351+
$itemB = new stdClass();
352+
353+
$abstractListA[] = $itemA;
354+
$this->assertFalse($abstractListA->equals($abstractListB));
355+
356+
$abstractListB[] = $itemA;
357+
$this->assertTrue($abstractListA->equals($abstractListB));
358+
359+
$abstractListB[] = $itemB;
360+
$this->assertFalse($abstractListA->equals($abstractListB));
343361
}
344362

345363

0 commit comments

Comments
 (0)