'allowed_html' => '<p>',
],
],
- ]
+ ],
]);
$crazy_format->save();
$full_html_format = FilterFormat::load('full_html');
$this->assertIdentical(
$full_html_format->getHtmlRestrictions(),
- FALSE, // Every tag is allowed.
+ // Every tag is allowed.
+ FALSE,
'FilterFormatInterface::getHtmlRestrictions() works as expected for the full_html format.'
);
$this->assertIdentical(
'filter_html' => [
'status' => 1,
'settings' => [
- 'allowed_html' => '', // Nothing is allowed.
+ // Nothing is allowed.
+ 'allowed_html' => '',
],
],
],
$stupid_filtered_html_format->save();
$this->assertIdentical(
$stupid_filtered_html_format->getHtmlRestrictions(),
- ['allowed' => []], // No tag is allowed.
+ // No tag is allowed.
+ ['allowed' => []],
'FilterFormatInterface::getHtmlRestrictions() works as expected for the stupid_filtered_html format.'
);
$this->assertIdentical(
'a' => ['href' => TRUE],
'em' => TRUE,
],
- ]
+ ],
],
],
- ]
+ ],
]);
$very_restricted_html_format->save();
$this->assertIdentical(
'allowed_html' => '<a> <b class> <c class="*"> <d class="foo bar-* *">',
],
],
- ]
+ ],
]);
$nonsensical_restricted_html->save();
$this->assertIdentical(
/**
* Tests the 'processed_text' element.
*
- * check_markup() is a wrapper for the 'processed_text' element, for use in
- * simple scenarios; the 'processed_text' element has more advanced features:
- * it lets filters attach assets, associate cache tags and define
+ * Function check_markup() is a wrapper for the 'processed_text' element, for
+ * use in simple scenarios; the 'processed_text' element has more advanced
+ * features: it lets filters attach assets, associate cache tags and define
* #lazy_builder callbacks.
* This test focuses solely on those advanced features.
*/
'allowed_html' => '<p>',
],
],
- ]
+ ],
]);
$crazy_format->save();
// Use config to directly load the configuration and check that only enabled
drupal_static_reset('filter_formats');
\Drupal::entityManager()->getStorage('filter_format')->resetCache();
- $module_data = _system_rebuild_module_data();
+ $module_data = \Drupal::service('extension.list.module')->reset()->getList();
$this->assertFalse(isset($module_data['filter_test']->info['required']), 'The filter_test module is required.');
// Verify that a dependency exists on the module that provides the filter