Skip to content

Commit 41ea4b1

Browse files
committed
Simplified a bit
1 parent cc2fd72 commit 41ea4b1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Asserts/CollectionAsserts.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ trait CollectionAsserts
1111
*/
1212
protected function assertCollectionsEqual(Collection $collection1, Collection $collection2, string $key): void
1313
{
14-
$this->assertEquals(
15-
$collection1->pluck($key)->sort()->values(),
16-
$collection2->pluck($key)->sort()->values(),
14+
$this->assertEqualsCanonicalizing(
15+
$collection1->pluck($key),
16+
$collection2->pluck($key),
1717
'Failed asserting that collections are equal.',
1818
);
1919
}
@@ -23,9 +23,9 @@ protected function assertCollectionsEqual(Collection $collection1, Collection $c
2323
*/
2424
protected function assertCollectionsNotEqual(Collection $collection1, Collection $collection2, string $key): void
2525
{
26-
$this->assertNotEquals(
27-
$collection1->pluck($key)->sort()->values(),
28-
$collection2->pluck($key)->sort()->values(),
26+
$this->assertNotEqualsCanonicalizing(
27+
$collection1->pluck($key),
28+
$collection2->pluck($key),
2929
'Failed asserting that collections are not equal.',
3030
);
3131
}

0 commit comments

Comments
 (0)