Make SpamBlacklistTest::testSpamEdit pass when temp accounts enabled

Why:
* SpamBlacklistTest::testSpamEdit fails to run when temporary
  accounts are enabled, because the EditPage object does not have
  the user set as the same as the RequestContext user (which is
  a named test user).
* Making the test pass is necessary for running tests when
  temporary accounts are enabled in CI.

What:
* Set the EditPage context user as the same as the test user used
  for the article context above.

Bug: T355879
Change-Id: I34e0299a9d9e3078f9067390e30dca7ce9665de4
This commit is contained in:
Dreamy Jazz 2024-05-04 17:21:57 +03:00
parent a59c5598a1
commit 6f021e90da

View file

@ -146,6 +146,7 @@ class SpamBlacklistTest extends MediaWikiIntegrationTestCase {
$article = new Article( $title );
$ep = new EditPage( $article );
$ep->setContextTitle( $title );
$ep->getContext()->setUser( $articleContext->getUser() );
$ep->importFormData( $req );