You are here

public function PaymentUnitTest::testGetLineItemsByType in Payment 8.2

Tests getLineItemsByType().

File

tests/src/Kernel/PaymentUnitTest.php, line 134

Class

PaymentUnitTest
\Drupal\payment\Entity\Payment unit test.

Namespace

Drupal\Tests\payment\Kernel

Code

public function testGetLineItemsByType() {
  $type = 'payment_basic';
  $line_item = $this->lineItemManager
    ->createInstance($type);
  $this
    ->assertEqual(spl_object_hash($this->payment
    ->setLineItem($line_item)), spl_object_hash($this->payment));
  $line_items = $this->payment
    ->getLineItemsByType($type);
  $this
    ->assertEqual(spl_object_hash(reset($line_items)), spl_object_hash($line_item));
}