You are here

protected function SerializationTest::createPageVariant in Page Manager 8.4

Same name and namespace in other branches
  1. 8 tests/src/Kernel/SerializationTest.php \Drupal\Tests\page_manager\Kernel\SerializationTest::createPageVariant()

Create a basic page variant.

Return value

\Drupal\page_manager\Entity\PageVariant

2 calls to SerializationTest::createPageVariant()
SerializationTest::testPage in tests/src/Kernel/SerializationTest.php
Test serialization of a page.
SerializationTest::testPageVariant in tests/src/Kernel/SerializationTest.php
Test serialization of a variant.

File

tests/src/Kernel/SerializationTest.php, line 74

Class

SerializationTest
Tests the serialization of the entities we provide.

Namespace

Drupal\Tests\page_manager\Kernel

Code

protected function createPageVariant() {
  return PageVariant::create([
    'id' => $this
      ->randomMachineName(),
    'label' => $this
      ->randomString(),
    'weight' => 0,
    'variant' => 'block_display',
  ]);
}