function ConditionTest::testInvalidOperatorThrowsException
Same name and namespace in other branches
- main core/modules/pgsql/tests/src/Unit/EntityQuery/ConditionTest.php \Drupal\Tests\pgsql\Unit\EntityQuery\ConditionTest::testInvalidOperatorThrowsException()
Tests that an invalid operator throws an exception.
File
-
core/
modules/ pgsql/ tests/ src/ Unit/ EntityQuery/ ConditionTest.php, line 53
Class
Namespace
Drupal\Tests\pgsql\Unit\EntityQueryCode
public function testInvalidOperatorThrowsException() : void {
$sql_query = $this->createStub(SelectInterface::class);
$condition = [
'real_field' => 'field',
'operator' => 'LIKE',
'value' => [
'foo',
'bar',
],
];
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Invalid operator "LIKE"');
Condition::translateCondition($condition, $sql_query, FALSE);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.