Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
tests
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Sep 2008 at 18:06 UTC
Updated:
14 Jul 2012 at 19:37 UTC
Jump to comment: Most recent file
This issue forked off of #203204: Uploaded files have the permissions set to 600 which is now postponed waiting on this.
Here's a file testing clean up patch that:
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | drupal-file-test-cleanup-310358-7.patch | 44.37 KB | webchick |
| #6 | file_test_cleanup.patch | 29.41 KB | drewish |
| #5 | file_test_cleanup.patch | 27.38 KB | drewish |
| #1 | file_test_cleanup.patch | 22.13 KB | drewish |
| file_test_cleanup.patch | 21.97 KB | drewish |
Comments
Comment #1
drewish commentedhere's a couple of cleanups suggested by cwgordon7
Comment #2
cwgordon7 commentedThis looks pretty good, much cleaner code overall. Small nitpick:
"File permissions set correctly." should probably be 'File permissions set correctly.' Same goes for the message below. Other than that, I can't actually find any problems with this patch, so it'll be pretty much rtbc then.
Comment #3
catchRan the tests and they go fine. For really nitpicky stuff, a few inline comments are missing full stops, it'd be nice if drupalwebtestcase handled the drupal_get_messages() but that's a different issue to this one. Some of the functions are missing phpdoc testFileDelete_Directory should probably be testFileDeleteDirectory unless there's a compelling reason why not. Looks good overall though.
Comment #4
webchickNice. This looks like a good clean-up.
While we're cleaning everything else up, can we please slap some one-liner PHPDoc on each of these test functions? I remember asking for that back when this patch originally got committed but it was late and I must've missed that they weren't there.
Could we please name that assertFilePermissions() or similar? To distinguish it from the user kind of permissions? I realize it's scoped with a class called FileTestCase, but even still, either could apply.
Also, $expected_mode doesn't match $mode in the PHPDoc above it.
Full stops / periods would be nice, as they'll save me time when committing. I agree with catch that testFileDelete_Directory is unconventional, and should be mooshed together since that's the standard, for better or worse.
I would normally say move the drupal_set_message() to drupal_web_test_case.php as part of another patch, but it's a really easy change, so let's just do it here as well.
Once these changes are made, I have no problem committing this.
Comment #5
drewish commentedI think the whole smooshed naming of functions standard or not is totally stupid. testFileDelete_Directory was named specifically to indicate which function is being tested and what specific aspect is being tested. Since I'm breaking it out to one target function per class I'll just name the test cases after the aspect that they're checking.
Comment #6
drewish commentedwhoops, that last patch was missing the file_test.* files
Comment #7
webchickAdded a comment above that line to explain it.
Removed the snark. :P
Also fixed a bunch of minor stuff like single/double quotes, re-wording some comments, concatenation spacing, capitalization, etc. since this /was/ a "clean-up" patch, after all. Reading over all the tests in depth made me once again very grateful that we have these tests... there is a LOT of tweaky stuff in there that would take eons to test manually. Thanks, drewish & co!
Here's the version I committed. Thanks!
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.