Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicosomb committed Feb 21, 2023
1 parent 93cf97e commit 5dd4765
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/Resources/TestCase/ExtendedTestCaseMethodsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ private function compareWithEpsilon($expected, $actual)
public function assertEqualsWithEpsilon($expected, $actual, $message = '')
{
if (!is_array($expected)) {
$expectedArray[] = $expected;
$expectedArray[]['a'] = $expected; // we recreate the structure of the array as in Tools::spreadAmount()
} else {
$expectedArray = $expected;
}

if (!is_array($actual)) {
$actualArray[] = $actual;
$actualArray[]['a'] = $actual; // we recreate the structure of the array as in Tools::spreadAmount()
} else {
$actualArray = $actual;
}

foreach ($expectedArray as $key => $item) {
$this->compareWithEpsilon($item, $actualArray[$key]);
$this->compareWithEpsilon($item['a'], $actualArray[$key]['a']);
}
}
}

0 comments on commit 5dd4765

Please sign in to comment.