aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/page/PageArchiveTest.php
Commit message (Collapse)AuthorAgeFilesLines
* page: Remove deprecated PageArchive::undeleteAsUserUmherirrender2025-03-261-55/+0
| | | | | Bug: T339394 Change-Id: I4c7dd048913ee3d62982ec3bcbdb37548bd56280
* Namespace all remaining files in includes/pageJames D. Forrester2025-03-181-8/+9
| | | | | Bug: T353458 Change-Id: I7a9c74f2106655d41ae029742090253f541bd4a6
* tests: Use namespaced classesUmherirrender2024-10-211-0/+1
| | | | | | | | Changes to the use statements and some additions are done automatically via script This also updates @covers tag for the namespaced classes Change-Id: I859ba6d05018c99710b744e2becab432410d3bca
* page: Hard-deprecate PageArchive::undeleteAsUserUmherirrender2024-07-211-0/+2
| | | | | | Bug: T339394 Depends-On: Iccaf9a9ef141570ed315cb7caefba29a920c5527 Change-Id: Ib3015784e6e0b5e785c5d738268189f651ccdc12
* PageArchiveTest: Disable temp user featureKosta Harlan2024-06-271-0/+4
| | | | | | | | | | | | | Why: - The test uses an anoymous IP user edit in its setup What: - Disable temp user feature for this test Bug: T365669 Change-Id: Ifa9212a1af512065f9bd455132278ca12e7f107f
* Replace db with getDb for TestsWandji692024-06-231-3/+3
| | | | | Bug: T316841 Change-Id: I29e535e8ee9b5641a4546d53b98cd5060d39681d
* Add namespace and deprecation alias to TextContentEbrahim Byagowi2024-05-191-0/+1
| | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Content to TextContent and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: Ic251b1ddfcf6db9c85cb54cddf912aa827d2bc3a
* tests: Fix @covers and @coversDefaultClass to have leading \Reedy2024-02-161-6/+6
| | | | Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
* tests: Use namespaced classesUmherirrender2023-12-111-0/+1
| | | | | | | Changes to the use statements done automatically via script Addition of missing use statements and changes to docs done manually Change-Id: Ib326ae1e5c8409a98398c721e8b8ce42c73bd012
* Follow-up 71ff05267: Stop writing to tablesUsed in tests, now unnecessaryJames D. Forrester2023-11-211-19/+0
| | | | | Bug: T342301 Change-Id: I5ea01f7ee103570165261bde0965c5b65e04c369
* tests: Use $this->getDb() instead of wfGetDB() in integration testsAmir Sarabadani2023-09-251-1/+1
| | | | | | | Deprecated long time ago. Bug: T330641 Change-Id: Ia57f12d350c3346029aafae25534c9ed262a7e98
* Merge "Introduce ArchiveSelectQueryBuilder"jenkins-bot2023-09-071-10/+5
|\
| * Introduce ArchiveSelectQueryBuilderAmir Sarabadani2023-09-071-10/+5
| | | | | | | | | | | | | | Similar to RevisionSQB (Ifd690dc8f030) Bug: T344971 Change-Id: Ic520bcf09f4cc95ebd6a3990cff46dec5b7cd350
* | Merge "Make MediaWikiIntegrationTestCase::addCoreDBData a noop"jenkins-bot2023-09-071-4/+0
|\ \ | |/ |/|
| * Make MediaWikiIntegrationTestCase::addCoreDBData a noopDaimona Eaytoy2023-09-051-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The method should never be called directly, so make it throw an exception. Nonetheless, mark it as deprecated and detect overrides in the constructor, so that anyone who tries to override this method will see a warning. Fix the few tests that were relying on the existence of the test page. Bug: T342428 Depends-On: Ic64ded5e2c0b59e7c888ece9566076058a125be4 Change-Id: I308617427309815062d54c14f3438cab31b08a73
* | Introduce RevisionSelectQueryBuilderAmir Sarabadani2023-09-061-9/+3
|/ | | | | | | | | Deprecating RevisionStore::getQueryInfo() and cleaning up a lot of code Also removing a brittle test that wasn't really testing anything. Bug: T344971 Change-Id: Ifd690dc8f030f86e3567a717eaeb830cb6dc703b
* tests: Migrate Database::select usages to SelectQueryBuilderAmir Sarabadani2023-07-171-3/+15
| | | | | Bug: T311866 Change-Id: I0324919f4e40f4e2db3dab1e9aacf74177170b20
* Drop revision_comment_tempAlexander Vorwerk2023-06-071-1/+0
| | | | | Bug: T299954 Change-Id: I85d21b1eff70a7d70e8ce14f25d66f7e7c76e5fe
* Reorg: Namespace the Title classJames D. Forrester2023-03-021-0/+1
| | | | | | | | | | | | | | | | | | | This is moderately messy. Process was principally: * xargs rg --files-with-matches '^use Title;' | grep 'php$' | \ xargs -P 1 -n 1 sed -i -z 's/use Title;/use MediaWiki\\Title\\Title;/1' * rg --files-without-match 'MediaWiki\\Title\\Title;' . | grep 'php$' | \ xargs rg --files-with-matches 'Title\b' | \ xargs -P 1 -n 1 sed -i -z 's/\nuse /\nuse MediaWiki\\Title\\Title;\nuse /1' * composer fix Then manual fix-ups for a few files that don't have any use statements. Bug: T166010 Follows-Up: Ia5d8cb759dc3bc9e9bbe217d0fb109e2f8c4101a Change-Id: If8fc9d0d95fc1a114021e282a706fc3e7da3524b
* tests: Use Title::makeTitle instead of Title::newFromTextUmherirrender2022-09-231-1/+1
| | | | | | Avoid parsing known titles in tests to improve performance Change-Id: Ie240eb42479d19714e64cc4606e26073fadc2e13
* tests: Use WikiPageFactory to create WikiPage objectUmherirrender2022-06-261-1/+1
| | | | | Bug: T259948 Change-Id: I9afcf3b845306f81ee5ca156553256e6c38df3a0
* Use new namespace for revision related classesUmherirrender2022-04-141-1/+1
| | | | | | | | | All revision related classes are namespaced MediaWiki\Revision instead of MediaWiki\Storage since 1.32. The old namespaced class names are deprecated and only kept for backwards-compatibility. Bug: T305784 Change-Id: I34e492d84d9fc4bc78481667202716d93b3c43cb
* tests: Replace usages of deprecated WikiPage::doDeleteArticleRealDaimona Eaytoy2022-01-171-2/+1
| | | | | | | | | Add a new helper to MediaWikiIntegrationTestCase, since deleting pages seems to be pretty common in tests. Some calls to WikiPage::factory were also updated to use WikiPageFactory. Change-Id: I5b5100273a00ac292a1900022ca79708fa254347
* Split PageArchiveTestMatěj Suchánek2021-10-251-109/+4
| | | | | | | Create ArchivedRevisionLookupTest to test ArchivedRevisionLookup. Expand tests a bit and add two more for ::getPreviousRevisionRecord. Change-Id: I3e176b24a13479464b7e73d062639ecb4db86f8f
* Deprecate replaced PageArchive methodsMatěj Suchánek2021-10-211-23/+41
| | | | Change-Id: I07fe12e6e96c6a27b66655f179c09f624180daa3
* Move methods from PageArchive to new ArchivedRevisionLookupMatěj Suchánek2021-10-081-7/+18
| | | | | | | | Copy and paste methods. Subsequent patches will tidy this up. Also improve test coverage. Bug: T290022 Change-Id: I549ecc3ec89f0303a3cc342916f06da4bf77595e
* Move code from PageArchive to a new UndeletePage commandDaimona Eaytoy2021-09-211-1/+0
| | | | | | | | This is just moving code verbatim, removing now-unneeded stuff, and duplicating tests as well. Bug: T290021 Change-Id: I540ddaaa11dfabcf0b87b608b151b5e34d199fd8
* build: Updating dependencieslibraryupgrader2021-07-221-1/+1
| | | | | | | | | | | | | | composer: * mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0 The following sniffs now pass and were enabled: * Generic.ControlStructures.InlineControlStructure * MediaWiki.PHPUnit.AssertCount.NotUsed npm: * svgo: 2.3.0 → 2.3.1 * https://npmjs.com/advisories/1754 (CVE-2021-33587) Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
* Use WikiPage::doUserEditContent() instead of ::doEditContent()DannyS7122021-06-281-1/+1
| | | | | | | | Results in passing a user where previously the fallback to $wgUser was being used, mostly in tests. Bug: T255507 Change-Id: Iabe24315b23c0ad1272353186425e71974528d23
* Remove hard-deprecated methods from RevisionStorePetr Pchelko2021-06-241-10/+7
| | | | | Bug: T274209 Change-Id: I1cdc9f2d4445cd5a32d90e9bbbfe16c65f1167ff
* Remove Revision from PageArchiveDannyS7122021-04-301-93/+0
| | | | | | | | | - PageArchive::getArchivedRevision - PageArchive::getPreviousRevision - PageArchive::getRevision Bug: T247143 Change-Id: I9a2f2171ffdd284c21a4bcf58ae0589f71450c9b
* Replace uses of DB_MASTER with DB_PRIMARYJames D. Forrester2021-04-291-1/+1
| | | | | | Just an auto-replace from codesniffer for now. Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
* Remove $actor field from UsererIdentityValuedaniel2021-04-131-1/+1
| | | | | | | | | | | | | | | | | Code that needs to store an actor ID in the database to represent a UserIdentity, or needs to construct a UserIdentity based on an actor ID loaded from the database, should use the ActorNormalization service. Note: The getActorId() method is removed from the UserIdentity interface, but all concrete classes continue to support it for now. UsererIdentityValue::getActorId() is hard deprecated and should be removed in 1.37. It always returns 0. User::getActorId() is not deprecated at this point. Bug: T274179 Depends-On: Id2b3ddf6a2a7cdf90f8936a69148d2cce6fde237 Change-Id: I9925906d11e47efaec3c1f48d5cb3f9896a982c1
* Merge "Remove constructors from test classes"jenkins-bot2021-03-111-10/+6
|\
| * Remove constructors from test classesDannyS7122021-03-081-10/+6
| | | | | | | | | | | | | | Tests should put their setup code in ::setUp(), rather than __construct Change-Id: I622f017f3c78a72acc65310f37d61dbec2a5da79
* | ActorNormalization should require a DB connection.daniel2021-03-101-1/+1
|/ | | | | | | | ActorNormalization should only be used in contexts where a DB connection is already being used, or at least easily available. Bug: T276986 Change-Id: Ie8aadaffa4a30e63fcad0502d45b8ec364fc79ef
* Hard-deprecate IDatabase parameter for UserIdentity:getActorId()Cindy Cicalese2021-02-171-5/+6
| | | | | Bug: T273576 Change-Id: I0df4a2749afae74671dc4c49bac4e18309677703
* Hard deprecate RevisionStore::newMutableRevisionFromArrayPeter Ovchyn2021-02-031-0/+2
| | | | | | Bug: T272560 Depends-On: I171537c3346a7dd4aeb4fc612d7dd9fba5d64679 Change-Id: If8d079a5d0e9bc9103cf4a6893a9c961d2728534
* Normalize IP addresses before writing/reading actor.actor_nameGergő Tisza2021-01-261-1/+1
| | | | | | | | | | This was almost always happening already but handling it in ActorMigration is less fragile. Also recover some lost tests. Bug: T272225 Change-Id: I24c82cfbd40595e79f64c6b0441c2cf789cfbbff
* Remove hard deprecated PageArchive::undeleteDannyS7122020-08-261-5/+2
| | | | | | | Also fix alphabetization in release notes Bug: T248192 Change-Id: I41c13b20d31aa75d86783a77a0a263b647a050c5
* Hard deprecate the rest of the Revision classDannyS7122020-07-021-0/+6
| | | | | Bug: T246284 Change-Id: I126d7892c90aa2200c668b5717820e729613bed8
* MediaWikiTestCase to MediaWikiIntegrationTestCaseaddshore2020-06-301-1/+1
| | | | | | | | | | | | | The name change happened some time ago, and I think its about time to start using the name name! (Done with a find and replace) My personal motivation for doing this is that I have started trying out vscode as an IDE for mediawiki development, and right now it doesn't appear to handle php aliases very well or at all. Change-Id: I412235d91ae26e4c1c6a62e0dbb7e7cf3c5ed4a6
* Tests: Reduce use of Revision objectsDannyS7122020-06-301-6/+5
| | | | | | | | Rather than hiding deprecations, where possible use the RevisionRecord This does not apply to tests explicitly meant to be testing Revision methods Bug: T246284 Change-Id: Ic3d85a9d451c0c2ab5df35764186e7c383fdabec
* Add PageArchive::getRevisionRecordByTimestampDannyS7122020-06-151-1/+16
| | | | | | | | For internal use only Allows deprecating PageArchive::getRevision Bug: T249982 Change-Id: I0e10c1b6c7f56af9340f42d58ec4e8699e247be4
* Hard deprecate Revision::getTimestampDannyS7122020-06-101-0/+1
| | | | | Bug: T254966 Change-Id: I90d42eb4e69d7a9ab5c6e0197fbe6979f589ddb6
* Hard deprecate Revision::getPage and ::getCommentDannyS7122020-06-101-0/+4
| | | | | | Bug: T251853 Bug: T254960 Change-Id: I09fadbebd839a16b46a027f64eaac9a435622321
* Remove use of the Revision object returned in WikiPage::doEditContentDannyS7122020-06-091-4/+4
| | | | | | | | Each file's changes are independent and can be reviewed separately Bug: T251853 Bug: T254952 Change-Id: I197c3db4cfb2ead920c8e6071120ae29543ee404
* Hard deprecate PageArchive::getPreviousRevisionDannyS7122020-05-061-0/+2
| | | | | Bug: T251718 Change-Id: Id130da00ff22c193f11619bc75bf0f379216ec5a
* Replace uses and hard deprecate Article:: and WikiPage::getRevisionDannyS7122020-04-201-1/+1
| | | | | | Bug: T250532 Bug: T239975 Change-Id: Ic8f2baa0ac805d5196a7107bdc7a1abb36eba139
* Replace PageArchive::getArchivedRevision with getArchivedRevisionRecordDannyS7122020-04-081-0/+1
| | | | | | | No known callers outside of core Bug: T249393 Change-Id: I00434d931f093f605a15d4dc62c97741f551bbf1