function FileSystemTest::testInvalidUTF8
Same name in other branches
- 9 core/tests/Drupal/Tests/Core/File/FileSystemTest.php \Drupal\Tests\Core\File\FileSystemTest::testInvalidUTF8()
- 10 core/tests/Drupal/Tests/Core/File/FileSystemTest.php \Drupal\Tests\Core\File\FileSystemTest::testInvalidUTF8()
- 11.x core/tests/Drupal/Tests/Core/File/FileSystemTest.php \Drupal\Tests\Core\File\FileSystemTest::testInvalidUTF8()
Tests that invalid UTF-8 results in an exception.
@covers ::createFilename
File
-
core/
tests/ Drupal/ Tests/ Core/ File/ FileSystemTest.php, line 162
Class
- FileSystemTest
- @coversDefaultClass \Drupal\Core\File\FileSystem
Namespace
Drupal\Tests\Core\FileCode
public function testInvalidUTF8() {
vfsStream::setup('dir');
$filename = "a\xffsdf\x80€" . '.txt';
$this->expectException(FileException::class);
$this->expectExceptionMessage("Invalid filename '{$filename}'");
$this->fileSystem
->createFilename($filename, 'vfs://dir');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.