You are here

public function PreviewLinkStorageTest::testCreatePreviewLink in Preview Link 2.x

Same name and namespace in other branches
  1. 8 tests/src/Kernel/PreviewLinkStorageTest.php \Drupal\Tests\preview_link\Kernel\PreviewLinkStorageTest::testCreatePreviewLink()
  2. 2.0.x tests/src/Kernel/PreviewLinkStorageTest.php \Drupal\Tests\preview_link\Kernel\PreviewLinkStorageTest::testCreatePreviewLink()

Ensure preview link creation works.

File

tests/src/Kernel/PreviewLinkStorageTest.php, line 55

Class

PreviewLinkStorageTest
Preview link session test.

Namespace

Drupal\Tests\preview_link\Kernel

Code

public function testCreatePreviewLink() : void {
  $preview_link = PreviewLink::create()
    ->addEntity($this->node);
  $this
    ->assertIsString($preview_link
    ->getToken());
  $preview_link = PreviewLink::create()
    ->addEntity($this->node);
  $preview_link
    ->save();
  $this
    ->assertIsString($preview_link
    ->getToken());
}