You are here

public function SanitizerHelperTest::testSanitizeWhenFileDoesNotExist in SVG Upload Sanitizer 8

File

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

Class

SanitizerHelperTest
Unit test class for the SanitizeHelper class.

Namespace

Drupal\Tests\svg_upload_sanitizer\Unit\Helper

Code

public function testSanitizeWhenFileDoesNotExist() {
  list($file) = $this
    ->prepareFile(TRUE);
  $this
    ->assertFalse($this->sanitizerHelper
    ->sanitize($file));
  $logs = $this->logger
    ->getLogs('notice');
  $this
    ->assertCount(1, $logs);
  $this
    ->assertSame('The file does not exist (path: "something/that/will/never/exists.casper").', reset($logs));
}