diff --git a/core/modules/rest/tests/src/Functional/EntityResource/Term/TermResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/Term/TermResourceTestBase.php index b13250faaa..97599774b3 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/Term/TermResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/Term/TermResourceTestBase.php @@ -41,9 +41,11 @@ protected function setUpAuthorization($method) { case 'GET': $this->grantPermissionsToTestedRole(['access content']); break; + case 'POST': $this->grantPermissionsToTestedRole(['create terms in camelids']); break; + case 'PATCH': // Grant the 'create url aliases' permission to test the case when // the path field is accessible, see @@ -51,9 +53,11 @@ protected function setUpAuthorization($method) { // for a negative test. $this->grantPermissionsToTestedRole(['edit terms in camelids', 'create url aliases']); break; + case 'DELETE': $this->grantPermissionsToTestedRole(['delete terms in camelids']); break; + } } diff --git a/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php b/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php index aa6c02b0d2..f2245816cd 100644 --- a/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php +++ b/core/modules/taxonomy/tests/src/Functional/VocabularyPermissionsTest.php @@ -96,8 +96,6 @@ function testTaxonomyVocabularyOverviewPermissions() { $this->drupalLogin($no_permission_user); $this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary1_id . '/overview'); $assert_session->statusCodeEquals(403); - - // Visit vocabulary overview without terms. 'Add term' should not be shown. $this->drupalGet('admin/structure/taxonomy/manage/' . $vocabulary2_id . '/overview'); $assert_session->statusCodeEquals(403); @@ -240,7 +238,9 @@ public function testVocabularyPermissionsTaxonomyTerm() { $view_link = $this->xpath('//div[@class="messages"]//a[contains(@href, :href)]', [':href' => 'term/']); $this->assert(isset($view_link), 'The message area contains a link to a term'); - $terms = taxonomy_term_load_multiple_by_name($edit['name[0][value]']); + $terms = \Drupal::entityTypeManager() + ->getStorage('taxonomy_term') + ->loadByProperties(['name' => $edit['name[0][value]']]); $term = reset($terms); // Edit the term. @@ -278,7 +278,9 @@ public function testVocabularyPermissionsTaxonomyTerm() { $this->drupalPostForm(NULL, $edit, t('Save')); $assert_session->pageTextContains(t('Created new term @name.', ['@name' => $edit['name[0][value]']])); - $terms = taxonomy_term_load_multiple_by_name($edit['name[0][value]']); + $terms = \Drupal::entityTypeManager() + ->getStorage('taxonomy_term') + ->loadByProperties(['name' => $edit['name[0][value]']]); $term = reset($terms); // Ensure that edit and delete access is denied.