You are here

protected function FileUploadResourceTestBase::assertResponseData in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php \Drupal\Tests\rest\Functional\FileUploadResourceTestBase::assertResponseData()
  2. 9 core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php \Drupal\Tests\rest\Functional\FileUploadResourceTestBase::assertResponseData()

Asserts expected normalized data matches response data.

Parameters

array $expected: The expected data.

\Psr\Http\Message\ResponseInterface $response: The file upload response.

File

core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php, line 809

Class

FileUploadResourceTestBase
Tests binary data file upload route.

Namespace

Drupal\Tests\rest\Functional

Code

protected function assertResponseData(array $expected, ResponseInterface $response) {
  static::recursiveKSort($expected);
  $actual = $this->serializer
    ->decode((string) $response
    ->getBody(), static::$format);
  static::recursiveKSort($actual);
  $this
    ->assertSame($expected, $actual);
}