You are here

function ArrayWithinMarginExpectation::_withinMessage in Location 5.3

Creates a the message for being within the range.

Parameters

mixed $compare Value being tested.: @access private

File

tests/location_test_case.php, line 57
Location specific assertions.

Class

ArrayWithinMarginExpectation
Test each element of an array for being within a range.

Code

function _withinMessage($compare) {
  $difference = array();
  foreach ($compare as $k => $v) {
    $difference[$k] = abs($v - $this->_canonicalvalues[$k]);
  }
  return 'Within expectation [(' . implode(',', $compare) . ') and (' . implode(',', $this->_canonicalvalues) . '), margin ' . $this->_margin . ' (' . implode(',', $difference) . ')]';
}