aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/page
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Add namespace to the root classes of ObjectCacheEbrahim Byagowi2024-07-101-0/+2
| |/ | | | | | | | | | | | | | | | | And deprecated aliases for the the no namespaced classes. ReplicatedBagOStuff that already is deprecated isn't moved. Bug: T353458 Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
* / includes: Replace usages of deprecated WikiPage::doDeleteArticleRealDaimona Eaytoy2024-07-102-2/+4
|/ | | | Change-Id: Icdf1b25f2f5202e4f1f83bbea5b6436ccbb7f3b5
* Tests: Replace "db" with getDb methodWandji692024-06-301-5/+5
| | | | | Bug: T316841 Change-Id: Ie6b08125b76d2d4b7a30375357dcb90aaa0189c1
* Merge "[ParsoidCachePrewarmJob] Use ParserOutputAccess"jenkins-bot2024-06-281-19/+17
|\
| * [ParsoidCachePrewarmJob] Use ParserOutputAccessC. Scott Ananian2024-06-171-19/+17
| | | | | | | | | | | | | | | | | | | | One more step in gradually replacing uses of ParsoidOutputAccess. This one was pretty easy, as ParsoidOutputAccess was pretty much directly calling ParserOutputAccess when provided with a ExistingPageRecord and RevisionRecord. Bug: T367074 Change-Id: I96161a64952e1809c0aec773d5a3dd4c71105657
* | Merge "PageArchiveTest: Disable temp user feature"jenkins-bot2024-06-271-0/+4
|\ \
| * | 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
* | | Merge "ArticleViewTest: Set named context user for RevDelRevisionList"jenkins-bot2024-06-271-1/+5
|\ \ \
| * | | ArticleViewTest: Set named context user for RevDelRevisionListKosta Harlan2024-06-271-1/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: - Using a default context with RevDelRevisionList ends up using an anonymous user which will fail with temp accounts enabled What: - Set a named user in the context passed to RevDelRevisionList Bug: T365669 Change-Id: Iff87b09381b2c999d508512130aab6cd590d2df2
* | | Merge "ArticleTablesTest: Use named user in test"jenkins-bot2024-06-271-2/+1
|\ \ \
| * | | ArticleTablesTest: Use named user in testKosta Harlan2024-06-271-2/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: - Using an anonymous user in a test that makes edits will fail when temp accounts are enabled What: - Use a named account in the test Bug: T365669 Change-Id: Ic879530b53da9f9e3444aef5b34202f4359260f8
* / / WikiPageDbTest#testGetAutoDeleteReason: Disable temp user featureKosta Harlan2024-06-271-0/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Why: - The test uses IP edits in some of its test cases What: - Disable temp user feature for the test Bug: T365669 Change-Id: If1a8d7991aee5b5a40a6bff9f612a4ff7bcb06c5
* | Replace db with getDb for TestsWandji692024-06-234-10/+10
| | | | | | | | | | Bug: T316841 Change-Id: I29e535e8ee9b5641a4546d53b98cd5060d39681d
* | Merge "Add protection indicators to mediawiki/core"jenkins-bot2024-06-191-0/+52
|\ \
| * | Add protection indicators to mediawiki/coreSohom2024-05-281-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add a disabled by default feature flag 'EnableProtectionIndicators' - When the config flag is enabled, show a lock indicator at the top of the page. - The lock icon should be overridable by the content of the page - The indicator has a predictable ID which could be potentially used to style the icon using the onwiki Common.css file. - The lock icon by default links to https://www.mediawiki.org/wiki/Help:Protection. However this link can be customized per wiki per protection level using a empty message (for example: `protection-sysop-helppage`) Bug: T12347 Change-Id: I3e36d98edfe54a9c138b1fe8e5057e107ded281b
* | | Merge "schema: Drop old pagelinks columns"jenkins-bot2024-06-181-1/+2
|\ \ \ | |_|/ |/| |
| * | schema: Drop old pagelinks columnsAmir Sarabadani2024-06-181-1/+2
| | | | | | | | | | | | | | | | | | | | | It has been dropped in production already. Bug: T299947 Change-Id: I8ec1e7d9224c81d6494c39c78df9e4bdac38d377
* | | tests: Avoid deprecated Status / StatusValue methodsBartosz Dziewoński2024-06-152-57/+71
| | | | | | | | | | | | | | | | | | | | | | | | Use more specific and less fragile assertions whenever possible; most tests don't need to examine the internals of the status so closely. Use StatusValue::getMessages() when necessary. Change-Id: Ie4b3ebc03abb0e352e82394ced6ab9e733c83fb4
* | | tests: Use namespaced classes (1)Umherirrender2024-06-146-0/+10
|/ / | | | | | | | | | | | | Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: Iae45fa269363be8ee05c598ea6926514ce817762
* | Use real type hints for services etc. in includes/page/Bartosz Dziewoński2024-06-111-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mostly used find-and-replace: Find: /\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?)[\s\*]+/\s*(private|protected|public) (\$[a-z]\w+;\n)((?=\s*/\*[\*\s]+@var (I?[A-Z](\w+)(?:Interface)?))\n|) Replace with: \3 \1 \4 More could be done, but to keep this patch reasonably sized, I only changed the most obvious and unambiguously correct cases. In some cases, I also removed redundant doc comments on the constructor, and re-ordered the properties to match the constructor. Change-Id: I7eb97640c0543ae10bf2431623a5f7efdc3349b7
* | Merge "Implement RedirectStore service"jenkins-bot2024-06-112-42/+14
|\ \
| * | Implement RedirectStore serviceMáté Szabó2024-06-112-42/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I469de6f85e405e8ddbe7abaa5b99b77cb9cf415d added an initial RedirectStore implementation, but it has remained a stub despite the corresponding task being closed. So, flesh out the implementation by moving the corresponding logic from WikiPage. Soft-deprecate WikiPage::insertRedirectEntry() accordingly. Bug: T290639 Change-Id: Ia500df45bc969ce77b6b2a06bfec10e32c00b931
* | | Merge "MovePageTest: Don't use wikitext-specific getExistingTestPage to ↵jenkins-bot2024-06-051-1/+2
|\ \ \ | |_|/ |/| | | | | inject a JS page"
| * | MovePageTest: Don't use wikitext-specific getExistingTestPage to inject a JS ↵James D. Forrester2024-05-171-1/+2
| | | | | | | | | | | | | | | | | | page Change-Id: I68174b15676b0f7f4bb5b74e0de4c7f30a5c1e04
* | | Merge "Allow undeletion of IP revisions when temp accounts are enabled"jenkins-bot2024-05-231-0/+10
|\ \ \
| * | | Allow undeletion of IP revisions when temp accounts are enabledDreamy Jazz2024-05-231-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * When wgAutoCreateTempUser['enabled'] is true, calling ActorStore ::acquireActorId for an IP address user will throw a CannotCreateActorException to prevent attributing actions to IP addresses. * When using Special:Undelete to undelete a page that has IP addresses who have made edits, the UndeletePage call to the ActorStore::acquireActorId causes an exception. * However, the revisions already existed so (similar to importing revisions) it does not represent a leak of the IP address. * As such, it should be possible to undelete a page with revisions performed by IP addresses. What: * Add ActorStore::getActorStoreForUndelete which works the same as ActorStore::getActorStoreForImport. Having methods that are named for undelete / import avoids the usage for other code that should use ::getActorStore instead. * Add RevisionStoreFactory::getRevisionStoreForUndelete which uses the ActorStore returned by ActorStore ::getActorStoreForUndelete. * Update the PageCommandFactory to take the RevisionStoreFactory and then call ::getRevisionStore for all but UndeletePage where the ::getRevisionStoreForUndelete method is called. Bug: T362019 Bug: T365669 Change-Id: Ia7c583c625843f4f400e1c4aa7ea360519e63c87
* | | | Move ParsoidOutputAccess::supportsContentModel() into Parsoid SiteConfigC. Scott Ananian2024-05-221-3/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | The `supportsContentModel` method is really querying Parsoid for the set of content models it supports, so it makes sense to put it in the Parsoid-specific SiteConfig service. This is part of the work to deprecate and remove ParsoidOutputAccess. Change-Id: I81eb2df8cef93ede95361a4e03185b3d58e5b84b
* | | Add namespace and deprecation alias to WatchedItemStoreEbrahim Byagowi2024-05-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces a namespace declaration for the MediaWiki\Watchlist to WatchedItemStore and establishes a class alias marked as deprecated since version 1.43. Bug: T353458 Change-Id: I820a3512440ba5a1de13e8470ccf5845918f3198
* | | Add namespace and deprecation alias to TextContentEbrahim Byagowi2024-05-192-0/+2
|/ / | | | | | | | | | | | | | | | | 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: Add TestSelectQueryBuilder::assertRowValueUmherirrender2024-05-081-30/+27
| | | | | | | | | | | | | | | | Similiar to assertFieldValue(), but to assert one row. Simpler as assertResultSet(), as it needs list with one array Follow-Up: I7392b37988067020d5f684276320dae0a474631a Change-Id: Ib85fa407abe6fcb18f60c0a8505044881c1681bc
* | PageStore: Migrate to StatsLibMáté Szabó2024-05-052-2/+21
|/ | | | | | | | Use StatsFactory for emitting metrics from PageStore and add assertions for the new metrics. Bug: T359374 Change-Id: Id099f54eb79a2dce078259cf9c13e548c1ec56f2
* tests: Remove usage of deprecated methods on ContentHandlerdaniel2024-04-301-2/+4
| | | | | | Prepare for hard deprecation of static ContentHandler methods. Change-Id: Ie37937da26630d4c9782f2ac4aa413e9c18ea535
* Use native willReturnSelf in tests where possiblethiemowmde2024-04-101-2/+1
| | | | Change-Id: I38a1858a5190c9fc5c80ac8f846a18af163a18e6
* parser: Remove explicit StatsdDataFactory backward-compat logicDerick Alangi2024-03-261-2/+3
| | | | | | | | | | | | | This is a follow-up to: I0b683461212a357c7eb09ddec59c87539e323c65 and I40a8372a76f33c5f62ea73bb1180dd7c47412c89 which explicitly for backward compatibility reasons supports IBufferingStatsdDataFactory. Now that we've fully switched to StatsFactory together with the `copyToStatsdAt()` method, we're fine to fully remove this `instanceof` logic. Bug: T356815 Change-Id: I164d82904b6d3fb575cb973c14f9454569bf09ac
* Move away from DBAccessObjectUtils::getDBOptions in more placesAmir Sarabadani2024-03-251-1/+1
| | | | | Bug: T354194 Change-Id: I759cbbd49411c8b288baf5d0c481685cd5ab0f2c
* Merge "parser: Remove LoggerSpi override from ParserOutputAccessTest"jenkins-bot2024-03-111-14/+2
|\
| * parser: Remove LoggerSpi override from ParserOutputAccessTestTimo Tijhof2024-03-091-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The presence of this mock means that, valuable debug messages are missing from PHPUnit output. Considering how high-level that is, that is quite a bit. Follows-up a longer-than-needed debug session from I5413825a0 and Ie532c17e5b. Most of the time was actually not spent adding this back in, but trying to figure out how it was that the messages were missing. Bug: T358901 Change-Id: I41fa8dce1ea37ea69632917bcb591b8327d35e7d
* | Avoid wgTitle in testsFomafix2024-03-101-2/+2
|/ | | | Change-Id: I82f08aca0ce5ce187fd4fe0200bf479f2231fb2c
* Merge "Make sure MovePage::isValidFileMove matches UploadBase::getTitle"jenkins-bot2024-03-061-0/+24
|\
| * Make sure MovePage::isValidFileMove matches UploadBase::getTitleBrian Wolff2024-03-061-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | MovePage::isValidFileMove was not checking that filenames are at most 240 bytes. This was causing metadata for old versions of file to be cut off. Also add checks for non-ascii filenames on systems not supporting unicode. To be extra careful also add an explicit check for files that are only an extension although its likely such moves would have failed for other reasons. Bug: T359294 Change-Id: I9e75a3e4007b76d66f1305e9107dadbbbfb4d5cb
* | PoolCounter: Adopt PSR logger in PoolCounter objectsTimo Tijhof2024-03-021-33/+21
|/ | | | | | | | | | | | | | | | * Inject from ServiceWiring via PoolCounterFactory. * In production we use PoolCounterClient (which is backed by our poolcounterd service), we also offer PoolCounterRedis for third parties. Replace the local logger in the Redis variant in favour of the built-in one. * Update PoolCounterWork to adopt this as well. Expose it via getter to here, so that DI works all the way, including for the existing test. Bug: T358901 Change-Id: I5413825a0172b186d58e85bbc3cc93697b174c27
* Merge "ParserOutputAccess: only use PoolCounter if the caller asks for it."jenkins-bot2024-03-011-60/+244
|\
| * ParserOutputAccess: only use PoolCounter if the caller asks for it.daniel2024-02-291-60/+244
| | | | | | | | | | | | | | | | | | | | | | PoolCounterWorkArticleView was not designed for use by all callers of getParserOutput. It provides stampede protection but does not generally prevent duplicate concurrent parsing, and it may result in stale cache entries being returned to the caller. This is acceptable for page views, but not other use cases like editing or updating secondary derived data. Bug: T352837 Change-Id: Ie532c17e5b86e8e1adbb57ecd5c5c6405b83bf8f
* | tests: Run iterator_to_array for Generator before assertCountUmherirrender2024-02-242-3/+3
| | | | | | | | | | | | | | | | Passing an argument of type Generator for the $haystack parameter is deprecated. Support for this will be removed in PHPUnit 10. Bug: T342110 Change-Id: Id7c33972836be815622e1495ad2bcbbf952b7493
* | Remove IDBAccessObject from being implemented in many classesAmir Sarabadani2024-02-192-2/+3
|/ | | | | | | | | | | | This is inconsistent with the access pattern of other constants in MediaWiki. it's also confusing (e.g. it's unclear to a newcomer why UserFactory is implementing IDBAccessObject) and it's prone to clashes (e.g. BagOStuff class has a clashing constant). It has been already announced: https://w.wiki/9DAX Bug: T354194 Change-Id: Ic2357634b8385d65b55db2b557191419b06c40e0
* tests: Fix @covers and @coversDefaultClass to have leading \Reedy2024-02-1611-45/+45
| | | | Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
* Clean up testsMatěj Suchánek2024-02-121-1/+1
| | | | | | | Replace strpos with str_contains, str_starts_with, etc. Fix spelling of "cannot" and other typos. Change-Id: Ie52900b323f46d1978a9dd9ea3b17619b8942160
* Merge "WikiPage: remove ::suppressTOC hack"jenkins-bot2024-02-101-6/+2
|\
| * WikiPage: remove ::suppressTOC hackC. Scott Ananian2024-02-051-6/+2
| | | | | | | | | | | | | | | | | | Instead of overriding the ParserOptions for the page, just clear the section data and set the NO_TOC flag in the resulting ParserOutput. Bug: T307691 Bug: T350626 Change-Id: I6a24edcc5eb5bed50adcfb8648b953afa54ac0f6
* | Namespace includes/contextJames D. Forrester2024-02-082-0/+3
| | | | | | | | | | Bug: T353458 Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb