You are here

public function SanitizerHelperTest::testSanitizeWhenMimeTypeIsNotSvg in SVG Upload Sanitizer 8

File

tests/src/Unit/Helper/SanitizerHelperTest.php, line 55

Class

SanitizerHelperTest
Unit test class for the SanitizeHelper class.

Namespace

Drupal\Tests\svg_upload_sanitizer\Unit\Helper

Code

public function testSanitizeWhenMimeTypeIsNotSvg() {
  $file = $this
    ->createMock(FileInterface::class);
  $file
    ->expects($this
    ->atLeastOnce())
    ->method('getMimeType')
    ->willReturn('image/png');
  $this
    ->assertFalse($this->sanitizerHelper
    ->sanitize($file));
}