public function MergeTest::testNamespaceConditionObject in Drupal driver for SQL Server and SQL Azure 4.2.x
Same name and namespace in other branches
- 8.2 tests/src/Kernel/MergeTest.php \Drupal\Tests\sqlsrv\Kernel\MergeTest::testNamespaceConditionObject()
- 3.0.x tests/src/Kernel/MergeTest.php \Drupal\Tests\sqlsrv\Kernel\MergeTest::testNamespaceConditionObject()
- 3.1.x tests/src/Kernel/MergeTest.php \Drupal\Tests\sqlsrv\Kernel\MergeTest::testNamespaceConditionObject()
- 4.0.x tests/src/Kernel/MergeTest.php \Drupal\Tests\sqlsrv\Kernel\MergeTest::testNamespaceConditionObject()
- 4.1.x tests/src/Kernel/MergeTest.php \Drupal\Tests\sqlsrv\Kernel\MergeTest::testNamespaceConditionObject()
Tests namespace of the condition object.
File
- tests/
src/ Kernel/ MergeTest.php, line 15
Class
- MergeTest
- Tests the MERGE query builder.
Namespace
Drupal\Tests\sqlsrv\KernelCode
public function testNamespaceConditionObject() {
$namespace = (new \ReflectionObject($this->connection))
->getNamespaceName() . "\\Condition";
$merge = $this->connection
->merge('test');
$reflection = new \ReflectionObject($merge);
$condition_property = $reflection
->getProperty('condition');
$condition_property
->setAccessible(TRUE);
$this
->assertSame($namespace, get_class($condition_property
->getValue($merge)));
$nested_and_condition = $merge
->andConditionGroup();
$this
->assertSame($namespace, get_class($nested_and_condition));
$nested_or_condition = $merge
->orConditionGroup();
$this
->assertSame($namespace, get_class($nested_or_condition));
}