function ConditionTest::testContribCondition

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Core/Database/ConditionTest.php \Drupal\Tests\Core\Database\ConditionTest::testContribCondition()
  2. 8.9.x core/tests/Drupal/Tests/Core/Database/ConditionTest.php \Drupal\Tests\Core\Database\ConditionTest::testContribCondition()
  3. 11.x core/tests/Drupal/Tests/Core/Database/ConditionTest.php \Drupal\Tests\Core\Database\ConditionTest::testContribCondition()

Tests that the core Condition can be overridden.

File

core/tests/Drupal/Tests/Core/Database/ConditionTest.php, line 189

Class

ConditionTest
@coversDefaultClass \Drupal\Core\Database\Query\Condition

Namespace

Drupal\Tests\Core\Database

Code

public function testContribCondition() : void {
    $connection = new StubConnection($this->createMock(StubPDO::class), [
        'namespace' => 'Drupal\\mock\\Driver\\Database\\mock',
        'prefix' => '',
    ]);
    $condition = $connection->condition('AND');
    $this->assertSame(StubCondition::class, get_class($condition));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.