public function PaymentUnitTest::testUnsetLineItem in Payment 8.2
Tests unsetLineItem().
File
- tests/
src/ Kernel/ PaymentUnitTest.php, line 107
Class
- PaymentUnitTest
- \Drupal\payment\Entity\Payment unit test.
Namespace
Drupal\Tests\payment\KernelCode
public function testUnsetLineItem() {
$line_item = $this->lineItemManager
->createInstance('payment_basic');
$name = $this
->randomMachineName();
$line_item
->setName($name);
$this->payment
->setLineItem($line_item);
$this
->assertEqual(spl_object_hash($this->payment), spl_object_hash($this->payment
->unsetLineItem($name)));
$this
->assertNull($this->payment
->getLineItem($name));
}