You are here

public function MergeTest::testNamespaceConditionObject in Drupal driver for SQL Server and SQL Azure 8.2

Same name and namespace in other branches
  1. 4.2.x tests/src/Kernel/MergeTest.php \Drupal\Tests\sqlsrv\Kernel\MergeTest::testNamespaceConditionObject()
  2. 3.0.x tests/src/Kernel/MergeTest.php \Drupal\Tests\sqlsrv\Kernel\MergeTest::testNamespaceConditionObject()
  3. 3.1.x tests/src/Kernel/MergeTest.php \Drupal\Tests\sqlsrv\Kernel\MergeTest::testNamespaceConditionObject()
  4. 4.0.x tests/src/Kernel/MergeTest.php \Drupal\Tests\sqlsrv\Kernel\MergeTest::testNamespaceConditionObject()
  5. 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 17

Class

MergeTest
Tests the MERGE query builder.

Namespace

Drupal\Tests\sqlsrv\Kernel

Code

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
    ->assertIdentical($namespace, get_class($condition_property
    ->getValue($merge)));
  $nested_and_condition = $merge
    ->andConditionGroup();
  $this
    ->assertIdentical($namespace, get_class($nested_and_condition));
  $nested_or_condition = $merge
    ->orConditionGroup();
  $this
    ->assertIdentical($namespace, get_class($nested_or_condition));
}