$this->
expectException(FileException::
class);
$this->
expectExceptionMessage("Invalid filename 'a\xFFtest\x80€.txt'"
);
$file_system->
getDestinationFilename("core/misc/a\xFFtest\x80€.txt", FileSystemInterface::EXISTS_REPLACE
);
} /**
* Ensure that the getTempDirectory() method always returns a value.
*/
public function testFileDirectoryTemp() { $tmp_directory = \Drupal::
service('file_system'
)->
getTempDirectory();
$this->
assertNotEmpty($tmp_directory);
$this->
assertEquals($tmp_directory, FileSystem::
getOsTemporaryDirectory());
} /**
* Tests directory creation.
*/
public function testDirectoryCreation() { /** @var \Drupal\Core\File\FileSystemInterface $file_system */
$file_system =
$this->container->
get('file_system'
);
// mkdir() recursion should work with or without a trailing slash.
$dir =
$this->siteDirectory . '/files';