Loading core/modules/rest/tests/src/Functional/EntityResource/User/UserResourceTestBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,7 @@ public function testPatchDxForSecuritySensitiveBaseFields() { RequestOptions::HEADERS => [], RequestOptions::BODY => $this->serializer->encode($request_body, 'json'), ]; $response = $this->httpClient->request('POST', Url::fromRoute('user.login.http')->setRouteParameter('_format', 'json')->toString(), $request_options); $response = $this->request('POST', Url::fromRoute('user.login.http')->setRouteParameter('_format', 'json'), $request_options); $this->assertSame(200, $response->getStatusCode()); } Loading core/modules/rest/tests/src/Functional/ResourceTestBase.php +2 −10 Original line number Diff line number Diff line Loading @@ -93,11 +93,6 @@ abstract class ResourceTestBase extends BrowserTestBase { */ public static $modules = ['rest']; /** * @var \GuzzleHttp\ClientInterface */ protected $httpClient; /** * {@inheritdoc} */ Loading Loading @@ -135,10 +130,6 @@ public function setUp() { // Ensure there's a clean slate: delete all REST resource config entities. $this->resourceConfigStorage->delete($this->resourceConfigStorage->loadMultiple()); $this->refreshTestStateAfterRestConfigChange(); // Set up a HTTP client that accepts relative URLs. $this->httpClient = $this->container->get('http_client_factory') ->fromOptions(['base_uri' => $this->baseUrl]); } /** Loading Loading @@ -344,7 +335,8 @@ protected function grantPermissionsToTestedRole(array $permissions) { protected function request($method, Url $url, array $request_options) { $request_options[RequestOptions::HTTP_ERRORS] = FALSE; $request_options = $this->decorateWithXdebugCookie($request_options); return $this->httpClient->request($method, $url->toString(), $request_options); $client = $this->getSession()->getDriver()->getClient()->getClient(); return $client->request($method, $url->setAbsolute(TRUE)->toString(), $request_options); } /** Loading Loading
core/modules/rest/tests/src/Functional/EntityResource/User/UserResourceTestBase.php +1 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,7 @@ public function testPatchDxForSecuritySensitiveBaseFields() { RequestOptions::HEADERS => [], RequestOptions::BODY => $this->serializer->encode($request_body, 'json'), ]; $response = $this->httpClient->request('POST', Url::fromRoute('user.login.http')->setRouteParameter('_format', 'json')->toString(), $request_options); $response = $this->request('POST', Url::fromRoute('user.login.http')->setRouteParameter('_format', 'json'), $request_options); $this->assertSame(200, $response->getStatusCode()); } Loading
core/modules/rest/tests/src/Functional/ResourceTestBase.php +2 −10 Original line number Diff line number Diff line Loading @@ -93,11 +93,6 @@ abstract class ResourceTestBase extends BrowserTestBase { */ public static $modules = ['rest']; /** * @var \GuzzleHttp\ClientInterface */ protected $httpClient; /** * {@inheritdoc} */ Loading Loading @@ -135,10 +130,6 @@ public function setUp() { // Ensure there's a clean slate: delete all REST resource config entities. $this->resourceConfigStorage->delete($this->resourceConfigStorage->loadMultiple()); $this->refreshTestStateAfterRestConfigChange(); // Set up a HTTP client that accepts relative URLs. $this->httpClient = $this->container->get('http_client_factory') ->fromOptions(['base_uri' => $this->baseUrl]); } /** Loading Loading @@ -344,7 +335,8 @@ protected function grantPermissionsToTestedRole(array $permissions) { protected function request($method, Url $url, array $request_options) { $request_options[RequestOptions::HTTP_ERRORS] = FALSE; $request_options = $this->decorateWithXdebugCookie($request_options); return $this->httpClient->request($method, $url->toString(), $request_options); $client = $this->getSession()->getDriver()->getClient()->getClient(); return $client->request($method, $url->setAbsolute(TRUE)->toString(), $request_options); } /** Loading