3 namespace Drupal\Tests\views\Functional\Rest;
5 use Drupal\Tests\rest\Functional\EntityResource\EntityResourceTestBase;
6 use Drupal\views\Entity\View;
8 abstract class ViewResourceTestBase extends EntityResourceTestBase {
13 public static $modules = ['views'];
18 protected static $entityTypeId = 'view';
21 * @var \Drupal\views\ViewEntityInterface
28 protected function setUpAuthorization($method) {
29 $this->grantPermissionsToTestedRole(['administer views']);
35 protected function createEntity() {
36 $view = View::create([
38 'label' => 'Test REST',
47 protected function getExpectedNormalizedEntity() {
49 'base_field' => 'nid',
50 'base_table' => 'node',
56 'display_plugin' => 'default',
58 'display_title' => 'Master',
60 'display_options' => [
61 'display_extenders' => [],
66 'languages:language_interface',
74 'label' => 'Test REST',
79 'uuid' => $this->entity->uuid(),
86 protected function getNormalizedPostEntity() {
87 // @todo Update in https://www.drupal.org/node/2300677.
93 protected function getExpectedCacheContexts() {