public function testGetGrossAmount() { $item = new Item(); $tax = new Tax(); $tax->setValue(20); $item->setUnitaryCost(80); $item->setQuantity(1); $item->addTax($tax); $this->assertEquals(96, $item->getGrossAmount()); }
protected function importTaxes(\PDO $dbh, EntityManager $em) { $count = 0; $sth = $dbh->prepare('SELECT * FROM tax'); $sth->execute(); foreach ($sth->fetchAll(\PDO::FETCH_ASSOC) as $row) { $tax = new Tax(); $tax->setName($row['name']); $tax->setValue($row['value']); $tax->setActive($row['active']); $tax->setIsDefault($row['is_default']); $em->persist($tax); $this->mapping['taxes'][$row['id']] = $tax; $count++; } return $count; }