Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
phpunit
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Apr 2023 at 17:14 UTC
Updated:
6 Jul 2023 at 04:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mondrakeHere's a patch.
Comment #3
smustgrave commentedMarking this but there are 135 instances of Missing call to parent how are they being covered?
Comment #4
mondrake#3 see parent issue
Comment #5
longwaveHm, can DrupalKernelTest just override
bootKernel()to do nothing?Comment #6
mondrakePersonally, I think this is more readable and gives more flexibility, than starting to override the base methods that setup the environment. Also, this is kind of a reference issue for further work - there are other similar issues (see #3351236: Fix PHPStan L1 errors "Missing call to parent::setUp()/tearDown() method.") but for BrowserTestBase.
Comment #7
joachim commentedIf this method is about the boot level, could we give it a name that reflects that?
I'm really not keen on Foo()/doFoo() pairs.
Comment #8
mondrakeWould
::kernelSetUp()be a better option?Comment #9
longwavebootKernel()is currently private presumably because we don't really want downstream users messing with the kernel setup. Except in this test, where we do! I personally think the simplest solution is to makebootKernel()protected instead and then just override it. If other kernel tests really want to mess with the boot process we shouldn't stop them; I would perhaps argue differently if this was in runtime code, but as it's tests-only I think we can and should be more flexible here.Comment #10
mondrakeUhm then I think we should enlarge the scope of this issue to all remaining cases, and find a solution across them all.
Comment #11
longwaveAttached patch handles all remaining missing calls to
parent::setUp(). I think there is further simplification that can be done in UpdatePathTestBase (zlib check, update URL generator, etc) but that can be deferred to a followup.Comment #12
mondrakeLooks good and fixes the PHPStan reported errors. I would have preferred my own way… but that’s not matter to prevent rtbc. Thanks!
Comment #13
mondrakeneeds rebase
Comment #14
longwaveComment #15
smustgrave commentedRebase seems good.
Comment #16
quietone commentedNeeds a reroll.
longwave suggested a followup in #11. Has that been made?
Comment #17
gauravvvv commentedRe-rolled patch #14. Removed re-rolled tag. please review
Comment #18
mondrakeBack to RTBC
Comment #19
spokjeRerolled, opened follow-up #3360167: Simplification in UpdatePathTestBase (thanks @quietone)
Comment #21
spokjeComment #22
spokjeLooks like a random fail: https://www.drupal.org/project/drupal/issues/2829040#comment-15050937
Comment #23
smustgrave commentedYea a number of tickets are getting this random
Comment #25
spokjeComment #27
spokjeRerolled 3354063-19_0.patch on 11.x-dev in MR
Comment #30
longwaveCommitted and pushed 7e4ecad537 to 11.x (10.2.x). Thanks!