You are here

protected function UbercartTaxesTestCase::assertTaxLineCorrect in Ubercart 7.3

1 call to UbercartTaxesTestCase::assertTaxLineCorrect()
UbercartTaxesTestCase::testStoredTaxDisplay in uc_taxes/tests/uc_taxes.test

File

uc_taxes/tests/uc_taxes.test, line 162
Tax tests.

Class

UbercartTaxesTestCase
Tests the tax functionality.

Code

protected function assertTaxLineCorrect($line, $rate, $when) {
  $this
    ->assertTrue($line, t('The tax line item was saved to the order ' . $when));
  $this
    ->assertTrue(number_format($rate * $this->product->sell_price, 2) == number_format($line['amount'], 2), t('Stored tax line item has the correct amount ' . $when));
  $this
    ->assertFieldByName('line_items[' . $line['line_item_id'] . '][li_id]', $line['line_item_id'], t('Found the tax line item ID ' . $when));
  $this
    ->assertText($line['title'], t('Found the tax title ' . $when));
  $this
    ->assertText(uc_currency_format($line['amount']), t('Tax display has the correct amount ' . $when));
}