function TestDatabaseTest::testConstructorException

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php \Drupal\Tests\Core\Test\TestDatabaseTest::testConstructorException()
  2. 9 core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php \Drupal\Tests\Core\Test\TestDatabaseTest::testConstructorException()
  3. 8.9.x core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php \Drupal\Tests\Core\Test\TestDatabaseTest::testConstructorException()

Tests constructor exception.

@legacy-covers ::__construct

File

core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php, line 27

Class

TestDatabaseTest
Tests Drupal\Core\Test\TestDatabase.

Namespace

Drupal\Tests\Core\Test

Code

public function testConstructorException() : void {
  $this->expectException(\InvalidArgumentException::class);
  $this->expectExceptionMessage("Invalid database prefix: blah1253");
  new TestDatabase('blah1253');
}

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