You are here

protected function TestFillPdfTrait::getMimeType in FillPDF 5.0.x

Same name and namespace in other branches
  1. 8.4 tests/src/Traits/TestFillPdfTrait.php \Drupal\Tests\fillpdf\Traits\TestFillPdfTrait::getMimeType()

Gets the MIME type.

@todo Consider using FileManagedTestBase::createFile() instead.

Parameters

string $content: Content to check for the MIME type.

Return value

string The MIME type.

See also

\Drupal\Tests\file\Functional\FileManagedTestBase::createFile()

5 calls to TestFillPdfTrait::getMimeType()
HandlePdfControllerTest::testDownloadAction in tests/src/Functional/HandlePdfControllerTest.php
Tests DownloadAction.
HandlePdfControllerTest::testRedirectAction in tests/src/Functional/HandlePdfControllerTest.php
Tests RedirectAction.
HandlePdfControllerTest::testSaveAction in tests/src/Functional/HandlePdfControllerTest.php
Tests SaveAction.
HandlePdfControllerTest::testTokenFilenameDestination in tests/src/Functional/HandlePdfControllerTest.php
Tests filename and destination of a populated PDF file.
PdfPopulationTest::backendTest in tests/src/Functional/PdfPopulationTest.php
Tests a backend.

File

tests/src/Traits/TestFillPdfTrait.php, line 163

Class

TestFillPdfTrait
Provides methods for testing FillPdf.

Namespace

Drupal\Tests\fillpdf\Traits

Code

protected function getMimeType($content) {
  $finfo = new \finfo(FILEINFO_MIME_TYPE);
  return $finfo
    ->buffer($content);
}