Skip to content

Commit

Permalink
Merge pull request #1 from olekhy/fixed-MoneyHydrator
Browse files Browse the repository at this point in the history
Fixed money hydrator
  • Loading branch information
olekhy committed May 20, 2015
2 parents 659e434 + 1e9774e commit 4330d3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Hydrator/MoneyHydrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class MoneyHydrator implements HydratorInterface
public function extract($object)
{
return [
'amount' => $object->getAmount(),
'amount' => $object->getAmount() / 100,
'currency' => $object->getCurrency()->getName()
];
}
Expand Down
2 changes: 1 addition & 1 deletion test/Hydrator/MoneyHydratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function testHydratorExtractAsExpected()
$object = new Money(500, new Currency('BRL'));
$hydrator = new MoneyHydrator();
$extracted = $hydrator->extract($object);
$expected = ['amount' => $object->getAmount(), 'currency' => $object->getCurrency()->getName()];
$expected = ['amount' => 5, 'currency' => $object->getCurrency()->getName()];

$this->assertEquals($expected, $extracted);
}
Expand Down

0 comments on commit 4330d3e

Please sign in to comment.