function FileUploadSanitizeNameEventTest::testAllowedExtensions
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/File/FileUploadSanitizeNameEventTest.php \Drupal\Tests\Core\File\FileUploadSanitizeNameEventTest::testAllowedExtensions()
- 11.x 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 55
Class
- FileUploadSanitizeNameEventTest
- FileUploadSanitizeNameEvent tests.
Namespace
Drupal\Tests\Core\FileCode
public function testAllowedExtensions() : void {
$event = new FileUploadSanitizeNameEvent('foo.txt', '');
$this->assertSame([], $event->getAllowedExtensions());
$event = new FileUploadSanitizeNameEvent('foo.txt', 'gif png');
$this->assertSame([
'gif',
'png',
], $event->getAllowedExtensions());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.