You are here

public function FileUploadSanitizeNameEventTest::testAllowedExtensions in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/File/FileUploadSanitizeNameEventTest.php \Drupal\Tests\Core\File\FileUploadSanitizeNameEventTest::testAllowedExtensions()

@covers ::getAllowedExtensions

File

core/tests/Drupal/Tests/Core/File/FileUploadSanitizeNameEventTest.php, line 53

Class

FileUploadSanitizeNameEventTest
FileUploadSanitizeNameEvent tests.

Namespace

Drupal\Tests\Core\File

Code

public function testAllowedExtensions() {
  $event = new FileUploadSanitizeNameEvent('foo.txt', '');
  $this
    ->assertSame([], $event
    ->getAllowedExtensions());
  $event = new FileUploadSanitizeNameEvent('foo.txt', 'gif png');
  $this
    ->assertSame([
    'gif',
    'png',
  ], $event
    ->getAllowedExtensions());
}