You are here

public function FilterAPITest::testSleep in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/filter/tests/src/Kernel/FilterAPITest.php \Drupal\Tests\filter\Kernel\FilterAPITest::testSleep()
  2. 10 core/modules/filter/tests/src/Kernel/FilterAPITest.php \Drupal\Tests\filter\Kernel\FilterAPITest::testSleep()

Tests that format entities are serialized without their plugin collection.

File

core/modules/filter/tests/src/Kernel/FilterAPITest.php, line 501

Class

FilterAPITest
Tests the behavior of the API of the Filter module.

Namespace

Drupal\Tests\filter\Kernel

Code

public function testSleep() {
  $filter_format = FilterFormat::load('filtered_html');
  $this
    ->assertNull($filter_format
    ->get('filterCollection'));
  $vars = $filter_format
    ->__sleep();
  $this
    ->assertContains('filters', $vars);
  $this
    ->assertNotContains('filterCollection', $vars);
}