View source
<?php
namespace Drupal\Tests\filter\Functional\Rest;
use Drupal\filter\Entity\FilterFormat;
use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
abstract class FilterFormatResourceTestBase extends EntityResourceTestBase {
public static $modules = [];
protected static $entityTypeId = 'filter_format';
protected $entity;
protected function setUpAuthorization($method) {
$this
->grantPermissionsToTestedRole([
'administer filters',
]);
}
protected function createEntity() {
$pablo_format = FilterFormat::create([
'name' => 'Pablo Picasso',
'format' => 'pablo',
'langcode' => 'es',
'filters' => [
'filter_html' => [
'status' => TRUE,
'settings' => [
'allowed_html' => '<p> <a> <b> <lo>',
],
],
],
]);
$pablo_format
->save();
return $pablo_format;
}
protected function getExpectedNormalizedEntity() {
return [
'dependencies' => [],
'filters' => [
'filter_html' => [
'id' => 'filter_html',
'provider' => 'filter',
'status' => TRUE,
'weight' => -10,
'settings' => [
'allowed_html' => '<p> <a> <b> <lo>',
'filter_html_help' => TRUE,
'filter_html_nofollow' => FALSE,
],
],
],
'format' => 'pablo',
'langcode' => 'es',
'name' => 'Pablo Picasso',
'status' => TRUE,
'uuid' => $this->entity
->uuid(),
'weight' => 0,
];
}
protected function getNormalizedPostEntity() {
}
}