DeleteTruncateTest.php in Drupal driver for SQL Server and SQL Azure 3.0.x
File
tests/src/Kernel/DeleteTruncateTest.php
View source
<?php
namespace Drupal\Tests\sqlsrv\Kernel;
use Drupal\KernelTests\Core\Database\DatabaseTestBase;
class DeleteTruncateTest extends DatabaseTestBase {
public function testNamespaceConditionObject() {
$namespace = (new \ReflectionObject($this->connection))
->getNamespaceName() . "\\Condition";
$delete = $this->connection
->delete('test');
$reflection = new \ReflectionObject($delete);
$condition_property = $reflection
->getProperty('condition');
$condition_property
->setAccessible(TRUE);
$this
->assertIdentical($namespace, get_class($condition_property
->getValue($delete)));
$nested_and_condition = $delete
->andConditionGroup();
$this
->assertIdentical($namespace, get_class($nested_and_condition));
$nested_or_condition = $delete
->orConditionGroup();
$this
->assertIdentical($namespace, get_class($nested_or_condition));
}
}