function ContentDispositionFilenameParserTest::testParseFilenameMissing

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

@covers ::parseFilename

File

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

Class

ContentDispositionFilenameParserTest
Tests the ContentDispositionFilenameParser class.

Namespace

Drupal\Tests\file\Unit\Upload

Code

public function testParseFilenameMissing() : void {
    $this->expectException(BadRequestHttpException::class);
    $this->expectExceptionMessage('"Content-Disposition" header is required. A file name in the format "filename=FILENAME" must be provided.');
    $request = new Request();
    ContentDispositionFilenameParser::parseFilename($request);
}

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