You are here

public function VersionNegotiatorTest::testInvalidRevisionRel in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php \Drupal\Tests\jsonapi\Kernel\Revisions\VersionNegotiatorTest::testInvalidRevisionRel()
  2. 9 core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php \Drupal\Tests\jsonapi\Kernel\Revisions\VersionNegotiatorTest::testInvalidRevisionRel()

@covers \Drupal\jsonapi\Revisions\VersionByRel::getRevision

File

core/modules/jsonapi/tests/src/Kernel/Revisions/VersionNegotiatorTest.php, line 162

Class

VersionNegotiatorTest
The test class for version negotiators.

Namespace

Drupal\Tests\jsonapi\Kernel\Revisions

Code

public function testInvalidRevisionRel() {
  $this
    ->expectException(CacheableBadRequestHttpException::class);
  $this
    ->expectExceptionMessage('An invalid resource version identifier, `rel:erroneous-revision-name`, was provided.');
  $this->versionNegotiator
    ->getRevision($this->node, 'rel:erroneous-revision-name');
}