Skip to content

Commit

Permalink
In order to address difficulties with pull request PhpUnitsOfMeasure#64
Browse files Browse the repository at this point in the history
…, this fix mocks out UnitOfMeasureInterface::isAliasOf() for the AbstractPhysicalQuantityTest unit test mock.
  • Loading branch information
triplepoint committed Jan 16, 2017
1 parent 96d3695 commit 6b175ba
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/AbstractPhysicalQuantityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ protected function getTestUnitOfMeasure($name, $aliases = [])
->willReturn($name);
$newUnit->method('getAliases')
->willReturn($aliases);
$newUnit->method('isAliasOf')
->will($this->returnCallback(
function ($value) use ($aliases) {
return in_array($value, $aliases);
}
));

return $newUnit;
}
Expand Down

0 comments on commit 6b175ba

Please sign in to comment.