src/Access/TemporaryQueryGuard.php | 13 ------------- tests/src/Functional/BlockTest.php | 2 +- tests/src/Functional/ConfigTestTest.php | 2 +- tests/src/Functional/MenuLinkContentTest.php | 2 +- tests/src/Functional/ShortcutSetTest.php | 2 +- tests/src/Functional/TermTest.php | 7 +------ tests/src/Functional/UserTest.php | 4 ++-- 7 files changed, 7 insertions(+), 25 deletions(-) diff --git a/src/Access/TemporaryQueryGuard.php b/src/Access/TemporaryQueryGuard.php index 618e48e..8150350 100644 --- a/src/Access/TemporaryQueryGuard.php +++ b/src/Access/TemporaryQueryGuard.php @@ -374,15 +374,6 @@ class TemporaryQueryGuard { $cacheability->addCacheTags($entity_type->getListCacheTags()); } } - // @todo Remove when Drupal 8.5 support is dropped (terms are publishable in >=8.6). - if (floatval(\Drupal::VERSION) < 8.6 && $entity_type->id() === 'taxonomy_term') { - $access_result = $access_results[JSONAPI_FILTER_AMONG_PUBLISHED]; - $cacheability->addCacheableDependency($access_result); - if ($access_result->isAllowed()) { - $conditions[] = new EntityCondition('tid', 0, '>'); - $cacheability->addCacheTags($entity_type->getListCacheTags()); - } - } // The "enabled" subset. // @todo Remove ternary when the 'status' key is added to the User entity type. @@ -399,10 +390,6 @@ class TemporaryQueryGuard { // The "owner" subset. // @todo Remove ternary when the 'uid' key is added to the User entity type. $owner_field_name = $entity_type->id() === 'user' ? 'uid' : $entity_type->getKey('owner'); - // @todo Remove when Drupal 8.5 and 8.6 support is dropped. - if (floatval(\Drupal::VERSION) < 8.7) { - $owner_field_name = $entity_type->id() === 'user' ? $owner_field_name : $entity_type->getKey('uid'); - } if ($owner_field_name) { $access_result = $access_results[JSONAPI_FILTER_AMONG_OWN]; $cacheability->addCacheableDependency($access_result); diff --git a/tests/src/Functional/BlockTest.php b/tests/src/Functional/BlockTest.php index 9f26396..452b5ef 100644 --- a/tests/src/Functional/BlockTest.php +++ b/tests/src/Functional/BlockTest.php @@ -156,7 +156,7 @@ class BlockTest extends ResourceTestBase { protected function getExpectedUnauthorizedAccessMessage($method) { switch ($method) { case 'GET': - return floatval(\Drupal::VERSION >= 8.7) ? "The block visibility condition 'user_role' denied access." : ''; + return "The block visibility condition 'user_role' denied access."; default: return parent::getExpectedUnauthorizedAccessMessage($method); diff --git a/tests/src/Functional/ConfigTestTest.php b/tests/src/Functional/ConfigTestTest.php index df8da49..e6d873d 100644 --- a/tests/src/Functional/ConfigTestTest.php +++ b/tests/src/Functional/ConfigTestTest.php @@ -47,7 +47,7 @@ class ConfigTestTest extends ResourceTestBase { protected function getExpectedUnauthorizedAccessMessage($method) { switch ($method) { case 'GET': - return floatval(\Drupal::VERSION >= 8.7) ? "The 'view config_test' permission is required." : ''; + return "The 'view config_test' permission is required."; default: return parent::getExpectedUnauthorizedAccessMessage($method); diff --git a/tests/src/Functional/MenuLinkContentTest.php b/tests/src/Functional/MenuLinkContentTest.php index c60d162..2e6b04c 100644 --- a/tests/src/Functional/MenuLinkContentTest.php +++ b/tests/src/Functional/MenuLinkContentTest.php @@ -139,7 +139,7 @@ class MenuLinkContentTest extends ResourceTestBase { protected function getExpectedUnauthorizedAccessMessage($method) { switch ($method) { case 'DELETE': - return floatval(\Drupal::VERSION >= 8.7) ? "The 'administer menu' permission is required." : ''; + return "The 'administer menu' permission is required."; default: return parent::getExpectedUnauthorizedAccessMessage($method); diff --git a/tests/src/Functional/ShortcutSetTest.php b/tests/src/Functional/ShortcutSetTest.php index 2eea948..0ab41a3 100644 --- a/tests/src/Functional/ShortcutSetTest.php +++ b/tests/src/Functional/ShortcutSetTest.php @@ -60,7 +60,7 @@ class ShortcutSetTest extends ResourceTestBase { protected function getExpectedUnauthorizedAccessMessage($method) { switch ($method) { case 'GET': - return floatval(\Drupal::VERSION >= 8.7) ? "The 'access shortcuts' permission is required." : ''; + return "The 'access shortcuts' permission is required."; default: return parent::getExpectedUnauthorizedAccessMessage($method); diff --git a/tests/src/Functional/TermTest.php b/tests/src/Functional/TermTest.php index a058e48..cce7732 100644 --- a/tests/src/Functional/TermTest.php +++ b/tests/src/Functional/TermTest.php @@ -478,12 +478,7 @@ class TermTest extends ResourceTestBase { * {@inheritdoc} */ public function testCollectionFilterAccess() { - if (floatval(\Drupal::VERSION) >= 8.6) { - $this->doTestCollectionFilterAccessForPublishableEntities('name', 'access content', 'administer taxonomy'); - } - else { - $this->doTestCollectionFilterAccessBasedOnPermissions('name', 'access content'); - } + $this->doTestCollectionFilterAccessBasedOnPermissions('name', 'access content'); } } diff --git a/tests/src/Functional/UserTest.php b/tests/src/Functional/UserTest.php index a7f2529..926c314 100644 --- a/tests/src/Functional/UserTest.php +++ b/tests/src/Functional/UserTest.php @@ -172,10 +172,10 @@ class UserTest extends ResourceTestBase { return "The 'access user profiles' permission is required and the user must be active."; case 'PATCH': - return floatval(\Drupal::VERSION >= 8.7) ? "Users can only update their own account, unless they have the 'administer users' permission." : ''; + return "Users can only update their own account, unless they have the 'administer users' permission."; case 'DELETE': - return floatval(\Drupal::VERSION >= 8.7) ? "The 'cancel account' permission is required." : ''; + return "The 'cancel account' permission is required."; default: return parent::getExpectedUnauthorizedAccessMessage($method);