.../modules/rest/tests/src/Functional/CookieResourceTestTrait.php | 2 +- .../src/Functional/EntityResource/EntityResourceTestBase.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php b/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php index c231ffb..18dc296 100644 --- a/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php +++ b/core/modules/rest/tests/src/Functional/CookieResourceTestTrait.php @@ -71,7 +71,7 @@ protected function initAuthentication() { $this->sessionCookie = explode(';', $response->getHeader('Set-Cookie')[0], 2)[0]; // Parse and store the CSRF token and logout token. - $data = $this->serializer->decode($response->getBody()->getContents(), static::$format); + $data = $this->serializer->decode((string)$response->getBody(), static::$format); $this->csrfToken = $data['csrf_token']; $this->logoutToken = $data['logout_token']; } diff --git a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php index 2d43a66..81cbdf5 100644 --- a/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php +++ b/core/modules/rest/tests/src/Functional/EntityResource/EntityResourceTestBase.php @@ -502,7 +502,7 @@ public function testPost() { if ($has_canonical_url) { $this->assertSame(415, $response->getStatusCode()); $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); - $this->assertContains(htmlspecialchars('No "Content-Type" request header specified'), $response->getBody()->getContents()); + $this->assertContains(htmlspecialchars('No "Content-Type" request header specified'), (string) $response->getBody()); } else { $this->assertResourceErrorResponse(415, 'No "Content-Type" request header specified', $response); @@ -702,7 +702,7 @@ public function testPatch() { if ($has_canonical_url) { $this->assertSame(415, $response->getStatusCode()); $this->assertSame(['text/html; charset=UTF-8'], $response->getHeader('Content-Type')); - $this->assertTrue(FALSE !== strpos($response->getBody()->getContents(), htmlspecialchars('No "Content-Type" request header specified'))); + $this->assertTrue(FALSE !== strpos((string) $response->getBody(), htmlspecialchars('No "Content-Type" request header specified'))); } else { $this->assertResourceErrorResponse(415, 'No "Content-Type" request header specified', $response); @@ -928,7 +928,7 @@ public function testDelete() { $this->assertSame(204, $response->getStatusCode()); // @todo Uncomment the following line when https://www.drupal.org/node/2821711 is fixed. // $this->assertSame(FALSE, $response->hasHeader('Content-Type')); - $this->assertSame('', $response->getBody()->getContents()); + $this->assertSame('', (string) $response->getBody()); $this->assertFalse($response->hasHeader('X-Drupal-Cache')); @@ -953,7 +953,7 @@ public function testDelete() { $this->assertSame(204, $response->getStatusCode()); // @todo Uncomment the following line when https://www.drupal.org/node/2821711 is fixed. // $this->assertSame(FALSE, $response->hasHeader('Content-Type')); - $this->assertSame('', $response->getBody()->getContents()); + $this->assertSame('', (string) $response->getBody()); $this->assertFalse($response->hasHeader('X-Drupal-Cache')); }