You are here

public function ConditionTest::testConditionClassDeprecation in Drupal 9

Tests the deprecation of the class Condition.

@group legacy

File

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

Class

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

Namespace

Drupal\Tests\Core\Database

Code

public function testConditionClassDeprecation() {
  $this
    ->expectDeprecation('Creating an instance of this class is deprecated in drupal:9.1.0 and is removed in drupal:10.0.0. Use Database::getConnection()->condition() instead. See https://www.drupal.org/node/3159568');
  $condition = new Condition('OR');
  $this
    ->assertSame('Drupal\\Core\\Database\\Query\\Condition', get_class($condition));
}