wiki.techinc.nl/tests/phpunit/includes
Ammar Abdulhamid fb58d390ea Improve handling of content models that do not support redirect.
To properly support content models that do not support redirects
during historymerge we have to do some cleanup, else after merging
all revisions of a page, a corrupted page will be left with a page id
(because it was not deleted) but no live revision (because they have
been all merged to the destination page).

This will lead to cascade of exceptions in Wikipage, RevisionStore,
RevisionStoreRecord, PoolWorkArticleView as well other various paths
that will attempt to interact with these, because page and revision
mismatch is considered a logic error almost everywhere.

The failure does not happen for content models that support redirects
because they are immediately creating new (latest) revision for the
old corrupted page. But we cannot require all content models to support
redirects, may not be feasible and can hinder forward compatibility.

This patch fixes this for content models that do not support redirect.

Now after merging all revisions of a page to another page, and the
source content model does not support redirect, empty content will be
created to aid proper deletion of the page afterwards.

Creating the content before deletion is necessary, else proper
deletion is not possible because many calls to revision-related methods
will throw exception during the deletion if we just use the original
corrupted page which does not have proper revisions now.

Bug: T93469
Bug: T263340
Change-Id: I07109445288633e3ddece4190f0c1c2b10372384
2020-11-03 08:16:12 +00:00
..
actions Use ::class together with createMock in unit tests 2020-10-30 14:45:37 +01:00
api Merge "Make unit tests assertion about assertNotEquals more strict" 2020-11-02 00:37:36 +00:00
auth Merge "Make unit tests assertion about assertNotEquals more strict" 2020-11-02 00:37:36 +00:00
block Inject UserFactory into BlockErrorFormatter 2020-10-13 20:09:52 +00:00
cache MCR import 2020-07-18 20:34:16 -04:00
changes Convert PageProps to a service 2020-08-12 21:21:53 +00:00
changetags Merge "me/contributions: filter by tag" 2020-07-06 06:01:52 +00:00
collation MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
config MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
content Make WikitextContentTest set the context title to avoid failures 2020-10-20 16:13:42 -07:00
context RequestContextTest: No need to set $wgUser 2020-09-13 23:18:17 +00:00
db Make unit tests assertion about assertNotEquals more strict 2020-11-01 23:12:06 +00:00
debug MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
deferred MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
diff Create fallback for undefined content models. 2020-07-22 19:59:09 +02:00
editpage MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
exception Make unit tests assertion about assertNotEquals more strict 2020-11-01 23:12:06 +00:00
externalstore MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
filebackend Merge "Make unit tests assertion about assertNotEquals more strict" 2020-11-02 00:37:36 +00:00
filerepo filerepo: clean up shared cache keys to avoid key metrics clutter 2020-10-21 13:29:15 -07:00
GlobalFunctions Remove deprecated wfForeignMemcKey() 2020-10-26 19:33:29 +00:00
HookContainer Prevent service injection to LoadExtensionSchemaUpdates hook 2020-09-18 08:01:52 +10:00
htmlform Make unit tests assertion about assertNotEquals more strict 2020-11-01 23:12:06 +00:00
http Add a function to HttpRequestFactory for creating a GuzzleHttp\Client 2020-10-22 23:11:47 -05:00
import Check for unknown slot. 2020-07-20 10:39:28 -04:00
interwiki MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
jobqueue Improve class property documentation 2020-10-30 10:38:58 +01:00
language MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
libs Expand DoctrineSchemaBuilderTest 2020-10-17 21:17:46 +00:00
linkeddata Fix broken PHPDoc comments that don't start with /** 2020-07-23 16:09:41 +00:00
linker Replace wfGetDB with LoadBalancer in LinkCache service 2020-08-26 19:58:48 +02:00
logging Remove use of $wgUser from LogFormatterTest, unneeded 2020-09-14 20:26:13 +00:00
mail MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
media Make unit tests assertion about assertNotEquals more strict 2020-11-01 23:12:06 +00:00
Message MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
Navigation MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
objectcache MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
page Introduce and apply NonSerializableTrait 2020-09-28 21:55:49 +02:00
pager
ParamValidator/TypeDef Remove stray fake time side effect in data provider 2020-08-07 11:41:43 +02:00
parser Merge "Use ::class together with createMock in unit tests" 2020-10-30 17:56:24 +00:00
password MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
Permissions PermissionManager: Allow sysops to view deleted config pages 2020-10-20 21:57:18 +00:00
poolcounter MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
preferences MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
rcfeed MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
registration MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
resourceloader Only preload logo if the optional logo feature is enabled. 2020-10-21 13:50:25 -04:00
Rest Handle CORS preflight request and prevent anon users from unsafe methods 2020-09-21 19:29:40 -04:00
Revision Remove deprecated title permissions functions 2020-08-26 21:21:11 +00:00
search search: Fix PrefixSearch totally ignoring input like "[[Foo]]" 2020-08-20 10:50:52 +02:00
session Make unit tests assertion about assertNotEquals more strict 2020-11-01 23:12:06 +00:00
shell Fixes shell edge-cases in Windows 2020-08-26 15:04:07 +10:00
site MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
skins Require Skin name when passing options to Skin constructor 2020-09-18 15:57:03 +00:00
sparql Whitespace cleanup: Use tabs for indentation, avoid double spaces 2020-06-27 07:53:07 +00:00
specialpage Merge "Filter invalid namespace on Special:RecentChanges and friend" 2020-08-12 01:42:54 +00:00
specials Inject LinkBatchFactory into QueryPage and use it 2020-11-02 14:51:56 +01:00
Storage Add mw-reverted change tag 2020-08-31 13:40:50 +00:00
title Remove $wgAllowImageMoving, deprecated 2020-09-14 01:21:50 +00:00
upload Fix tests assume badaccess-groups message in singular form 2020-10-30 17:20:54 +01:00
user [UserTest] Set defaults for $wgAutoConfirmAge/$wgAutoConfirmCount 2020-10-30 16:17:02 +01:00
utils MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
watcheditem Inject UserFactory into WatchedItemQueryService 2020-10-12 21:36:21 +00:00
ActorMigrationTest.php Inject UserFactory into ActorMigration 2020-10-13 19:34:19 +00:00
ActorMigrationTest.sql
AutoLoaderTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
AutopromoteTest.php Merge "UserEditTracker: Minor code clean up and follow-ups" 2020-09-28 20:35:39 +00:00
CategoryTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
CommentStoreCommentTest.php
CommentStoreTest.php Remove CommentStore::newKey, deprecated and unused 2020-02-20 02:00:15 +00:00
CommentStoreTest.sql
ContentSecurityPolicyTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
DeprecatedGlobalTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
DiffHistoryBlobTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
EditPageConstraintsTest.php Add PageSizeConstraint and ChangeTagsConstraint 2020-10-28 16:03:02 +00:00
EditPageTest.php EditPage: Migrate more checks to constraint 2020-10-26 22:01:05 +00:00
ExportTest.php Explicitly wrap some XML calls in libxml_disable_entity_loader() 2020-09-20 15:57:14 +00:00
ExtraParserTest.php Remove hard deprecated old SpecialPageFactory 2020-07-27 15:01:35 +00:00
FauxRequestTest.php Fix visibility of setUp/tearDown 2020-06-16 21:02:05 +02:00
GitInfoTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
HooksTest.php HookContainer: fix clear() and scopedRegister(). 2020-09-08 21:07:59 +02:00
HtmlTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
LinkerTest.php Drop the LinkBegin and LinkEnd hooks, deprecated since 1.28 2020-07-29 11:25:49 +01:00
LinkFilterTest.php
ListToggleTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
MagicWordFactoryTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
MediaWikiServicesTest.php Merge "MediaWikiServicesTest: newMediaWikiServices never has parameters passed" 2020-07-08 07:27:35 +00:00
MediaWikiTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
MediaWikiVersionFetcherTest.php Provide MW_VERSION and deprecate fake global $wgVersion 2020-02-25 01:55:21 +00:00
MergeHistoryTest.php Improve handling of content models that do not support redirect. 2020-11-03 08:16:12 +00:00
MessageTest.php Replace all call_user_func(_array) in all tests 2020-06-06 18:41:20 +02:00
MovePageTest.php Add delete-redirect for deleting single-rev redirects during moves 2020-09-04 03:50:17 +00:00
MultiHttpClientTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
MWTimestampTest.php
OutputPageTest.php Hard deprecation of Language::convertTitle(), 2020-10-20 16:49:17 -04:00
PagePropsTest.php Replace tabs with spaces 2020-09-04 18:04:07 +02:00
PrefixSearchTest.php Fix tests/ PSR12.Properties.ConstantVisibility.NotFound 2020-05-16 04:30:21 +01:00
ReadOnlyModeTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
RevisionDbTest.php Hard deprecate the rest of the Revision class 2020-07-02 09:02:02 +00:00
RevisionTest.php Hard deprecate the rest of the Revision class 2020-07-02 09:02:02 +00:00
RevisionTestModifyableContent.php Fix tests/ PSR12.Properties.ConstantVisibility.NotFound 2020-05-16 04:30:21 +01:00
RevisionTestModifyableContentHandler.php
SampleTest.php
SiteStatsTest.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
StatusTest.php [StatusTest] Replace ReflectionMethod with TestingAccessWrapper 2020-10-30 14:02:10 +00:00
SystemBlockTest.php
TemplateCategoriesTest.php Pass a user to WikiPage::doDeleteArticleReal, use new signature 2020-03-19 00:54:29 +00:00
TestLocalisationCache.php
TestLogger.php Replace all call_user_func(_array) in all tests 2020-06-06 18:41:20 +02:00
TestUser.php MediaWikiTestCase to MediaWikiIntegrationTestCase 2020-06-30 17:02:22 +01:00
TestUserRegistry.php Remove documentation that literally repeats the code 2020-10-27 19:20:26 +00:00
TimeAdjustTest.php Remove unneeded ::setUp and ::tearDown methods that only call parent 2020-06-07 10:09:32 +00:00
TitleMethodsTest.php Fix visibility of setUp/tearDown 2020-06-16 21:02:05 +02:00
TitleTest.php Correct position of $expected and $actual in TitleTest::testGetCascadeProtectionSources() 2020-10-03 18:23:00 +01:00
WebRequestTest.php Make WebRequest::getAcceptLang() return floats instead of strings 2020-07-14 19:10:24 +00:00
WikiMapTest.php Fix visibility of setUp/tearDown 2020-06-16 21:02:05 +02:00
WikiReferenceTest.php
XmlTest.php Drop down lists: Do not use the value for 'other' as option group 2020-09-16 19:30:43 +00:00