You are here

public function HttpMimeTypeGuesserTest::testHttpMimeTypeGuessing in Remote Stream Wrapper 8

Test the mime type guessing with various HTTP URLs.

@covers ::guess @dataProvider dataHttpMimetypeGuessing

File

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

Class

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

Namespace

Drupal\Tests\remote_stream_wrapper\Kernel

Code

public function testHttpMimeTypeGuessing($url, $expected_result, $head_response = NULL, $get_response = NULL) {
  $client = $this
    ->prepareClient($url, $head_response, $get_response);
  $this->httpGuesser
    ->setHttpClient($client);
  $this
    ->assertEquals($expected_result, $this->guesser
    ->guess($url));
}