wiki.techinc.nl/tests/phpunit/includes
Thalia 5310373336 Stop accessing User::mBlock and User::mBlockedby from tests
Update PermissionManagerTest and FormSpecialPageTestCase to use a
mock User object that returns a specified block.

Before this commit, these tests manipulate the public properties
User::mBlock and User::mBlockedby in order to change the user's
block. There is no advantage to doing this over mocking: it is not
more realistic, and is sensitive to changes in the code. These tests
need updating in order to deprecate public access to these properties
(see T229035).

Also, PermissionManager::testUserBlock is a large, complicated method
that tests three different things, so split it into three smaller
methods, each testing one thing:
* testCheckUserBlockActions: A blocked user is blocked/unblocked
  correctly from certain actions, depending on their block.
* testCheckUserBlockMessage: The correct block message key and
  parameters are returned, depending on the block.
* testCheckUserBlockEmailConfirmToEdit: A user is or isn't asked to
  provide email confirmation in order to edit, as specified by the
  config.

Change-Id: I0bb9252b476131c2b255d4c503c0dab5dfff94be
2019-10-15 15:05:53 +00:00
..
actions Merge "Kill the remaining usages of PHPUnit4And6Compat methods" 2019-10-06 10:47:37 +00:00
api phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
auth phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
block Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
cache Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
changes phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
changetags Kill the remaining usages of PHPUnit4And6Compat methods 2019-10-06 10:12:54 +00:00
collation Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
config Follow-up Ifa346c8a92: LanguageNameUtils: CONSTRUCTOR_OTPIONS, not constructorOptions 2019-10-10 17:01:49 -07:00
content phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
context tests: Prefer assertSame() when comparing the integer 0 2019-09-19 15:35:23 +00:00
db phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
debug Kill the remaining usages of PHPUnit4And6Compat methods 2019-10-06 10:12:54 +00:00
deferred Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
diff Kill the remaining usages of PHPUnit4And6Compat methods 2019-10-06 10:12:54 +00:00
editpage
exception phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
externalstore phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
filebackend Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
filerepo phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
GlobalFunctions tests: Replace PHPUnit's loose assertEquals(false) with assertFalse() 2019-10-04 00:30:36 +00:00
htmlform phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
http Merge "tests: Prefer PHPUnit's assertSame() when comparing empty strings" 2019-09-20 15:55:08 +00:00
import Include change tags in revision import structure 2019-09-03 21:14:16 +02:00
interwiki Remove unneeded overrideMwServices/resetServices 2019-08-29 14:26:18 +03:00
jobqueue Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
language New LanguageFallback service 2019-10-08 15:11:39 -07:00
libs phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
linkeddata
linker Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
logging Make LocalisationCache a service 2019-10-07 13:18:47 -07:00
mail
media Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
Message TextFormatterTest: Use mocks instead of manually creating classes 2019-10-08 21:32:25 +00:00
Navigation
objectcache Remove unneeded overrideMwServices/resetServices 2019-08-29 14:26:18 +03:00
page Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
pager tests: Replace PHPUnit's loose assertEquals(null) with assertNull() 2019-09-27 19:15:38 +00:00
parser phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
password Cleanup of old PHPUnit usage, part 3 2019-10-05 00:00:45 -07:00
Permissions Stop accessing User::mBlock and User::mBlockedby from tests 2019-10-15 15:05:53 +00:00
poolcounter
preferences Services: Convert DefaultPreferencesFactory's static to a const now HHVM is gone 2019-10-08 11:28:15 -07:00
rcfeed Clear test user registry between tests 2019-08-14 10:27:21 +03:00
registration Cleanup of old PHPUnit usage, part 3 2019-10-05 00:00:45 -07:00
resourceloader Clean up most of b/c for phpunit4 2019-10-06 00:14:35 +02:00
Rest Use UserIdentity instead of User in REST 2019-09-18 14:45:01 +10:00
Revision rdbms: various cleanups to LoadBalancer::reallyOpenConnection() 2019-10-11 11:35:02 -07:00
search Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
session phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
shell tests: Prefer assertSame() when comparing the integer 0 2019-09-19 15:35:23 +00:00
site Update tests to use PHPUnit 6 class names 2019-10-06 01:01:28 -07:00
skins Update tests to use PHPUnit 6 class names 2019-10-06 01:01:28 -07:00
sparql Cleanup of old PHPUnit usage, part 3 2019-10-05 00:00:45 -07:00
specialpage Stop accessing User::mBlock and User::mBlockedby from tests 2019-10-15 15:05:53 +00:00
specials phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
Storage Merge "SqlBlobStore: test caching behavior." 2019-10-14 14:24:26 +00:00
title Merge "Title: make newFromText, isValid, and canExist behave consistently." 2019-10-08 13:54:57 +00:00
upload
user Merge "UserTest: Don't assign mBlock manually, it's done by BlockManager" 2019-10-15 15:04:09 +00:00
utils Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
watcheditem Merge "Kill the remaining usages of PHPUnit4And6Compat methods" 2019-10-06 10:47:37 +00:00
ActorMigrationTest.php phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
ActorMigrationTest.sql Mostly drop old pre-actor user schemas 2019-09-09 11:38:36 -04:00
AutoLoaderTest.php
AutopromoteTest.php Kill the remaining usages of PHPUnit4And6Compat methods 2019-10-06 10:12:54 +00:00
CategoryTest.php
CommentStoreCommentTest.php
CommentStoreTest.php phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
CommentStoreTest.sql
ContentSecurityPolicyTest.php Remove more HHVM hacks 2019-10-06 10:16:09 +00:00
DeprecatedGlobalTest.php Update tests to use PHPUnit 6 class names 2019-10-06 01:01:28 -07:00
DiffHistoryBlobTest.php
EditPageTest.php Begin cleaning up PHPUnit 4 code from tests 2019-10-04 14:19:05 -07:00
ExportTest.php
ExtraParserTest.php Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
FauxRequestTest.php Begin cleaning up PHPUnit 4 code from tests 2019-10-04 14:19:05 -07:00
GitInfoTest.php tests: Replace PHPUnit's loose assertEquals(false) with assertFalse() 2019-10-04 00:30:36 +00:00
HooksTest.php phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
HtmlTest.php phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
LinkerTest.php Merge "Linker: Kill HHVM and PHP5 special case" 2019-10-07 20:57:22 +00:00
LinkFilterTest.php Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
ListToggleTest.php
MagicWordFactoryTest.php Begin cleaning up PHPUnit 4 code from tests 2019-10-04 14:19:05 -07:00
MediaWikiServicesTest.php tests: Prefer assertSame() when comparing the integer 0 2019-09-19 15:35:23 +00:00
MediaWikiTest.php
MediaWikiVersionFetcherTest.php
MergeHistoryTest.php Don't use new MCR schema without using DB 2019-08-13 17:05:24 +03:00
MessageTest.php phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
MovePageTest.php Merge "Title: make newFromText, isValid, and canExist behave consistently." 2019-10-08 13:54:57 +00:00
MultiHttpClientTest.php
MWTimestampTest.php
OutputPageTest.php Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
PagePropsTest.php
PrefixSearchTest.php Remove unneeded overrideMwServices/resetServices 2019-08-29 14:26:18 +03:00
ReadOnlyModeTest.php
RevisionDbTestBase.php Remove extra param comment and enable phpcs rule 2019-10-11 21:36:25 +02:00
RevisionMcrDbTest.php
RevisionMcrReadNewDbTest.php
RevisionMcrWriteBothDbTest.php
RevisionTest.php Hard deprecate Revision::getRevisionText() method 2019-10-07 11:31:20 -07:00
RevisionTestModifyableContent.php
RevisionTestModifyableContentHandler.php
SampleTest.php Cleanup of old PHPUnit usage, part 3 2019-10-05 00:00:45 -07:00
SiteStatsTest.php Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
StatusTest.php Make Status::wrap and StatusValue::splitByErrorType work together 2019-10-07 13:36:15 +02:00
SystemBlockTest.php
TemplateCategoriesTest.php
TemplateParserTest.php Kill the remaining usages of PHPUnit4And6Compat methods 2019-10-06 10:12:54 +00:00
TestLocalisationCache.php Make LocalisationCache a service 2019-10-07 13:18:47 -07:00
TestLogger.php
TestUser.php Drop last bits of oracle 2019-08-14 23:44:22 +02:00
TestUserRegistry.php Remove extra param comment and enable phpcs rule 2019-10-11 21:36:25 +02:00
TimeAdjustTest.php
TitleMethodsTest.php Add public as visibility in tests folder 2019-10-10 21:55:37 +02:00
TitlePermissionTest.php tests: Replace PHPUnit's loose assertEquals(false) with assertFalse() 2019-10-04 00:30:36 +00:00
TitleTest.php Merge "Title: make newFromText, isValid, and canExist behave consistently." 2019-10-08 13:54:57 +00:00
WebRequestTest.php phpcs: Enable MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException* and make pass 2019-10-14 12:48:48 -07:00
WikiMapTest.php
WikiReferenceTest.php phpunit: Repair GLOBALS reset in MediaWikiUnitTestCase 2019-09-02 20:58:34 +01:00
XmlTest.php Clean up most of b/c for phpunit4 2019-10-06 00:14:35 +02:00