DatabaseTestBase.php
Same filename in this branch
Same filename in other branches
- 8.9.x core/modules/system/tests/src/Functional/Database/DatabaseTestBase.php
- 8.9.x core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php
- 10 core/modules/system/tests/src/Functional/Database/DatabaseTestBase.php
- 10 core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php
- 11.x core/modules/system/tests/src/Functional/Database/DatabaseTestBase.php
- 11.x core/tests/Drupal/KernelTests/Core/Database/DatabaseTestBase.php
Namespace
Drupal\Tests\system\Functional\DatabaseFile
-
core/
modules/ system/ tests/ src/ Functional/ Database/ DatabaseTestBase.php
View source
<?php
namespace Drupal\Tests\system\Functional\Database;
use Drupal\Core\Database\Database;
use Drupal\KernelTests\Core\Database\DatabaseTestSchemaDataTrait;
use Drupal\Tests\BrowserTestBase;
/**
* Base class for databases database tests.
*/
abstract class DatabaseTestBase extends BrowserTestBase {
use DatabaseTestSchemaDataTrait;
/**
* The database connection for testing.
*/
protected $connection;
/**
* {@inheritdoc}
*/
protected static $modules = [
'database_test',
];
/**
* {@inheritdoc}
*/
protected function setUp() {
parent::setUp();
$this->connection = Database::getConnection();
$this->addSampleData();
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
DatabaseTestBase | Base class for databases database tests. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.