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