function FileUploadSanitizeNameEventTest::testConstructorException

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/Core/File/FileUploadSanitizeNameEventTest.php \Drupal\Tests\Core\File\FileUploadSanitizeNameEventTest::testConstructorException()
  2. 11.x core/tests/Drupal/Tests/Core/File/FileUploadSanitizeNameEventTest.php \Drupal\Tests\Core\File\FileUploadSanitizeNameEventTest::testConstructorException()

@covers ::__construct @covers ::setFilename

File

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

Class

FileUploadSanitizeNameEventTest
FileUploadSanitizeNameEvent tests.

Namespace

Drupal\Tests\Core\File

Code

public function testConstructorException() {
    $this->expectException(\InvalidArgumentException::class);
    $this->expectExceptionMessage('$filename must be a filename with no path information, "bar/foo.txt" provided');
    new FileUploadSanitizeNameEvent('bar/foo.txt', '');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.