3 * This file is part of the Comparator package.
5 * (c) Sebastian Bergmann <sebastian@phpunit.de>
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
11 namespace SebastianBergmann\Comparator;
14 * Compares PHPUnit_Framework_MockObject_MockObject instances for equality.
16 class MockObjectComparator extends ObjectComparator
19 * Returns whether the comparator can compare two values.
21 * @param mixed $expected The first value to compare
22 * @param mixed $actual The second value to compare
25 public function accepts($expected, $actual)
27 return $expected instanceof \PHPUnit_Framework_MockObject_MockObject && $actual instanceof \PHPUnit_Framework_MockObject_MockObject;
31 * Converts an object to an array containing all of its private, protected
32 * and public properties.
34 * @param object $object
37 protected function toArray($object)
39 $array = parent::toArray($object);
41 unset($array['__phpunit_invocationMocker']);