You are here

public function PaymentEnteredEventTest::testPaymentEnteredEvent in Ubercart 8.4

Tests the event metadata.

File

payment/uc_payment/tests/src/Unit/Integration/Event/PaymentEnteredEventTest.php, line 41

Class

PaymentEnteredEventTest
Checks that the event "uc_payment_entered" is correctly defined.

Namespace

Drupal\Tests\uc_payment\Unit\Integration\Event

Code

public function testPaymentEnteredEvent() {

  // Verify our event is discoverable.
  $event = $this->eventManager
    ->createInstance('uc_payment_entered');
  $order_context_definition = $event
    ->getContextDefinition('order');
  $this
    ->assertSame('entity:uc_order', $order_context_definition
    ->getDataType());
  $this
    ->assertSame('Order', $order_context_definition
    ->getLabel());
  $account_context_definition = $event
    ->getContextDefinition('account');
  $this
    ->assertSame('entity:user', $account_context_definition
    ->getDataType());
  $this
    ->assertSame('User', $account_context_definition
    ->getLabel());
}