wiki.techinc.nl/tests/phpunit/includes
Thalia 02cb7aefef Separate out different functionalities of Block::prevents
Block::prevents plays several different roles:
* acts as get/setter for Boolean properties that correspond to
ipb_create_account, ipb_block_email and ipb_allow_usertalk
* calculates whether a block blocks a given right, based on Block
properties, global configs, white/blacklists and anonymous user
rights
* decides whether a block prevents editing of the target's own
user talk page (listed separately because 'editownusertalk' is
not a right)

This patch:
* renames mDisableUsertalk to allowEditUsertalk (and reverses the
value), to match the field ipb_allow_usertalk and make this logic
easier to follow
* renames mCreateAccount to blockCreateAccount, to make it clear
that the flag blocks account creation when true, and make this
logic easier to follow
* decouples the block that is stored in the database (which now
reflects the form that the admin submitted) and the behaviour of
the block on enforcement (since the properties set by the admin
can be overridden by global configs) - so if the global configs
change, the block behaviour could too
* creates get/setters for blockCreateAccount, mBlockEmail and
allowEditUsertalk properties
* creates appliesToRight, exclusively for checking whether the
block blocks a given right, taking into account the block
properties, global configs and anonymous user rights
* creates appliesToUsertalk, for checking whether the block
blocks a user from editing their own talk page. The block is
unaware of the user trying to make the edit, and this user is not
always the same as the block target, e.g. if the block target is
an IP range. Therefore the user's talk page is passed in to this
method. appliesToUsertalk can be called from anywhere where the
user is known
* uses the get/setters wherever Block::prevents was being used as
such
* uses appliesToRight whenever Block::prevents was being used to
determine if the block blocks a given right
* uses appliesToUsertalk in User::isBlockedFrom

Bug: T211578
Bug: T214508
Change-Id: I0e131696419211319082cb454f4f05297e55d22e
2019-02-21 18:21:28 +00:00
..
actions Add PHPUnit tests for methods in ViewAction::class 2018-11-20 18:13:50 +01:00
api API: Spread autoblocks from action=edit and action=move 2019-02-19 17:34:48 -05:00
auth Fix password policy handling in temporary password provider 2019-02-20 12:25:49 -08:00
block Set BlockDisablesLogin false for Blocking group tests that assume this 2019-02-19 20:17:48 +00:00
cache messagecache: check overridable message array in getMsgFromNamespace() 2018-10-16 20:39:38 +00:00
changes EnhancedChangesList: Load style module via addModuleStyles() 2019-02-12 01:29:36 +01:00
changetags Fix order of arguments in ChangeTags::getPrevTags 2019-01-09 10:14:40 +01:00
collation
composer
config Deprecate MediaWikiTestCase::stashMwGlobals 2018-10-07 19:39:47 +03:00
content Merge "Add some missing @covers tags" 2019-02-03 20:28:43 +00:00
context
db rdbms: Use more narrow type hints in LBFactoryTest 2019-02-13 18:27:26 +00:00
debug Add missing @covers to backend related tests 2019-02-01 22:08:32 +01:00
deferred Expose external link additions and deletions 2019-02-07 17:09:36 -05:00
diff Refactor calls to deprecated function Content::getNativeData() 2019-02-15 17:48:01 +00:00
editpage
exception
externalstore
filebackend Remove a few obscure "done" and "empty" comments 2019-01-30 20:35:14 +00:00
filerepo Add missing property declarations to LocalFileTest 2019-01-02 15:25:44 +01:00
GlobalFunctions Use new externallinks.el_index_60 field 2018-11-12 22:33:18 +00:00
htmlform build: Updating mediawiki/mediawiki-codesniffer to 24.0.0 2019-02-07 18:39:42 +00:00
http http: Support callback functions in GuzzleHttpRequest 2019-01-24 22:05:10 +00:00
import Refactor calls to deprecated function Content::getNativeData() 2019-02-15 17:48:01 +00:00
installer
interwiki
jobqueue Merge "[MCR] Introduce SlotRoleHandler and SlotRoleRegistry" 2018-12-03 16:20:06 +00:00
json Finish FormatJson::encode() test coverage 2019-02-02 22:04:35 -08:00
libs objectcache: remove dangling WAN cache EventRelayer references 2019-02-16 20:22:32 -08:00
linkeddata
linker Clear the title cache in MutableRevisionRecordTest 2018-10-25 21:16:27 +00:00
logging Mostly drop old comment schemas 2019-02-07 16:59:27 +11:00
mail
media JpegPixelFormatTest: use Shell class 2019-02-09 22:20:25 -08:00
objectcache
page Refactor calls to deprecated function Content::getNativeData() 2019-02-15 17:48:01 +00:00
pager
parser Add missing @covers to parser related tests 2019-02-01 21:15:40 +00:00
password Add support for Argon2 password hashing 2019-02-10 02:20:52 -08:00
poolcounter Require ClassMatchesFilename sniff to pass for most of tests/ 2019-01-29 23:57:12 -08:00
preferences test: disable hook when testing default preferences 2018-09-10 10:25:22 +02:00
rcfeed
registration resourceloader: Support TestModules registration via extension.json 2019-02-05 15:27:37 -08:00
resourceloader resourceloader: Make $rl parameter mandatory for MessageBlobStore 2019-02-19 17:16:57 +00:00
Revision Refactor calls to deprecated function Content::getNativeData() 2019-02-15 17:48:01 +00:00
search Add missing @covers to search related tests 2019-02-01 21:35:26 +00:00
session Add session_write_close() calls to SessionManager tests 2018-10-16 10:22:33 -04:00
shell Remove excessive indenting of parameters on newlines 2018-11-06 10:57:17 +00:00
site Add missing @covers to backend related tests 2019-02-01 22:08:32 +01:00
skins
sparql build: Updating mediawiki/mediawiki-codesniffer to 22.0.0 2018-09-16 15:51:11 +00:00
specialpage No yoda conditions 2018-11-21 17:54:39 +01:00
specials Separate out different functionalities of Block::prevents 2019-02-21 18:21:28 +00:00
Storage Fix @param tags 2019-02-03 16:49:10 +01:00
tidy build: Updating mediawiki/mediawiki-codesniffer to 24.0.0 2019-02-07 18:39:42 +00:00
title
upload Add missing empty lines between methods 2019-01-15 19:14:35 +00:00
user Add test for User::isBlockedFrom 2019-02-05 18:13:32 +00:00
utils Better detection for old MS Office files 2019-01-23 09:23:17 +11:00
watcheditem Watchlist: Commit after each batch watchlist insertion and removal 2018-10-18 14:33:50 -04:00
ActorMigrationTest.php Mostly drop old comment schemas 2019-02-07 16:59:27 +11:00
AutoLoaderTest.php
AutopromoteTest.php
BlockTest.php Separate out different functionalities of Block::prevents 2019-02-21 18:21:28 +00:00
CommentStoreCommentTest.php Fix CommentStoreComment RawMessage construction 2019-02-13 11:17:10 -05:00
CommentStoreTest.php Add missing use for IMaintainableDatabase 2019-02-20 20:57:18 +01:00
CommentStoreTest.sql Mostly drop old comment schemas 2019-02-07 16:59:27 +11:00
ContentSecurityPolicyTest.php
DeprecatedGlobalTest.php
DerivativeRequestTest.php Fix IP handling in DerivativeRequest 2018-10-31 20:34:58 -07:00
DiffHistoryBlobTest.php
EditPageTest.php Add missing @covers to action related tests 2019-02-01 22:13:32 +01:00
ExportTest.php
ExtraParserTest.php During special page transclusion, save and restore context's WikiPage too 2018-10-19 22:19:52 +02:00
FauxRequestTest.php
FauxResponseTest.php
FormOptionsInitializationTest.php Use TestingAccessWrapper in FormOptionsInitializationTest 2019-01-29 21:33:42 -08:00
FormOptionsTest.php
GitInfoTest.php
HooksTest.php Drop wfRunHooks, deprecated since 1.25 2018-10-10 15:30:00 -07:00
HtmlTest.php Add warning if you give Html::openElement a name with a space 2018-12-20 18:03:56 -08:00
LicensesTest.php
LinkerTest.php Don't link wikilinks in section heading autocomments 2018-12-03 12:43:03 -08:00
LinkFilterTest.php Use new externallinks.el_index_60 field 2018-11-12 22:33:18 +00:00
ListToggleTest.php
MagicWordFactoryTest.php MagicWordFactory: Follow-up on I5d2166f155e31900cb40c 2018-12-18 12:12:39 +01:00
MediaWikiServicesTest.php Fully extract services framework as a library 2019-01-16 17:31:05 +01:00
MediaWikiTest.php Add @coversNothing for left over tests and enable sniff 2019-02-02 21:53:40 -08:00
MediaWikiVersionFetcherTest.php
MergeHistoryTest.php
MessageTest.php Add some missing @covers tags 2019-02-02 21:53:40 -08:00
MovePageTest.php Add missing @covers to action related tests 2019-02-01 22:13:32 +01:00
MultiHttpClientTest.php
MWNamespaceTest.php
MWTimestampTest.php
OutputPageTest.php resourceloader: Make $rl parameter mandatory for MessageBlobStore 2019-02-19 17:16:57 +00:00
PagePropsTest.php
PathRouterTest.php
PrefixSearchTest.php Reset services before every test 2018-09-03 16:38:58 +00:00
ReadOnlyModeTest.php
RevisionDbTestBase.php Refactor calls to deprecated function Content::getNativeData() 2019-02-15 17:48:01 +00:00
RevisionMcrDbTest.php Allow getRevisionText to function without the text table. 2018-10-17 10:54:39 -04:00
RevisionMcrReadNewDbTest.php Allow getRevisionText to function without the text table. 2018-10-17 10:54:39 -04:00
RevisionMcrWriteBothDbTest.php Re-namespace RevisionStore and RevisionRecord classes 2018-10-09 10:22:48 -04:00
RevisionNoContentModelDbTest.php Re-namespace RevisionStore and RevisionRecord classes 2018-10-09 10:22:48 -04:00
RevisionPreMcrDbTest.php Re-namespace RevisionStore and RevisionRecord classes 2018-10-09 10:22:48 -04:00
RevisionTest.php Mostly drop old comment schemas 2019-02-07 16:59:27 +11:00
RevisionTestModifyableContent.php
RevisionTestModifyableContentHandler.php
SampleTest.php Fix typo in tests/includes/SampleTest.php in core 2018-11-02 12:55:09 +00:00
SanitizerValidateEmailTest.php
ServiceWiringTest.php
SiteConfigurationTest.php
SiteStatsTest.php
StatusTest.php
TemplateCategoriesTest.php
TemplateParserTest.php TemplateParser: Pass FLAG_MUSTACHELOOKUP to enable parent context access 2018-09-04 12:39:34 -07:00
TestLogger.php
TestUser.php Password: replace equals() with verify() 2019-01-24 13:40:40 -08:00
TestUserRegistry.php tests: Allow string to be passed to getTestUser() etc. 2018-10-04 15:30:47 +00:00
TimeAdjustTest.php
TitleArrayFromResultTest.php
TitleMethodsTest.php Fix Title::getFragmentForURL for bad interwiki prefix. 2019-01-23 11:17:21 +01:00
TitlePermissionTest.php Revert "Revert "Title::checkUserBlock should call User::isBlockedFrom for every action"" 2019-01-07 09:40:12 -05:00
TitleTest.php Remove Title->canTalk, deprecated in 1.30, unused 2019-02-07 18:34:44 -08:00
WebRequestTest.php
WikiMapTest.php Rename WikiMap DB domain ID methods to reduce confusion with web domains 2019-02-06 12:28:45 -08:00
WikiReferenceTest.php
XmlJsTest.php
XmlSelectTest.php
XmlTest.php ResourceLoader: Add support for packageFiles 2019-02-05 22:05:02 +00:00