You are here

public function FileValidatorTest::testValidateFileExtension in Mini site 8

Test validateFileExtension() method.

@dataProvider dataProviderValidateFileExtension @covers \Drupal\minisite\FileValidator::validateFileExtension

File

tests/src/Unit/FileValidatorTest.php, line 29

Class

FileValidatorTest
Class FileValidatorTest.

Namespace

Drupal\Tests\minisite\Unit

Code

public function testValidateFileExtension($filename, $extensions) {
  $this
    ->expectException(InvalidExtensionValidatorException::class);
  $this
    ->expectExceptionMessage(sprintf('File %s has invalid extension.', $filename));
  FileValidator::validateFileExtension($filename, $extensions);
}