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

Issue fork drupal-3609730

Command icon 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

mstrelan created an issue. See original summary.

mstrelan’s picture

Status: Active » Needs review

Test fail is unrelated

mstrelan’s picture

Tested this against #3519393: Convert functional tests in navigation module to kernel tests instead of calling initMink and it worked there too.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The 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.