Commit graph

20 commits

Author SHA1 Message Date
James D. Forrester
326d655fc9 Drop 'comma' value for wgArticleCountMethod
We have three methods for page counting currently supported for wikitext
non-redirect pages; 'any' counts any page that exists, 'link' counts any
page that has any outbound links, and 'comma' which searches for any ','
in the text having loaded it. This last option is much slower than these
other two, and is only used on a very small number of installations. Now
by dropping support for this method we can simplify this code and so run
it more often. Note that non-wikitext pages already did not support this
count method.

Installations with this setting set to 'comma', or any other string will
now work as if it was configured with 'any'.

Bug: T188472
Change-Id: I965927edcd2485ec4b49b2d80fdf216dbf19520b
2018-03-01 16:37:23 -08:00
Brad Jorsch
27c61fb1e9 Add actor table and code to start using it
Storing the user name or IP in every row in large tables like revision
and logging takes up space and makes operations on these tables slower.
This patch begins the process of moving those into one "actor" table
which other tables can reference with a single integer field.

A subsequent patch will remove the old columns.

Bug: T167246
Depends-On: I9293fd6e0f958d87e52965de925046f1bb8f8a50
Change-Id: I8d825eb02c69cc66d90bd41325133fd3f99f0226
2018-02-23 10:06:20 -08:00
addshore
e5879da149 Pass $key into CommentStore methods and use MediawikiServices
This allows CommentStore to be added to MediaWikiServices
without the need of an aditional Factory.

This change includes a compatability layer to allow the behaviour
from 1.30 to continue to be used while deprecated.

CommentStore::newKey has been deprecated.
Keys are now passed into the public methods of CommentStore
where needed.
The following CommentStore methods have had their signatures changed
to introduced a $key parameter, but when used in conjunction with
CommentStore::newKey behaviour will remain unchanged:
  * CommentStore::getFields
  * CommentStore::getJoin
  * CommentStore::getComment
  * CommentStore::getCommentLegacy
  * CommentStore::insert
  * CommentStore::insertWithTemplate

Change-Id: I3abb62a5cfb0dcd456da9f4eb35583476ae41cfb
2018-02-05 15:34:12 +00:00
Umherirrender
45da581551 Use ::class to resolve class names in tests
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: Ie541a7baae10ab6f5c13f95ac2ff6598b8f8950c
2018-01-26 22:49:13 +01:00
addshore
1583f478da [MCR] Tests for WikiPage::doUpdateRestrictions
Bug: T180989
Change-Id: I75518d5ba34119e88e3e382523583fa8b65bc730
2018-01-04 11:28:01 +00:00
Umherirrender
255d76f2a1 build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
Clean up use of @codingStandardsIgnore
- @codingStandardsIgnoreFile -> phpcs:ignoreFile
- @codingStandardsIgnoreLine -> phpcs:ignore
- @codingStandardsIgnoreStart -> phpcs:disable
- @codingStandardsIgnoreEnd -> phpcs:enable

For phpcs:disable always the necessary sniffs are provided.
Some start/end pairs are changed to line ignore

Change-Id: I92ef235849bcc349c69e53504e664a155dd162c8
2018-01-01 14:10:16 +01:00
Umherirrender
5b351e86ea Use another pageid in WikiPageDbTestBase::testInsertOn_idSpecified
integer bigger than 2147483648 is bad on 32-bit php

1) WikiPageContentHandlerDbTest::testInsertOn_idSpecified
Failed asserting that -816015107 is identical to 3478952189.

> echo intval( 3478952189 );
-816015107

Change-Id: Ia2ab870dfe53bef873def3905ae93ea52d4ab2ad
2017-12-15 22:36:06 +00:00
Kunal Mehta
6fbea1aae4 WikiPageTest: Fix typo in @covers
Change-Id: I3f3a3b2a1f5e5aed61cd71db17ae6a6a01fe2ecb
2017-12-06 20:19:25 -08:00
addshore
7a46b709aa Tests for WikiPage::insertOn
Change-Id: I1bf7d19c4baaf0f720fcd6a1d9c16bf7489b5392
2017-12-05 11:29:20 -08:00
addshore
c4878eb281 Tests for WikiPage::updateIfNewerOn
This method is deprecated but due to refactoring
we should still test it.

Change-Id: I171ab731fff48ddd9fa54ef433881154377a2c7f
2017-12-05 11:29:19 -08:00
addshore
11dbd4ec8e Tests for WikiPage::updateRevisionOn
Bug: T180989
Change-Id: I245d9d467e3113bf49e06ee5c725205d4225671a
2017-12-05 11:29:19 -08:00
addshore
2af18246aa Test for WikiPge::insertProtectNullRevision
Bug: T180989
Change-Id: Iffee0bbe9fb18bb6c7f7af10b6405007468ac0b9
2017-12-05 11:29:18 -08:00
addshore
ece8130b6a Tests for WikiPage::newFromID
Bug: T180989
Change-Id: Idb4d7ce8ccc27226b0f00e2127acef6158dd32a9
2017-12-05 11:29:17 -08:00
addshore
d0f584696d Test for WikiPage::newFromRow
Bug: T180989
Change-Id: If630e3e3561ac2017a2b7c82ade842e86f8cb22e
2017-12-05 11:29:17 -08:00
addshore
5b217dfc9b Tests for WikiPage::insertRedirectEntry
Bug: T180989
Change-Id: I677202b22594c7fc8fcf97b805ae69726945f96d
2017-12-05 09:16:46 +00:00
addshore
47db625832 Test for WikiPage::updateRedirectOn
Bug: T180989
Change-Id: I798ded72142503e52395b45fe9ec71a215d5ab92
2017-12-04 13:11:26 +01:00
addshore
ec5d1fd6f9 Add test for WikiPage::updateCategoryCounts
Bug: T180989
Change-Id: Iff4bb885e5d385a7b3ec6169ee9a3e1e82d7d993
2017-12-04 09:46:33 +00:00
addshore
81c156b402 Refactor test for WikiPage::doRollback
This test was not running and a comment said
it was broken.
This patch refactors the test.

Bug: T180989
Change-Id: I46b73371e5fd65860fce6cc101bad6abfa20e91d
2017-12-04 09:46:28 +00:00
addshore
6c3e67f2be WikiPage tests @covers for doDeleteArticleReal & commitRollback
Bug: T180989
Change-Id: I70dcad9d527be4d91a88a14fe9787c53a7cf7d2f
2017-12-04 09:46:23 +00:00
addshore
1ceabc0f64 Split WikiPageTest into ContentHandler & NoContentHandler tests
Follow up to Iccdcd4a4f72c8b1329d36ff2e8699ba6b23c9ae7

Bug: T180989
Change-Id: Ib37a058586c7222ffe3ee5dc5f0e134ee18f0ff7
2017-12-04 10:46:02 +01:00
Renamed from tests/phpunit/includes/page/WikiPageTest.php (Browse further)