function FilterAPITest::testSleep

Same name in other branches
  1. 8.9.x 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()
  3. 11.x 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 508

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);
}

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