add drupalGetTestFile method to drupal_web_test_case

justinrandell - March 4, 2009 - 20:08
Project:SimpleTest
Version:7.x-2.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:justinrandell
Status:needs work
Description

while working on #389040: fix bug in UserPictureTestCase::testWithGDinvalidSize, i noticed it was hard to just get a file bigger than a given size.

talked to boombatower about this in #drupal, here's a patch that adds this.

AttachmentSize
drupalGetTestFile.patch8.69 KB

#1

System Message - March 4, 2009 - 20:20
Status:needs review» needs work

The last submitted patch failed testing.

#2

c960657 - March 4, 2009 - 20:39

I think drupalGetTestFile() and drupalGetTestFiles() should take the same parameters, so the former can be a simple wrapper around the latter. Perhaps drupalGetTestFiles() could take an additional $count parameter.

I don't know why the existing implementation uses stat() rather than filesize(). Using filesize() seems like the obvious choice.

For now, positional parameters is probably fine, but it may be an idea to array-itize the parameters (like it was done in #255551: DX: Array-itize file_scan_directory()'s parameters).

#3

boombatower - March 4, 2009 - 21:38

I might just replace drupalGetTestFiles().

#4

hass - July 25, 2009 - 14:20

+

#5

boombatower - November 6, 2009 - 21:15
Project:Drupal» SimpleTest
Version:7.x-dev» 7.x-2.x-dev
Component:simpletest.module» Code
 
 

Drupal is a registered trademark of Dries Buytaert.