Returns the correct comparator for comparing two values.
mixed $expected The first value to compare:
mixed $actual The second value to compare:
public function getComparatorFor($expected, $actual) {
foreach ($this->comparators as $comparator) {
if ($comparator
->accepts($expected, $actual)) {
return $comparator;
}
}
throw new PHPUnit_Framework_Exception(sprintf('No comparator is registered for comparing the types "%s" and "%s"', gettype($expected), gettype($actual)));
}