Mercurial > hg > isophonics-drupal-site
comparison vendor/sebastian/comparator/src/MockObjectComparator.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
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); |