Skip to content

Instantly share code, notes, and snippets.

@jacek-foremski
Created April 4, 2019 13:24
Show Gist options
  • Save jacek-foremski/999af8e488efb1316ccbd0e52ead58b3 to your computer and use it in GitHub Desktop.
Save jacek-foremski/999af8e488efb1316ccbd0e52ead58b3 to your computer and use it in GitHub Desktop.
DsCollectionComparator
<?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