You are here

public function UserEventTest::testUserLoginEvent in Hook Event Dispatcher 8

User login event test.

File

tests/src/Unit/User/UserEventTest.php, line 100

Class

UserEventTest
Class UserEventTest.

Namespace

Drupal\Tests\hook_event_dispatcher\Unit\User

Code

public function testUserLoginEvent() {

  /** @var \Drupal\Core\Session\AccountInterface $account */
  $account = $this
    ->createMock(AccountInterface::class);
  hook_event_dispatcher_user_login($account);

  /** @var \Drupal\hook_event_dispatcher\Event\User\UserLoginEvent $event */
  $event = $this->manager
    ->getRegisteredEvent(HookEventDispatcherInterface::USER_LOGIN);
  self::assertEquals($account, $event
    ->getAccount());
}