function EntityConditionTest::testValidation

Tests validation.

@legacy-covers ::validate

Attributes

#[DataProvider('validationProvider')]

File

core/modules/jsonapi/tests/src/Unit/Query/EntityConditionTest.php, line 85

Class

EntityConditionTest
Tests Drupal\jsonapi\Query\EntityCondition.

Namespace

Drupal\Tests\jsonapi\Unit\Query

Code

public function testValidation($input, $exception) : void {
  if ($exception) {
    $this->expectException(get_class($exception));
    $this->expectExceptionMessage($exception->getMessage());
  }
  EntityCondition::createFromQueryParameter($input);
  $this->assertNull($exception, 'No exception was expected.');
}

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