You are here

public function PluginEventsTest::testEventNames in Plugin 8.2

Tests constants with event names.

File

tests/src/Unit/Event/PluginEventsTest.php, line 18

Class

PluginEventsTest
@coversDefaultClass \Drupal\plugin\Event\PluginEvents

Namespace

Drupal\Tests\plugin\Unit\Event

Code

public function testEventNames() {
  $class = new \ReflectionClass(PluginEvents::class);
  foreach ($class
    ->getConstants() as $event_name) {

    // Make sure that every event name is properly namespaced.
    $this
      ->assertSame(0, strpos($event_name, 'drupal.plugin.'));
  }
}