Created
April 4, 2019 13:24
-
-
Save jacek-foremski/999af8e488efb1316ccbd0e52ead58b3 to your computer and use it in GitHub Desktop.
DsCollectionComparator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types = 1); | |
namespace App\Tests\Comparators; | |
use Ds\Collection; | |
use SebastianBergmann\Comparator\ObjectComparator; | |
class DsCollectionComparator extends ObjectComparator | |
{ | |
public function accepts($expected, $actual): bool | |
{ | |
return $expected instanceof Collection && $actual instanceof Collection; | |
} | |
protected function toArray($object): array | |
{ | |
return $object->toArray(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment