As if we wouldn't know that System module is a dumping ground for literally anything, it seems we just went ahead and continued that paradigm with tests.
Attached patch
- moves all tests belonging to common.inc into a new "Common" group.
- fixes various titles and descriptions of affected test cases.
- also attempts to clean up tests in system.test, by prepending "System" to the test case class name if it clearly belongs to System module. However, that's just a simple attempt - properly moving and classifying the test cases in system.test should be a separate issue. The current file contents are a pain.
Comments
Comment #1
sunComment #2
sunFeedback anyone?
Otherwise, this is pretty much RTBC.
Comment #3
reglogge commentedTested the patch and can confirm that it really cleans things up nicely :-)
Comment #4
dave reidthis is a bug report...how?
Comment #5
sunHow else can you call wrong group assignments and wrong/misleading test case class names?
Comment #6
sundrupal.declutter-system.0.patch queued for re-testing.
Comment #8
sunRe-rolled against HEAD.
Comment #9
sunThis was RTBC before, just re-rolled against HEAD, so back to RTBC.
Comment #10
sun#8: drupal.declutter-system.8.patch queued for re-testing.
Comment #11
sun#8: drupal.declutter-system.8.patch queued for re-testing.
Comment #12
sun#8: drupal.declutter-system.8.patch queued for re-testing.
Comment #13
sun#8: drupal.declutter-system.8.patch queued for re-testing.
Comment #14
webchickSorry, this would invalidate documentation at this point that talks about where to find tests, and we ended the period of being able to make "would be nice" string fixes in December of last year.
Bumping to D8.
Comment #15
sun#8: drupal.declutter-system.8.patch queued for re-testing.
Comment #17
sunRe-rolled against HEAD.
Comment #18
webchickSince you gave me a nice review at #1397246: Add drupal_array_unset_nested_value(), I'm yoinking this so I can drive it home for you. :) Hope that's ok.
This'll need a re-roll for /core if nothing else.
Comment #19
webchickAlso, this is classic Novice material.
Comment #20
webchickAh-hahahaa. No, no it is not. :)
However, I don't think the patch as-is is very committable. It's combining at least the following things:
- Changes the 'System' group to 'XXX' where XXX matches XXX.test.
- Prefixes 'Common', 'System', and so on the name of all test cases, based on which file it belongs to (e.g. common.test, system.test).
- Makes sure all test case names end in 'TestCase'.
- Removes differentiation between "FunctionalTestCase" and "UnitTestCase". Just "TestCase".
- Renames some tests, though I can't quite figure out the pattern on that one. It doesn't seem to be following any recommendations listed in http://drupal.org/node/325974.
Then in going through I also noticed that:
- Lots of files are missing @file declarations
- Lots of files are missing PHPDoc
- Lots of comments don't wrap at 80 chars
- Lots of test cases are named incorrectly or unclearly ("testActionSomething" instead of "testAction*s*Something")
So I sat down to fix these, and quickly it was growing into a gigantic monster patch that would be completely unreviewable, terrifying to commit, and also prone to mass breakage by other patches.
So I think what I'm going to do is turn this one into a "Meta" issue, and then spin off these into separate, actually novice issues. :)
Comment #21
webchickHrm. Except that's not ideal either, because they'll frequently collide with re-rolls.
Ok, I give up. :) I'm going to see if I can track you down in IRC.
Comment #22
webchickTalked to sun. We agreed to reduce the scope of this to only common.test, which I fully agree needs a LOT of clean-up. Re-titling.
Comment #23
webchickOk, here's some easy stuff:
- group => 'System' to 'Common'
- prefix all test case classes with 'Common'
- Makes all test case names consistently end in 'TestCase', per standards
I didn't touch the name/description changes, because I couldn't derive a pattern there, and the simpletest coding standards are silent on this point.
Note that this will conflict with #1397246: Add drupal_array_unset_nested_value() so if that one gets in first, this will need a re-roll and vice-versa.
Not sure if my mad find/replace skillz broke anything, so let's see...
Comment #25
sunRestored/re-did some oversights. I'm not able to reproduce the test failure of #23.
Looks RTBC to me if it comes back green.
Comment #26
webchickLooks good!
Comment #27
catchCommitted/pushed to 8.x, thanks!