You are here

public function UserLogoutTest::testUserLogoutEvent in Rules 8.3

Tests the event metadata.

File

tests/src/Unit/Integration/Event/UserLogoutTest.php, line 15

Class

UserLogoutTest
Checks that the event "rules_user_logout" is correctly defined.

Namespace

Drupal\Tests\rules\Unit\Integration\Event

Code

public function testUserLogoutEvent() {
  $event = $this->eventManager
    ->createInstance('rules_user_logout');
  $user_context_definition = $event
    ->getContextDefinition('account');
  $this
    ->assertSame('entity:user', $user_context_definition
    ->getDataType());
  $this
    ->assertSame('Logged out user', $user_context_definition
    ->getLabel());
}