EntityUpdateTest.php in Rules 8.3
File
tests/src/Unit/Integration/Event/EntityUpdateTest.php
View source
<?php
namespace Drupal\Tests\rules\Unit\Integration\Event;
class EntityUpdateTest extends EventTestBase {
public function testEventMetadata() {
$plugin_definition = $this->eventManager
->getDefinition('rules_entity_update:test');
$this
->assertSame('After updating a 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());
$context_definition = $plugin_definition['context_definitions']['test_unchanged'];
$this
->assertSame('entity:test', $context_definition
->getDataType());
$this
->assertSame('Unchanged Test', (string) $context_definition
->getLabel());
}
}