Problem/Motivation

Guess who just spent 10 minutes trying to figure out why $this->setUpCurrentUser wasn't logging in the user in a Functional test?

Steps to reproduce

Proposed resolution

Say in the docs for setUpCurrentUser() and setCurrentUser() that these only work for kernel tests, and that in functional tests you need to call drupalLogin().

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3643653

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

joachim created an issue. See original summary.

myoussef.linksystemz made their first commit to this issue’s fork.

myoussef.linksystemz’s picture

Status: Active » Needs review

Opened a merge request that documents on setUpCurrentUser() and setCurrentUser() that they only set the current user in the test runner, and points to drupalLogin() for functional tests.

joachim’s picture

Status: Needs review » Needs work

Thanks for working on this.

> This only sets the current user in the test runner.

I don't think we need to get technical here?

We should specifically use the terms Kernel test and Functional test (capitalized) as that's what all the documentations uses.

myoussef.linksystemz’s picture

Status: Needs work » Needs review

Thanks, updated: removed the test-runner wording and used "Kernel tests" / "Functional tests". Back to Needs review.

joachim’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks good.