public function EntityInsertTest::testEventMetadata in Rules 8.3
Tests the event metadata.
File
- tests/
src/ Unit/ Integration/ Event/ EntityInsertTest.php, line 17
Class
- EntityInsertTest
- Checks that the entity insert events are defined.
Namespace
Drupal\Tests\rules\Unit\Integration\EventCode
public function testEventMetadata() {
$plugin_definition = $this->eventManager
->getDefinition('rules_entity_insert:test');
$this
->assertSame('After saving a new test', (string) $plugin_definition['label']);
$context_definition = $plugin_definition['context_definitions']['test'];
$this
->assertSame('entity:test', $context_definition
->getDataType());
$this
->assertSame('Test', $context_definition
->getLabel());
}