function TestDatabaseTest::testConstructorNullPrefix

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

@legacy-covers ::__construct @legacy-covers ::getDatabasePrefix @legacy-covers ::getTestSitePath @legacy-covers ::getPhpErrorLogPath

File

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

Class

TestDatabaseTest
Tests Drupal\Core\Test\TestDatabase.

Namespace

Drupal\Tests\Core\Test

Code

public function testConstructorNullPrefix() : void {
  // 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());
  $this->assertEquals('sites/simpletest/23/error.log', $test_db->getPhpErrorLogPath());
}

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