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.
The DrupalKernel in DrupalUnitTestBase should not be dumped.
Comment | File | Size | Author |
---|---|---|---|
#7 | drupal8.dutb-kernel.7.patch | 773 bytes | sun |
drupal8.dutb-kernel.0.patch | 719 bytes | sun | |
Comments
Comment #1
katbailey CreditAttribution: katbailey commentedWord.
Comment #2
webchickSince I have no idea what in the heck "dumping" means, and still don't after having trawled through DrupalKernel.php (I guess it takes the contents of the container and writes it out to disk. Why..?), could we get a one-liner comment that helps the next person understand why FALSE is passed here, since the details in this issue certainly won't help them discern this. :D
Comment #3
sunSorry, but I think this is the wrong issue/place to discuss or document that.
DrupalUnitTestBase only uses this API, and this patch only adjusts the API call. The additional FALSE flag is passed to prevent the kernel from compiling and dumping its container when executing a DrupalUnitTest. That is unnecessary, since the entire test is executed in memory, which means that the dumped kernel/container will not be read again later on.
@chx created #1850438: Establish DrupalKernel argument good practices for similar reasons, the $allowDumping argument could be documented + patched in there, too.
If that issue not sufficient (possible), then I'd suggest to create a dedicated issue along the lines of "What the heck is a DrupalKernel, where is it, what does it do, what are all of those arguments, what means compiling, and what the heck means dumping?" ;-)
Comment #4
webchickNo, what we need then is basically this:
(give or take an 80 character wrap)
If that's the proper comment I can just fix it on commit, but I've literally no idea because the documentation in DrupalKernel around this is so poor (which, yes, has nothing to do with this issue).
Comment #5
sunI think the proper fix to that is: #1851422: Change DrupalKernel $allow_dumping default value to FALSE
Comment #6
webchickOh, well that would also work. :)
Comment #7
sunAdded the comment. In a way it can be deleted with the other issue.
Comment #8
catchThat comment works for me, and the other issue makes sense too.