You are here

public function NotifyReminderEventTest::testNotifyReminderEvent in Ubercart 8.4

Tests the event metadata.

File

uc_role/tests/src/Unit/Integration/Event/NotifyReminderEventTest.php, line 19

Class

NotifyReminderEventTest
Checks that the event "uc_role_notify_reminder" is correctly defined.

Namespace

Drupal\Tests\uc_role\Unit\Integration\Event

Code

public function testNotifyReminderEvent() {

  // Verify our event is discoverable.
  $event = $this->eventManager
    ->createInstance('uc_role_notify_reminder');
  $account_context_definition = $event
    ->getContextDefinition('account');
  $this
    ->assertSame('entity:user', $account_context_definition
    ->getDataType());
  $this
    ->assertSame('User', $account_context_definition
    ->getLabel());
  $role_context_definition = $event
    ->getContextDefinition('expiration');
  $this
    ->assertSame('array', $role_context_definition
    ->getDataType());
  $this
    ->assertSame('Role expiration', $role_context_definition
    ->getLabel());
}