protected function SerializationTest::createPageVariant in Page Manager 8
Same name and namespace in other branches
- 8.4 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 79 - Contains \Drupal\Tests\page_manager\Kernel\SerializationTest.
Class
- SerializationTest
- Tests the serialization of the entities we provide.
Namespace
Drupal\Tests\page_manager\KernelCode
protected function createPageVariant() {
return PageVariant::create([
'id' => $this
->randomMachineName(),
'label' => $this
->randomString(),
'weight' => 0,
'variant' => 'block_display',
]);
}