You are here

public function PaymentEventsTest::testEventNames in Payment 8.2

Tests constants with event names.

File

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

Class

PaymentEventsTest
@coversDefaultClass \Drupal\payment\Event\PaymentEvents

Namespace

Drupal\Tests\payment\Unit\Event

Code

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

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