wiki.techinc.nl/tests/phpunit/includes/specials
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
..
pagers Merge "Prevent fatal PHP errors when PageRestriction::getTitle() returns null." 2019-02-12 16:27:04 +00:00
ContribsPagerTest.php Fix order on Special:Contributions when timestamps are identical 2018-12-20 18:12:07 +01:00
ImageListPagerTest.php Move @group and @covers tags in tests close to class 2018-01-28 13:30:07 +01:00
QueryAllSpecialPagesTest.php Mass conversion to SpecialPageFactory service 2018-08-17 12:03:12 -07:00
SpecialBlankPageTest.php Fix MediaWiki.Commenting.LicenseComment.InvalidLicenseTag errors 2018-05-23 16:23:42 -07:00
SpecialBlockTest.php Separate out different functionalities of Block::prevents 2019-02-21 18:21:28 +00:00
SpecialBooksourcesTest.php tests: Replace implicit Bugzilla bug numbers with Phab ones 2017-02-21 02:14:34 +00:00
SpecialEditWatchlistTest.php Use OOUI form for 'clear' and 'raw edit' of watchlist 2018-04-30 19:06:26 +01:00
SpecialLogTest.php SpecialLog: Don't throw exceptions on invalid date from user input 2018-09-24 08:56:48 -07:00
SpecialMIMESearchTest.php Move phpunit @group from file comment to class comment 2018-03-10 11:48:28 +01:00
SpecialMyLanguageTest.php SpecialMyLanguage: Get content language from service 2018-08-03 20:07:36 +02:00
SpecialPageDataTest.php Remove various redundant '@license' tags in file headers 2018-01-12 18:15:11 +00:00
SpecialPageExecutor.php SpecialPageExecutor: Use finally now that we're in a PHP 5.5+ world 2018-09-03 22:10:55 -07:00
SpecialPageTestBase.php Make SpecialPageTestBase always call parent::tearDown 2018-10-08 19:54:32 +03:00
SpecialPreferencesTest.php tests: Replace Bugddddd with Tddddd in test names, test strings 2018-08-20 21:27:20 +00:00
SpecialRecentchangesTest.php Remove temporary rcfilters variables 2018-09-27 13:39:05 -04:00
SpecialRedirectTest.php Give more specific error messages on Special:Redirect 2018-09-16 18:17:54 +00:00
SpecialSearchTest.php Add missing @covers to search related tests 2019-02-01 21:35:26 +00:00
SpecialShortpagesTest.php Fix MediaWiki.Commenting.LicenseComment.InvalidLicenseTag errors 2018-05-23 16:23:42 -07:00
SpecialUploadTest.php Only add header when description not already has it 2018-02-21 17:32:48 +00:00
SpecialWatchlistTest.php Drop ChangesListSpecialPageFilters, deprecated in 1.29 and uncalled 2018-10-10 15:30:00 -07:00
UncategorizedCategoriesPageTest.php Rename UncategorizedCategoriesPageTest to match class name 2019-01-29 23:21:13 -08:00