function NameMungingTest::testMungeIgnoreInsecure

Same name in other branches
  1. 8.9.x core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php \Drupal\KernelTests\Core\File\NameMungingTest::testMungeIgnoreInsecure()

Test munging with system.file.allow_insecure_uploads set to true.

File

core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php, line 89

Class

NameMungingTest
Tests filename munging and unmunging.

Namespace

Drupal\KernelTests\Core\File

Code

public function testMungeIgnoreInsecure() {
    $this->config('system.file')
        ->set('allow_insecure_uploads', 1)
        ->save();
    $munged_name = file_munge_filename($this->name, '');
    $this->assertSame($munged_name, $this->name, new FormattableMarkup('The original filename (%original) matches the munged filename (%munged) when insecure uploads are enabled.', [
        '%munged' => $munged_name,
        '%original' => $this->name,
    ]));
}

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