getPrivateFilesystem example

/** * @internal */
#[Package('system-settings')] class DownloadServiceTest extends TestCase
{
    use IntegrationTestBehaviour;

    public function testUtf8Filename(): void
    {
        $filesystem = $this->getPrivateFilesystem();
        $fileRepository = $this->getContainer()->get('import_export_file.repository');

        $asciiName = 'Name with non-ascii chars';

        $fileData = [
            'id' => Uuid::randomHex(),
            'originalName' => $asciiName . ' öäüß',
            'path' => 'test.csv',
            'expireDate' => new \DateTime(),
        ];
        $filesystem->write($fileData['path']$fileData['originalName']);
        
Home | Imprint | This part of the site doesn't use cookies.