You are here

public function PaymentUnitTest::testGetLineItem in Payment 8.2

Tests setLineItem() and getLineItem().

File

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

Class

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

Namespace

Drupal\Tests\payment\Kernel

Code

public function testGetLineItem() {
  $line_item = $this->lineItemManager
    ->createInstance('payment_basic');
  $line_item
    ->setName($this
    ->randomMachineName());
  $this
    ->assertTrue($this->payment
    ->setLineItem($line_item) instanceof PaymentInterface);
  $this
    ->assertIdentical(spl_object_hash($this->payment
    ->getLineItem($line_item
    ->getName())), spl_object_hash($line_item));
}