You are here

protected function StoredTaxTest::loadTaxLine in Ubercart 8.4

Loads a tax line item from the database.

1 call to StoredTaxTest::loadTaxLine()
StoredTaxTest::testTaxDisplay in uc_tax/tests/src/Functional/StoredTaxTest.php
Tests display of taxes.

File

uc_tax/tests/src/Functional/StoredTaxTest.php, line 136

Class

StoredTaxTest
Tests stored taxes.

Namespace

Drupal\Tests\uc_tax\Functional

Code

protected function loadTaxLine($order_id) {

  // Reset uc_order entity cache then load order.
  \Drupal::entityTypeManager()
    ->getStorage('uc_order')
    ->resetCache([
    $order_id,
  ]);
  $order = Order::load($order_id);
  foreach ($order->line_items as $line) {
    if ($line['type'] == 'tax') {
      return $line;
    }
  }
  return FALSE;
}