Mercurial > hg > cmmr2012-drupal-site
comparison vendor/sebastian/comparator/src/MockObjectComparator.php @ 2:5311817fb629
Theme updates
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 13:19:18 +0000 |
parents | c75dbcec494b |
children |
comparison
equal
deleted
inserted
replaced
1:0b0e5f3b1e83 | 2:5311817fb629 |
---|---|
1 <?php | 1 <?php |
2 /* | 2 /* |
3 * This file is part of the Comparator package. | 3 * This file is part of sebastian/comparator. |
4 * | 4 * |
5 * (c) Sebastian Bergmann <sebastian@phpunit.de> | 5 * (c) Sebastian Bergmann <sebastian@phpunit.de> |
6 * | 6 * |
7 * For the full copyright and license information, please view the LICENSE | 7 * For the full copyright and license information, please view the LICENSE |
8 * file that was distributed with this source code. | 8 * file that was distributed with this source code. |
16 class MockObjectComparator extends ObjectComparator | 16 class MockObjectComparator extends ObjectComparator |
17 { | 17 { |
18 /** | 18 /** |
19 * Returns whether the comparator can compare two values. | 19 * Returns whether the comparator can compare two values. |
20 * | 20 * |
21 * @param mixed $expected The first value to compare | 21 * @param mixed $expected The first value to compare |
22 * @param mixed $actual The second value to compare | 22 * @param mixed $actual The second value to compare |
23 * | |
23 * @return bool | 24 * @return bool |
24 */ | 25 */ |
25 public function accepts($expected, $actual) | 26 public function accepts($expected, $actual) |
26 { | 27 { |
27 return $expected instanceof \PHPUnit_Framework_MockObject_MockObject && $actual instanceof \PHPUnit_Framework_MockObject_MockObject; | 28 return ($expected instanceof \PHPUnit_Framework_MockObject_MockObject || $expected instanceof \PHPUnit\Framework\MockObject\MockObject) && |
29 ($actual instanceof \PHPUnit_Framework_MockObject_MockObject || $actual instanceof \PHPUnit\Framework\MockObject\MockObject); | |
28 } | 30 } |
29 | 31 |
30 /** | 32 /** |
31 * Converts an object to an array containing all of its private, protected | 33 * Converts an object to an array containing all of its private, protected |
32 * and public properties. | 34 * and public properties. |
33 * | 35 * |
34 * @param object $object | 36 * @param object $object |
37 * | |
35 * @return array | 38 * @return array |
36 */ | 39 */ |
37 protected function toArray($object) | 40 protected function toArray($object) |
38 { | 41 { |
39 $array = parent::toArray($object); | 42 $array = parent::toArray($object); |