public function ConnectionTest::testCondition in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php \Drupal\KernelTests\Core\Database\ConnectionTest::testCondition()
- 10 core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php \Drupal\KernelTests\Core\Database\ConnectionTest::testCondition()
Tests that the method ::condition() returns a Condition object.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Database/ ConnectionTest.php, line 239
Class
- ConnectionTest
- Tests of the core database system.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testCondition() {
$connection = Database::getConnection('default', 'default');
$namespace = (new \ReflectionObject($connection))
->getNamespaceName() . "\\Condition";
if (!class_exists($namespace)) {
$namespace = Condition::class;
}
$condition = $connection
->condition('AND');
$this
->assertSame($namespace, get_class($condition));
}