You are here

public function TestDatabaseTest::testConstructorException in Drupal 8

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

@covers ::__construct

File

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

Class

TestDatabaseTest
@coversDefaultClass \Drupal\Core\Test\TestDatabase

Namespace

Drupal\Tests\Core\Test

Code

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