Skip to content

Commit

Permalink
#12 pulished tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeZ99 committed Feb 10, 2012
1 parent 0239974 commit c004a5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/Siwapp/CoreBundle/Entity/AbstractInvoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,11 +529,12 @@ public function removeItem($mixed)
{
if($mixed instanceof \Siwapp\CoreBundle\Entity\AbstractItem)
{
foreach($this->getItems() as $ref => $item)
$items = $this->getItems();
foreach($items as $ref => $item)
{
if($item === $mixed)
{
unset($this->items[$ref]);
unset($items[$ref]);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Siwapp/InvoiceBundle/Tests/Model/InvoiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function testTrial()
$new_item->setQuantity(1);
$new_item->setDiscount(0);
$this->em->persist($new_item);
$test_invoice->addItem($new_item);
$test_invoice->addNewItem($new_item);
$this->em->flush();
$this->assertEquals($test_invoice->getGrossAmount(),8172.36);
// recalculate when updating item
Expand Down

0 comments on commit c004a5f

Please sign in to comment.