function ConnectionTest::testCondition
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php \Drupal\KernelTests\Core\Database\ConnectionTest::testCondition()
- 8.9.x core/tests/Drupal/KernelTests/Core/Database/ConnectionTest.php \Drupal\KernelTests\Core\Database\ConnectionTest::testCondition()
- 11.x 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 167
Class
- ConnectionTest
- Tests of the core database system.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testCondition() : void {
$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));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.