function ContentDispositionFilenameParserTest::testParseFilenameExtended

Same name in other branches
  1. 11.x core/modules/file/tests/src/Unit/Upload/ContentDispositionFilenameParserTest.php \Drupal\Tests\file\Unit\Upload\ContentDispositionFilenameParserTest::testParseFilenameExtended()

@covers ::parseFilename

File

core/modules/file/tests/src/Unit/Upload/ContentDispositionFilenameParserTest.php, line 55

Class

ContentDispositionFilenameParserTest
Tests the ContentDispositionFilenameParser class.

Namespace

Drupal\Tests\file\Unit\Upload

Code

public function testParseFilenameExtended() : void {
    $this->expectException(BadRequestHttpException::class);
    $this->expectExceptionMessage('The extended "filename*" format is currently not supported in the "Content-Disposition" header.');
    $request = $this->createRequest('filename*="UTF-8 \' \' example.txt"');
    $filename = ContentDispositionFilenameParser::parseFilename($request);
}

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