My plan is to create tests/files which will contain a set of text, image, and any other necessary files.

These files will be accessible through a function that will allow the test to specify a specific size, type, etc.

This would be useful in a number of tests, as well as tests I am currently writing.

I discussed this with chx and webchick who agree.

Files: 
CommentFileSizeAuthor
#2 simpletest_test_files.patch130.23 KBboombatower

Comments

webchick’s picture

Yep, I think this is a good idea. For example, image module, imagefield.module, upload module, and filefield module might all want to test what happens when you upload an image. Similarly, they might want to test what happens when you upload a BIG file, or a file with PHP in it, etc.

It makes sense for SimpleTest to provide some sample files like this that can be shared among all tests.

boombatower’s picture

Status: Active » Needs review
FileSize
130.23 KB

This patch provides function for getting a list of test files.

This patch doesn't include all the changes that will be made:

  • Current test images will be renamed to image-1, image-2 and moved into tests/files.
  • Tests referencing the images will be updated.

In order for this patch to work correctly you will need to remove the SimpleTest module from the system table and install it.

boombatower’s picture

Status: Needs review » Needs work

As webchick mentioned I should use the files directory since it should already have write access and the patch generates (writes) files.

boombatower’s picture

Status: Needs work » Fixed

Committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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