You are here

public function VersionNegotiatorTest::testOldRevision in JSON:API 8.2

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

File

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

Class

VersionNegotiatorTest
The test class for version negotiators.

Namespace

Drupal\Tests\jsonapi\Kernel\Revisions

Code

public function testOldRevision() {
  $revision = $this->versionNegotiator
    ->getRevision($this->node, 'id:' . $this->nodePreviousRevisionId);
  $this
    ->assertEquals($this->node
    ->id(), $revision
    ->id());
  $this
    ->assertEquals($this->nodePreviousRevisionId, $revision
    ->getRevisionId());
}