function FileUploadTest::assertResponseData

Same name in other branches
  1. 8.9.x core/modules/jsonapi/tests/src/Functional/FileUploadTest.php \Drupal\Tests\jsonapi\Functional\FileUploadTest::assertResponseData()
  2. 10 core/modules/jsonapi/tests/src/Functional/FileUploadTest.php \Drupal\Tests\jsonapi\Functional\FileUploadTest::assertResponseData()
  3. 11.x core/modules/jsonapi/tests/src/Functional/FileUploadTest.php \Drupal\Tests\jsonapi\Functional\FileUploadTest::assertResponseData()

Asserts expected normalized data matches response data.

@internal

Parameters

array $expected: The expected data.

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

9 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::testFileUploadNoDirectorySetting in core/modules/jsonapi/tests/src/Functional/FileUploadTest.php
Tests using the file upload POST route no directory configured.
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.

... See full list

File

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

Class

FileUploadTest
Tests binary data file upload route.

Namespace

Drupal\Tests\jsonapi\Functional

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.