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 Exception instances for equality.
17
* @author Bernhard Schussek <bschussek@2bepublished.at>
18
* @copyright Sebastian Bergmann <sebastian@phpunit.de>
19
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
20
* @link http://www.github.com/sebastianbergmann/comparator
22
class ExceptionComparator extends ObjectComparator
25
* Returns whether the comparator can compare two values.
27
* @param mixed $expected The first value to compare
28
* @param mixed $actual The second value to compare
31
public function accepts($expected, $actual)
33
return $expected instanceof \Exception && $actual instanceof \Exception;
37
* Converts an object to an array containing all of its private, protected
38
* and public properties.
40
* @param object $object
43
protected function toArray($object)
45
$array = parent::toArray($object);
52
$array['xdebug_message']