You are here

public function EntityConditionTest::testValidation in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Unit/Query/EntityConditionTest.php \Drupal\Tests\jsonapi\Unit\Query\EntityConditionTest::testValidation()
  2. 9 core/modules/jsonapi/tests/src/Unit/Query/EntityConditionTest.php \Drupal\Tests\jsonapi\Unit\Query\EntityConditionTest::testValidation()

@covers ::validate @dataProvider validationProvider

File

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

Class

EntityConditionTest
@coversDefaultClass \Drupal\jsonapi\Query\EntityCondition @group jsonapi

Namespace

Drupal\Tests\jsonapi\Unit\Query

Code

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