You are here

public function PriceComparator::assertEquals in Commerce Core 8.2

File

modules/price/src/Comparator/PriceComparator.php, line 24

Class

PriceComparator
Provides a PHPUnit comparator for prices.

Namespace

Drupal\commerce_price\Comparator

Code

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