public function UserEventTest::testUserLoginEvent in Hook Event Dispatcher 3.x
Same name and namespace in other branches
- 8.2 modules/user_event_dispatcher/tests/src/Unit/User/UserEventTest.php \Drupal\Tests\user_event_dispatcher\Unit\User\UserEventTest::testUserLoginEvent()
User login event test.
File
- modules/
user_event_dispatcher/ tests/ src/ Unit/ User/ UserEventTest.php, line 89
Class
- UserEventTest
- Class UserEventTest.
Namespace
Drupal\Tests\user_event_dispatcher\Unit\UserCode
public function testUserLoginEvent() : void {
/** @var \Drupal\Core\Session\AccountInterface $account */
$account = $this
->createMock(AccountInterface::class);
user_event_dispatcher_user_login($account);
/** @var \Drupal\user_event_dispatcher\Event\User\UserLoginEvent $event */
$event = $this->manager
->getRegisteredEvent(HookEventDispatcherInterface::USER_LOGIN);
self::assertEquals($account, $event
->getAccount());
}