.../Tests/Update/EntityResourcePermissionsUpdateTest.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/modules/rest/src/Tests/Update/EntityResourcePermissionsUpdateTest.php b/core/modules/rest/src/Tests/Update/EntityResourcePermissionsUpdateTest.php index ceb94d2..989159e 100644 --- a/core/modules/rest/src/Tests/Update/EntityResourcePermissionsUpdateTest.php +++ b/core/modules/rest/src/Tests/Update/EntityResourcePermissionsUpdateTest.php @@ -31,13 +31,17 @@ public function setDatabaseDumpFiles() { /** * Tests rest_update_8203(). */ - public function testAllowedHtmlUpdate() { + public function testBcEntityResourcePermissionSettingAdded() { $permission_handler = $this->container->get('user.permissions'); + $is_rest_resource_permission = function ($permission) { + return $permission['provider'] === 'rest' && (string) $permission['title'] !== 'Administer REST resource configuration'; + }; + // Make sure we have the expected values before the update. $rest_settings = $this->config('rest.settings'); $this->assertFalse(array_key_exists('bc_entity_resource_permissions', $rest_settings->getRawData())); - $this->assertFalse($permission_handler->moduleProvidesPermissions('rest')); + $this->assertEqual([], array_filter($permission_handler->getPermissions(), $is_rest_resource_permission)); $this->runUpdates(); @@ -45,11 +49,7 @@ public function testAllowedHtmlUpdate() { $rest_settings = $this->config('rest.settings'); $this->assertTrue(array_key_exists('bc_entity_resource_permissions', $rest_settings->getRawData())); $this->assertTrue($rest_settings->get('bc_entity_resource_permissions')); - $this->assertTrue($permission_handler->moduleProvidesPermissions('rest')); - $permissions = $permission_handler->getPermissions(); - $rest_permissions = array_keys(array_filter($permissions, function ($permission) { - return $permission['provider'] === 'rest'; - })); + $rest_permissions = array_keys(array_filter($permission_handler->getPermissions(), $is_rest_resource_permission)); $this->assertEqual(['restful delete entity:node', 'restful get entity:node', 'restful patch entity:node', 'restful post entity:node'], $rest_permissions); }