You are here

public function MeasurementComparator::assertEquals in Physical Fields 8

File

src/Comparator/MeasurementComparator.php, line 24

Class

MeasurementComparator
Provides a PHPUnit comparator for measurements.

Namespace

Drupal\physical\Comparator

Code

public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = FALSE, $ignoreCase = FALSE) {
  assert($expected instanceof Measurement);
  assert($actual instanceof Measurement);
  if (!$actual
    ->equals($expected)) {
    throw new ComparisonFailure($expected, $actual, (string) $expected, (string) $actual, FALSE, sprintf('Failed asserting that Measurement %s matches expected %s.', $actual, $expected));
  }
}