function FilterAPITest::testSleep

Tests that format entities are serialized without their plugin collection.

File

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

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.