MergeTest.php in Drupal driver for SQL Server and SQL Azure 3.1.x
File
tests/src/Kernel/MergeTest.php
View source
<?php
namespace Drupal\Tests\sqlsrv\Kernel;
use Drupal\KernelTests\Core\Database\DatabaseTestBase;
class MergeTest extends DatabaseTestBase {
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));
}
}