EntityDeleteTest.php

Same filename in this branch
  1. 8.x-3.x tests/src/Unit/Integration/RulesAction/EntityDeleteTest.php

Namespace

Drupal\Tests\rules\Unit\Integration\Event

File

tests/src/Unit/Integration/Event/EntityDeleteTest.php

View source
<?php

namespace Drupal\Tests\rules\Unit\Integration\Event;


/**
 * Checks that the entity delete events are defined.
 *
 * @coversDefaultClass \Drupal\rules\Plugin\RulesEvent\EntityDeleteDeriver
 *
 * @group RulesEvent
 */
class EntityDeleteTest extends EventTestBase {
    
    /**
     * Tests the event metadata.
     */
    public function testEventMetadata() {
        $plugin_definition = $this->eventManager
            ->getDefinition('rules_entity_delete:test');
        $this->assertSame('After deleting a test entity', (string) $plugin_definition['label']);
        $context_definition = $plugin_definition['context_definitions']['test'];
        $this->assertSame('entity:test', $context_definition->getDataType());
        $this->assertSame('Test', $context_definition->getLabel());
    }

}

Classes

Title Deprecated Summary
EntityDeleteTest Checks that the entity delete events are defined.