function _pathologic_build_format in Pathologic 8
Build a text format with Pathologic configured a certain way.
Parameters
$settings: An array of settings for the Pathologic instance on the format.
Return value
A format machine name (consisting of random characters) for the format.
1 call to _pathologic_build_format()
- PathologicTest::testPathologic in tests/
src/ Functional/ PathologicTest.php
File
- tests/
src/ Functional/ PathologicTest.php, line 305
Namespace
Drupal\Tests\pathologic\FunctionalCode
function _pathologic_build_format($settings) {
$format_id = user_password();
$format = FilterFormat::create([
'format' => $format_id,
'name' => $format_id,
]);
$format
->setFilterConfig('filter_pathologic', [
'status' => 1,
'settings' => $settings,
]);
$format
->save();
return $format_id;
}