3 namespace Drupal\Tests\filter\Functional\Rest;
5 use Drupal\filter\Entity\FilterFormat;
6 use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
8 abstract class FilterFormatResourceTestBase extends EntityResourceTestBase {
13 public static $modules = [];
18 protected static $entityTypeId = 'filter_format';
21 * @var \Drupal\filter\FilterFormatInterface
28 protected function setUpAuthorization($method) {
29 $this->grantPermissionsToTestedRole(['administer filters']);
35 protected function createEntity() {
36 $pablo_format = FilterFormat::create([
37 'name' => 'Pablo Piccasso',
44 'allowed_html' => '<p> <a> <b> <lo>',
49 $pablo_format->save();
56 protected function getExpectedNormalizedEntity() {
61 'id' => 'filter_html',
62 'provider' => 'filter',
66 'allowed_html' => '<p> <a> <b> <lo>',
67 'filter_html_help' => TRUE,
68 'filter_html_nofollow' => FALSE,
74 'name' => 'Pablo Piccasso',
76 'uuid' => $this->entity->uuid(),
84 protected function getNormalizedPostEntity() {
85 // @todo Update in https://www.drupal.org/node/2300677.