File sites/default/files/simpletest/text-5.txt was not allowed to be uploaded	Other	upload.test	109	UploadTestCase->testFilesFilter()

The testFilesFilter() fails trying to upload a .txt file when .html is the only allowed extension. The reason is that the file it's uploading is actually larger than 1MB and fails two limits causing the exact error message to not match.

This patch selects a file that is the correct size and breaks error message test into two parts: checking that the upload failed, then that it failed for the correct reason. It also adds an additional check to ensure that the HTML upload actually succeeded.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drewish’s picture

FileSize
3.81 KB

since testLimit() has the same type of error message comparison it seemed logical to fix that as well.

webchick’s picture

Would you be able to explain how to replicate this bug? My whole test suite is passing.

drewish’s picture

Title: UploadTestCase::testFilesFilter() fails » UploadTestCase::testFilesFilter() improvments
Category: bug » task

i dumped the files directory and reinstalled simpletest and the tests work correctly now. that said i think these changes are improvements in the tests that will make them less brittle. but in light of the fact that they're working for me now i'll change this to an improvement task.

drewish’s picture

Title: UploadTestCase::testFilesFilter() improvments » UploadTestCase improvements
Category: task » bug

Better title. Still applies cleanly and all upload tests pass.

drewish’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.