function DatabaseEventsTest::testEnableInvalidEvent

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Database/DatabaseEventsTest.php \Drupal\Tests\Core\Database\DatabaseEventsTest::testEnableInvalidEvent()
  2. 10 core/tests/Drupal/Tests/Core/Database/DatabaseEventsTest.php \Drupal\Tests\Core\Database\DatabaseEventsTest::testEnableInvalidEvent()

Tests enable invalid event.

@legacy-covers ::enableEvents

File

core/tests/Drupal/Tests/Core/Database/DatabaseEventsTest.php, line 70

Class

DatabaseEventsTest
Tests Drupal\Core\Database\Connection.

Namespace

Drupal\Tests\Core\Database

Code

public function testEnableInvalidEvent() : void {
  $this->expectException(\AssertionError::class);
  $this->expectExceptionMessage('Event class foo does not exist');
  $this->connection
    ->enableEvents([
    'foo',
  ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.