Problem/Motivation
When kernel tests install modules between drupalGet calls we need to call $this->initMink() to make sure the test browser does not keep a stale reference to the container. This is evidenced in \Drupal\Tests\taxonomy\Kernel\Views\TermDisplayConfigurableTest, which was converted in #3591220: Convert functional tests in taxonomy module to kernel tests, and in \Drupal\Tests\taxonomy\Kernel\TermAccessTest, which is not yet in any existing issue. There are likely other instances of this too.
Steps to reproduce
Remove $this->initMink() from \Drupal\Tests\taxonomy\Kernel\Views\TermDisplayConfigurableTest and run it.
Proposed resolution
Introduce a HttpKernelTestBrowser extending the existing HttpKernelBrowser that resets the kernel property before each request. We can use the same subclass in #3566881: Add a submitForm() method to HttpKernelUiHelperTrait.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3609730
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mstrelan commentedTest fail is unrelated
Comment #4
mstrelan commentedTested this against #3519393: Convert functional tests in navigation module to kernel tests instead of calling initMink and it worked there too.
Comment #5
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.