You are here

public function FileHelperTest::testUpdateSizeWhenTheFileCouldNotBeSaved in SVG Upload Sanitizer 8

File

tests/src/Unit/Helper/FileHelperTest.php, line 76

Class

FileHelperTest
Unit test class for the FileHelper class.

Namespace

Drupal\Tests\svg_upload_sanitizer\Unit\Helper

Code

public function testUpdateSizeWhenTheFileCouldNotBeSaved() {
  list($file, $filePath) = $this
    ->prepareUpdateSize(TRUE, TRUE, FALSE);
  $file
    ->expects($this
    ->atLeastOnce())
    ->method('id')
    ->willReturn(28);
  $this
    ->assertTrue($this->fileHelper
    ->updateSize($file));
  $logs = $this->logger
    ->getLogs('error');
  $this
    ->assertCount(1, $logs);
  $this
    ->assertSame(sprintf('Could not save the file (fid: "28", path: "%s").', $filePath), reset($logs));
}