You are here

public function HttpMimeTypeGuesserTest::dataParseFileNameFromUrl in Remote Stream Wrapper 8

File

tests/src/Kernel/HttpMimeTypeGuesserTest.php, line 64

Class

HttpMimeTypeGuesserTest
@coversDefaultClass \Drupal\remote_stream_wrapper\File\MimeType\HttpMimeTypeGuesser @group remote_stream_wrapper

Namespace

Drupal\Tests\remote_stream_wrapper\Kernel

Code

public function dataParseFileNameFromUrl() {
  return [
    [
      'http://www.example.com/file.txt',
      'file.txt',
    ],
    // Test adding query strings and fragments which should be ignored.
    [
      'http://www.example.com/test/file.txt.pdf?extension=.gif',
      'file.txt.pdf',
    ],
    [
      'http://www.example.com/FILE.PDF#foo',
      'FILE.PDF',
    ],
    [
      'http://www.example.com/',
      FALSE,
    ],
    [
      'http://www.example.com/test',
      FALSE,
    ],
    [
      '//www.example.com/test.unknown',
      'test.unknown',
    ],
  ];
}