function ConditionTest::testCaseSensitiveArrayConditionIsNotValidated

Same name and namespace in other branches
  1. main core/modules/pgsql/tests/src/Unit/EntityQuery/ConditionTest.php \Drupal\Tests\pgsql\Unit\EntityQuery\ConditionTest::testCaseSensitiveArrayConditionIsNotValidated()

Tests that case-sensitive conditions are not affected by the validation.

File

core/modules/pgsql/tests/src/Unit/EntityQuery/ConditionTest.php, line 71

Class

ConditionTest
Tests \Drupal\pgsql\EntityQuery\Condition.

Namespace

Drupal\Tests\pgsql\Unit\EntityQuery

Code

public function testCaseSensitiveArrayConditionIsNotValidated() : void {
  $sql_query = $this->createStub(SelectInterface::class);
  $condition = [
    'real_field' => 'field',
    'operator' => 'LIKE',
    'value' => [
      'foo',
      'bar',
    ],
  ];
  // No exception should be thrown for case-sensitive conditions.
  Condition::translateCondition($condition, $sql_query, TRUE);
  $this->assertArrayNotHasKey('where', $condition);
}

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