You are here

public function SanitizerHelperTest::testSanitizeWhenRealpathIsNotResolved in SVG Upload Sanitizer 8

File

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

Class

SanitizerHelperTest
Unit test class for the SanitizeHelper class.

Namespace

Drupal\Tests\svg_upload_sanitizer\Unit\Helper

Code

public function testSanitizeWhenRealpathIsNotResolved() {
  list($file) = $this
    ->prepareFile(FALSE);
  $this
    ->assertFalse($this->sanitizerHelper
    ->sanitize($file));
  $logs = $this->logger
    ->getLogs('notice');
  $this
    ->assertCount(1, $logs);
  $this
    ->assertSame('Could not resolve the path of the file (URI: "public://fileuri").', reset($logs));
}