diff --git a/core/modules/file/src/Tests/ValidatorTest.php b/core/modules/file/src/Tests/ValidatorTest.php index d7f3af3..54c7173 100644 --- a/core/modules/file/src/Tests/ValidatorTest.php +++ b/core/modules/file/src/Tests/ValidatorTest.php @@ -45,6 +45,15 @@ function testFileValidateExtensions() { } /** + * Test the file_munge_filename() function. + */ + function testFileMungeFilename() { + $this->assertNotEqual('file.foo.txt', file_munge_filename('file.foo.txt', 'asdf txt pork', FALSE), 'Altered invalid extra extension.', 'File'); + $this->assertEqual('file.asdf.txt', file_munge_filename('file.asdf.txt', 'asdf txt pork', FALSE), 'Accepted valid same case extra extension.', 'File'); + $this->assertEqual('file.Asdf.txt', file_munge_filename('file.Asdf.txt', 'asdf txt pork', FALSE), 'Accepted valid different case extra extension.', 'File'); + } + + /** * This ensures a specific file is actually an image. */ function testFileValidateIsImage() {