You are here

public function PaymentUnitTest::testGetPaymentMethod in Payment 8.2

Tests getPaymentMethod().

File

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

Class

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

Namespace

Drupal\Tests\payment\Kernel

Code

public function testGetPaymentMethod() {
  $payment_method = Payment::methodManager()
    ->createInstance('payment_basic');
  $this->payment
    ->setPaymentMethod($payment_method);
  $this
    ->assertEqual(spl_object_hash($this->payment
    ->getPaymentMethod()), spl_object_hash($payment_method));
  $this
    ->assertEqual(spl_object_hash($this->payment
    ->getPaymentMethod()
    ->getPayment()), spl_object_hash($this->payment));
}