You are here

function FileNameMungingTest::testMungeIgnoreWhitelisted in SimpleTest 7

White listed extensions are ignored by file_munge_filename().

File

tests/file.test, line 2018
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, t('The new filename (%munged) matches the original (%original) once the extension has been whitelisted.', array(
    '%munged' => $munged_name,
    '%original' => $this->name,
  )));
}