public function UserEventTest::testUserLogoutEvent in Hook Event Dispatcher 8
User logout event test.
File
- tests/
src/ Unit/ User/ UserEventTest.php, line 114
Class
- UserEventTest
- Class UserEventTest.
Namespace
Drupal\Tests\hook_event_dispatcher\Unit\UserCode
public function testUserLogoutEvent() {
/** @var \Drupal\Core\Session\AccountInterface $account */
$account = $this
->createMock(AccountInterface::class);
hook_event_dispatcher_user_logout($account);
/** @var \Drupal\hook_event_dispatcher\Event\User\UserLogoutEvent $event */
$event = $this->manager
->getRegisteredEvent(HookEventDispatcherInterface::USER_LOGOUT);
self::assertEquals($account, $event
->getAccount());
}