From 6d0a2eaa46e89363b17c260cceb82ba5b740a65c Mon Sep 17 00:00:00 2001 From: xjm Date: Sun, 3 Dec 2017 11:34:14 -0600 Subject: [PATCH] Issue #2927766 by Wim Leers: Update ResponseGeneratorTest to use the BrowserTestBase base class instead of the deprecated RESTTestBase --- .../Functional}/System/ResponseGeneratorTest.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) rename core/modules/system/{src/Tests => tests/src/Functional}/System/ResponseGeneratorTest.php (81%) diff --git a/core/modules/system/src/Tests/System/ResponseGeneratorTest.php b/core/modules/system/tests/src/Functional/System/ResponseGeneratorTest.php similarity index 81% rename from core/modules/system/src/Tests/System/ResponseGeneratorTest.php rename to core/modules/system/tests/src/Functional/System/ResponseGeneratorTest.php index a535b66c427..592364636d9 100644 --- a/core/modules/system/src/Tests/System/ResponseGeneratorTest.php +++ b/core/modules/system/tests/src/Functional/System/ResponseGeneratorTest.php @@ -1,15 +1,16 @@ drupalCreateContentType(['type' => 'page', 'name' => 'Basic page']); - $permissions = $this->entityPermissions('node', 'view'); - $account = $this->drupalCreateUser($permissions); + $account = $this->drupalCreateUser(['access content']); $this->drupalLogin($account); } @@ -54,14 +54,14 @@ class ResponseGeneratorTest extends RESTTestBase { // Enable cookie-based authentication for the entity:node REST resource. /** @var \Drupal\rest\RestResourceConfigInterface $resource_config */ - $resource_config = $this->resourceConfigStorage->load('entity.node'); + $resource_config = RestResourceConfig::load('entity.node'); $configuration = $resource_config->get('configuration'); $configuration['authentication'][] = 'cookie'; $resource_config->set('configuration', $configuration)->save(); - $this->rebuildCache(); + $this->rebuildAll(); // Tests to see if this also works for a non-html request - $this->httpRequest($node->urlInfo()->setOption('query', ['_format' => 'hal_json']), 'GET'); + $this->drupalGet($node->toUrl()->setOption('query', ['_format' => 'hal_json'])); $this->assertResponse(200); $this->assertEqual('application/hal+json', $this->drupalGetHeader('Content-Type')); $this->assertEqual($expectedGeneratorHeader, $this->drupalGetHeader('X-Generator'));