function EntityViewTest::testEventMetadata

Tests the event metadata.

File

tests/src/Unit/Integration/Event/EntityViewTest.php, line 17

Class

EntityViewTest
Checks that the entity view events are defined.

Namespace

Drupal\Tests\rules\Unit\Integration\Event

Code

public function testEventMetadata() {
    $plugin_definition = $this->eventManager
        ->getDefinition('rules_entity_view:test');
    $this->assertSame('Entity of type test is viewed', (string) $plugin_definition['label']);
    $context_definition = $plugin_definition['context_definitions']['test'];
    $this->assertSame('entity:test', $context_definition->getDataType());
    $this->assertSame('Test', $context_definition->getLabel());
}