function TestDatabaseTest::testConstructorNullPrefix

Same name 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()
  3. 11.x 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());
}

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