You are here

public function VersionNegotiatorTest::testCurrentVersion in Drupal 9

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

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

File

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

Class

VersionNegotiatorTest
The test class for version negotiators.

Namespace

Drupal\Tests\jsonapi\Kernel\Revisions

Code

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