public function ConnectionTest::testCondition in Drupal driver for SQL Server and SQL Azure 4.0.x
Same name and namespace in other branches
- 8.2 tests/src/Kernel/ConnectionTest.php \Drupal\Tests\sqlsrv\Kernel\ConnectionTest::testCondition()
- 4.2.x tests/src/Kernel/ConnectionTest.php \Drupal\Tests\sqlsrv\Kernel\ConnectionTest::testCondition()
- 3.0.x tests/src/Kernel/ConnectionTest.php \Drupal\Tests\sqlsrv\Kernel\ConnectionTest::testCondition()
- 3.1.x tests/src/Kernel/ConnectionTest.php \Drupal\Tests\sqlsrv\Kernel\ConnectionTest::testCondition()
- 4.1.x tests/src/Kernel/ConnectionTest.php \Drupal\Tests\sqlsrv\Kernel\ConnectionTest::testCondition()
Tests ::condition()
Test that the method ::condition() returns a Condition object from the driver directory.
File
- tests/
src/ Kernel/ ConnectionTest.php, line 23
Class
- ConnectionTest
- Tests of the sqlsrv database system.
Namespace
Drupal\Tests\sqlsrv\KernelCode
public function testCondition() {
$db = Database::getConnection('default', 'default');
$namespace = (new \ReflectionObject($db))
->getNamespaceName() . "\\Condition";
$condition = $db
->condition('AND');
$this
->assertIdentical($namespace, get_class($condition));
$nested_and_condition = $condition
->andConditionGroup();
$this
->assertIdentical($namespace, get_class($nested_and_condition));
$nested_or_condition = $condition
->orConditionGroup();
$this
->assertIdentical($namespace, get_class($nested_or_condition));
}