function ContentDispositionFilenameParserTest::testParseFilenameSuccess

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

Tests the parseFilename() method.

@covers ::parseFilename

File

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

Class

ContentDispositionFilenameParserTest
Tests the ContentDispositionFilenameParser class.

Namespace

Drupal\Tests\file\Unit\Upload

Code

public function testParseFilenameSuccess() : void {
    $request = $this->createRequest('filename="test.txt"');
    $filename = ContentDispositionFilenameParser::parseFilename($request);
    $this->assertEquals('test.txt', $filename);
}

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