Various tests in HEAD need to be corrected:
-
Various code + test code depends on System module, but does not specify a dependency.
(Because
run-tests.sh
itself requires functionality of System module, system.module is magically pre-loaded for all tests currently.) -
Various tests are calling
enableModules()
fromsetUp()
, which causes an unnecessary container rebuild for every test method. Usepublic static $modules
instead. -
Tons of tests are relying on overloaded class properties without declaring them.
-
Test methods are always public. Some test methods are not.
-
menu_link
module is gone, but various tests still try to enable it. -
email
module is gone for a long time already, but various tests still try to enable it. -
field_sql_storage
module is gone for a long time already, but various tests still try to enable it.
Comment | File | Size | Author |
---|---|---|---|
#15 | test.bogus_.15.patch | 46.7 KB | sun |
#15 | interdiff.txt | 3.14 KB | sun |
#8 | test.bogus_.8.patch | 48.26 KB | sun |
#7 | test.bogus_.7.patch | 44.65 KB | sun |
#5 | test.bogus_.5.patch | 40.89 KB | sun |
Comments
Comment #1
sunComment #2
sunComment #4
sunComment #5
sunComment #7
sunComment #8
sunRe-rolled against latest HEAD.
Also added PHPDoc for this previous hunk:
Comment #9
sunComment #10
alexpottConsidering the fact that you've not removed a single test entitling this issue "Lots of bogus tests" is unnecessarily confrontational and aggressive.
Comment #11
sunApologies, it wasn't my intention to make this sound confrontational or aggressive; language barriers - learn something new every day. :)
Comment #12
sunThe size of this patch is a bit misleading; it contains trivial quick fixes only.
Comment #13
ParisLiakos CreditAttribution: ParisLiakos commentedwould be nice to have comments in separate lines
cant see why this is related
why getting rid of DIRECTORY_SEPARATOR ?
Comment #14
BerdirLooks mostly fine to me, not sure why in some places properties are converted to camel case and in others not.
I'd rather clean up TextPlainUnitTest and stop using most of those IMHO pretty useless properties, will probably attempt to do that in #2313757: Remove text_processing option from text fields, expose existing string field types as plain text in UI, which currently removes the test but as mentioned by @yched, there is some useful test coverage, just need to switch to string/string.
But I'm also OK with moving forward with this to unblock the other issue.
Comment #15
sunResolved #13 — Sorry for 2) + 3), those changes are only required for #2304461: KernelTestBaseTNG™ and not here.
@Berdir:
re: Property name casing: Yeah, but it was painful enough to locate and figure out all of these instances (which required a few days of work), so I didn't have the energy to additionally change the property names everywhere. IMO, this patch is large enough already. If we care enough about rigidly applying coding standards to tests (I don't), then we can adjust affected tests in separate follow-up issue(s).
re:
TextPlainUnitTest
: Yes, that one is ugly. Would be great to refactor that test in that follow-up issue, as you suggested.Comment #16
ParisLiakos CreditAttribution: ParisLiakos commentedgreat cleanup, thanks
Comment #17
alexpottShould we not also be enabling the system module too?
How come?
Comment #18
sunre: 1) system module is already enabled by the base class of
QuickEditIntegrationTest
.re: 2) Technically this belongs to #2304461: KernelTestBaseTNG™; methods declared as final cannot be invoked from ReflectionClass (PHPUnit invokes every test method via ReflectionClass). There's no need for this test class method to be final.
Tentatively moving back to RTBC.
Comment #19
alexpottCommitted f9c1ff2 and pushed to 8.0.x. Thanks!
Comment #21
sunClosely related: #2322889: Various setUp() and tearDown() methods are not protected