exporter = new MessageAwareExporter(); } /** * Returns whether the comparator can compare two values. * * @param mixed $expected The first value to compare * @param mixed $actual The second value to compare * @return boolean */ public function accepts($expected, $actual) { return $expected instanceof Message && $actual instanceof Message; } /** * Asserts that two values are equal. * * @param Message $expected The first value to compare * @param Message $actual The second value to compare * @param float|int $delta The allowed numerical distance between two values to * consider them equal * @param bool $canonicalize If set to TRUE, arrays are sorted before * comparison * @param bool $ignoreCase If set to TRUE, upper- and lowercasing is * ignored when comparing string values * @throws ComparisonFailure Thrown when the comparison * fails. Contains information about the * specific errors that lead to the failure. */ public function assertEquals($expected, $actual, $delta = 0, $canonicalize = false, $ignoreCase = false) { if ($expected->serializeToString() !== $actual->serializeToString()) { throw new ComparisonFailure( $expected, $actual, $this->exporter->shortenedExport($expected), $this->exporter->shortenedExport($actual), false, 'Given 2 Message objects are not the same' ); } } }