ThumbnailEntryPointTest: Set named user in context

Why:

- The default uploader is the context user, which defaults to an
  anonymous user, and that will fail with temp accounts enabled

What:

- Set a default context user as a named test user account

Bug: T365669
Change-Id: I75eb63e359cd4db01a89ab6c952cc221b54c6dba
This commit is contained in:
Kosta Harlan 2024-06-27 08:53:07 +02:00
parent e71c2ced1f
commit 76f5010f0a
No known key found for this signature in database
GPG key ID: BC3D8915606A5ED9

View file

@ -33,6 +33,9 @@ class ThumbnailEntryPointTest extends MediaWikiIntegrationTestCase {
* will be called only once per test class
*/
public function addDBDataOnce() {
// Set a named user account for the request context as the default,
// so that these tests do not fail with temp accounts enabled
RequestContext::getMain()->setUser( $this->getTestUser()->getUser() );
// Create mock repo with test files
$this->initTestRepoGroup();