You are here

protected function FileUploadTest::assertResponseData in Drupal 9

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

Asserts expected normalized data matches response data.

Parameters

array $expected: The expected data.

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

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

... See full list

File

core/modules/jsonapi/tests/src/Functional/FileUploadTest.php, line 900

Class

FileUploadTest
Tests binary data file upload route.

Namespace

Drupal\Tests\jsonapi\Functional

Code

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