You are here

public function VersionNegotiatorTest::testLatestVersion in JSON:API 8.2

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

File

tests/src/Kernel/Revisions/VersionNegotiatorTest.php, line 144

Class

VersionNegotiatorTest
The test class for version negotiators.

Namespace

Drupal\Tests\jsonapi\Kernel\Revisions

Code

public function testLatestVersion() {
  $revision = $this->versionNegotiator
    ->getRevision($this->node, 'rel:' . VersionByRel::LATEST_VERSION);
  $this
    ->assertEquals($this->node
    ->id(), $revision
    ->id());
  $this
    ->assertEquals($this->node
    ->getRevisionId(), $revision
    ->getRevisionId());
}