You are here

public function NumberComparator::assertEquals in Price 2.0.x

Same name and namespace in other branches
  1. 2.x src/Comparator/NumberComparator.php \Drupal\price\Comparator\NumberComparator::assertEquals()

File

src/Comparator/NumberComparator.php, line 28

Class

NumberComparator
Provides a PHPUnit comparator for numbers cast to strings.

Namespace

Drupal\price\Comparator

Code

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