You are here

protected function FileUploadResourceTestBase::assertResponseData in Drupal 9

Same name and namespace in other branches
  1. 8 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.

7 calls to FileUploadResourceTestBase::assertResponseData()
FileUploadResourceTestBase::testFileUploadMaliciousExtension in core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
Tests using the file upload POST route with malicious extensions.
FileUploadResourceTestBase::testFileUploadNoExtensionSetting in core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
Tests using the file upload POST route no extension configured.
FileUploadResourceTestBase::testFileUploadStrippedFilePath in core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
Tests using the file upload route with any path prefixes being stripped.
FileUploadResourceTestBase::testFileUploadUnicodeFilename in core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
Tests using the file upload route with a unicode file name.
FileUploadResourceTestBase::testFileUploadZeroByteFile in core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php
Tests using the file upload route with a zero byte file.

... See full list

File

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

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);
}