function FilterAPITest::testSleep

Same name in other branches
  1. 9 core/modules/filter/tests/src/Kernel/FilterAPITest.php \Drupal\Tests\filter\Kernel\FilterAPITest::testSleep()
  2. 8.9.x core/modules/filter/tests/src/Kernel/FilterAPITest.php \Drupal\Tests\filter\Kernel\FilterAPITest::testSleep()
  3. 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 518

Class

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

Namespace

Drupal\Tests\filter\Kernel

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.