You are here

protected function SerializationTest::assertSerialization 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::assertSerialization()

Assert that an object successfully serializes and unserializes.

Parameters

object $object: The object to serialize.

string $message:

Return value

object The unserialized object.

4 calls to SerializationTest::assertSerialization()
SerializationTest::testHttpStatusCodeVariantPlugin in tests/src/Kernel/SerializationTest.php
Test serialization of a block_display variant plugin.
SerializationTest::testPage in tests/src/Kernel/SerializationTest.php
Test serialization of a page.
SerializationTest::testPageBlockVariantPlugin in tests/src/Kernel/SerializationTest.php
Test serialization of a block_display variant plugin.
SerializationTest::testPageVariant in tests/src/Kernel/SerializationTest.php
Test serialization of a variant.

File

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

Class

SerializationTest
Tests the serialization of the entities we provide.

Namespace

Drupal\Tests\page_manager\Kernel

Code

protected function assertSerialization($object, $message = '') {
  $unserialized = unserialize(serialize($object));
  $this
    ->assertInstanceOf(get_class($object), $unserialized, $message);
  return $unserialized;
}