function FileUploadResourceTestBase::assertResponseData

Same name in other branches
  1. 8.9.x core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php \Drupal\Tests\rest\Functional\FileUploadResourceTestBase::assertResponseData()
  2. 10 core/modules/rest/tests/src/Functional/FileUploadResourceTestBase.php \Drupal\Tests\rest\Functional\FileUploadResourceTestBase::assertResponseData()
  3. 11.x 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 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);
}

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