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
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 #4
myoussef.linksystemz commentedOpened 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.
Comment #5
joachim commentedThanks 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.
Comment #6
myoussef.linksystemz commentedThanks, updated: removed the test-runner wording and used "Kernel tests" / "Functional tests". Back to Needs review.
Comment #7
joachim commentedThanks, looks good.