diff options
author | Kosta Harlan <kharlan@wikimedia.org> | 2024-06-27 08:59:35 +0200 |
---|---|---|
committer | Kosta Harlan <kharlan@wikimedia.org> | 2024-06-27 08:59:35 +0200 |
commit | 205622af1b64e8a40f2531f2a7e44e37a6a7ba39 (patch) | |
tree | ee2bb53942fbe96fa1c37ad5cefa19998451ba39 /tests | |
parent | d1f437c7da9d051c991c5361f8d540cb570304b1 (diff) | |
download | mediawikicore-205622af1b64e8a40f2531f2a7e44e37a6a7ba39.tar.gz mediawikicore-205622af1b64e8a40f2531f2a7e44e37a6a7ba39.zip |
LocalFileTest: Update to pass with temp accounts enabled
Why:
- These tests currently fail when temp accounts are enabled because they
involve making edits that use anonymous users
What:
- Use mock registered authority instead of mock anon authority
- Set a named user in File#upload
Bug: T365669
Change-Id: I3f8a171a23ed7f7e326e88996cea503807e03b52
Diffstat (limited to 'tests')
-rw-r--r-- | tests/phpunit/includes/filerepo/file/LocalFileTest.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/phpunit/includes/filerepo/file/LocalFileTest.php b/tests/phpunit/includes/filerepo/file/LocalFileTest.php index 7c0b70697fd9..85364f1536c0 100644 --- a/tests/phpunit/includes/filerepo/file/LocalFileTest.php +++ b/tests/phpunit/includes/filerepo/file/LocalFileTest.php @@ -289,8 +289,8 @@ class LocalFileTest extends MediaWikiIntegrationTestCase { } public function providePermissionChecks() { - $capablePerformer = $this->mockAnonAuthorityWithPermissions( [ 'deletedhistory', 'deletedtext' ] ); - $incapablePerformer = $this->mockAnonAuthorityWithoutPermissions( [ 'deletedhistory', 'deletedtext' ] ); + $capablePerformer = $this->mockRegisteredAuthorityWithPermissions( [ 'deletedhistory', 'deletedtext' ] ); + $incapablePerformer = $this->mockRegisteredAuthorityWithoutPermissions( [ 'deletedhistory', 'deletedtext' ] ); yield 'Deleted, RAW' => [ 'performer' => $incapablePerformer, 'audience' => File::RAW, @@ -869,7 +869,10 @@ class LocalFileTest extends MediaWikiIntegrationTestCase { $path, 'comment', 'page text', - 0 + 0, + false, + false, + $this->getTestUser()->getUser() ); $this->assertStatusGood( $status ); @@ -880,7 +883,10 @@ class LocalFileTest extends MediaWikiIntegrationTestCase { $path, 'comment', 'page text', - 0 + 0, + false, + false, + $this->getTestUser()->getUser() ); $this->assertStatusGood( $status ); } |