Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
drupalGetTestFile.patch | 8.69 KB | Anonymous (not verified) | |
Comments
Comment #2
c960657 CreditAttribution: c960657 commentedI 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).
Comment #3
boombatower CreditAttribution: boombatower commentedI might just replace drupalGetTestFiles().
Comment #4
hass CreditAttribution: hass commented+
Comment #5
boombatower CreditAttribution: boombatower commentedComment #6
Anonymous (not verified) CreditAttribution: Anonymous commented