Commit f72d6002 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2866056 by vaplas, mpdonadio, Wim Leers, dawehner: ResourceTestBase...

Issue #2866056 by vaplas, mpdonadio, Wim Leers, dawehner: ResourceTestBase should not have a timeout

(cherry picked from commit 3e208146)
parent d1de3df7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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());
  }

+2 −10
Original line number Diff line number Diff line
@@ -93,11 +93,6 @@ abstract class ResourceTestBase extends BrowserTestBase {
   */
  public static $modules = ['rest'];

  /**
   * @var \GuzzleHttp\ClientInterface
   */
  protected $httpClient;

  /**
   * {@inheritdoc}
   */
@@ -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]);
  }

  /**
@@ -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);
  }

  /**