diff --git a/core/modules/rest/tests/src/Functional/EntityResource/Node/NodeResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/Node/NodeResourceTestBase.php index cfbd971..ca686df 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/Node/NodeResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/Node/NodeResourceTestBase.php @@ -12,7 +12,7 @@ /** * {@inheritdoc} */ - public static $modules = ['node']; + public static $modules = ['node', 'path']; /** * {@inheritdoc} @@ -30,6 +30,7 @@ 'sticky', 'revision_timestamp', 'revision_uid', + 'path', ]; /** @@ -49,6 +50,10 @@ protected function setUpAuthorization($method) { $this->grantPermissionsToTestedRole(['access content', 'create camelids content']); break; case 'PATCH': + // Do not grant the 'create url aliases' permission to test the case + // when the path field is protected/not accessible, see + // \Drupal\Tests\rest\Functional\EntityResource\Term\TermResourceTestBase + // for a positive test. $this->grantPermissionsToTestedRole(['access content', 'edit any camelids content']); break; case 'DELETE': @@ -77,6 +82,7 @@ protected function createEntity() { ->setCreatedTime(123456789) ->setChangedTime(123456789) ->setRevisionCreationTime(123456789) + ->set('path', '/llama') ->save(); return $node; @@ -171,6 +177,13 @@ protected function getExpectedNormalizedEntity() { ], ], 'revision_log' => [], + 'path' => [ + [ + 'alias' => '/llama', + 'pid' => '1', + 'langcode' => 'en', + ], + ], ]; }