function FileNameMungingTest::testMungeIgnoreWhitelisted
7.x file.test | FileNameMungingTest::testMungeIgnoreWhitelisted() |
White listed extensions are ignored by file_munge_filename().
File
- drupal-7.x/
modules/ simpletest/ tests/ file.test, line 2603 - This provides SimpleTests for the core file handling functionality. These include FileValidateTest and FileSaveTest.
Class
- FileNameMungingTest
- Tests for file_munge_filename() and file_unmunge_filename().
Code
function testMungeIgnoreWhitelisted() {
// Declare our extension as whitelisted.
$munged_name = file_munge_filename($this->name, $this->bad_extension);
$this->assertIdentical($munged_name, $this->name, format_string('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', array('%munged' => $munged_name, '%original' => $this->name)));
}