function EntityConditionTest::testValidation

Same name in other branches
  1. 9 core/modules/jsonapi/tests/src/Unit/Query/EntityConditionTest.php \Drupal\Tests\jsonapi\Unit\Query\EntityConditionTest::testValidation()
  2. 8.9.x core/modules/jsonapi/tests/src/Unit/Query/EntityConditionTest.php \Drupal\Tests\jsonapi\Unit\Query\EntityConditionTest::testValidation()
  3. 10 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 78

Class

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

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.