You are here

public function TestDatabaseTest::testConstructorNullPrefix 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::testConstructorNullPrefix()
  2. 10 core/tests/Drupal/Tests/Core/Test/TestDatabaseTest.php \Drupal\Tests\Core\Test\TestDatabaseTest::testConstructorNullPrefix()

Verify that a test lock is generated if there is no provided prefix.

@covers ::__construct

File

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

Class

TestDatabaseTest
@coversDefaultClass \Drupal\Core\Test\TestDatabase

Namespace

Drupal\Tests\Core\Test

Code

public function testConstructorNullPrefix() {

  // We use a stub class here because we can't mock getTestLock() so that it's
  // available before the constructor is called.
  $test_db = new TestTestDatabase(NULL);
  $this
    ->assertEquals('test23', $test_db
    ->getDatabasePrefix());
  $this
    ->assertEquals('sites/simpletest/23', $test_db
    ->getTestSitePath());
}