| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
Implicitly marking parameter $... as nullable is deprecated in php8.4,
the explicit nullable type must be used instead
Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a
Break one long line in SpecialPage.php
Bug: T376276
Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
|
|
|
|
|
| |
Bug: T353458
Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
|
|
|
|
|
|
| |
Found via `[^*][^\\]\nclass_alias`.
Change-Id: I9732f75226445f48fb131c432b209d0fd3eba1ba
|
|
|
|
|
|
|
|
|
|
| |
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I48014b6464f3e7e2b7f083e67f517af0b1a9367e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
- In some situations (e.g. tests in ApiRevisionDeleteTest),
the context user ID / name was being unset by code in Session
What:
- Set the session user to the request context user
Bug: T365669
Change-Id: Ife2cc31133bafb6a2c0adfeebcb2e1a139f25f48
|
|
|
|
|
|
|
|
|
| |
This commit replaces some of the uses of getErrorsArray(),
getWarningsArray(), getErrorsByType(), and getErrors().
In many cases the code becomes shorter and clearer.
Follow-up to Ibc4ce11594cf36ce7b2495d2636ee080d3443b04.
Change-Id: Id0ebeac26ae62231edb48458dbd2e13ddcbd0a9e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some of these have been marked in-code as deprecated for a long while,
but haven't ever been announced in the RELEASE-NOTES (and later,
HISTORY) file, so let's mark them up now so we can get the ball rolling
at least.
Per Gergo, the AuthManager one was 'born deprecated' and should only
have been used by humans also reading the deprecation notice given in
the code, and indeed no uses are known to code search, so also emit
deprecation warnings there immediately; others will have to wait until
uses have been migrated.
Change-Id: I0c1c71d8f4293623039302da35d58d2a24367e97
|
|
|
|
|
| |
Bug: T357823
Change-Id: I0d7cc2c9b166d5e5b913c1305f7cee017fe377af
|
|
|
|
|
| |
Bug: T353458
Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
|
|
|
|
|
| |
Bug: T261872
Change-Id: Ia573136f0ab90025a1588e9dfd5add081d9ffdae
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TestUser creates the user and therefore needs the database. Avoid using
it in non-database tests.
Add ApiQueryBlockInfoTraitTest to the Database group because it needs
the database.
Add DeleteUserEmailTest to the Database group because since 3bedffa8
the default user is not created any more in non-database tests
Change-Id: Iff438964dde47a47a2fa4a314d55010bd8c7fee5
|
|
|
|
|
|
|
| |
Ideally we'd use Authority, but that doesn't always work, so just call
the getTest* methods directly.
Change-Id: I7f8393bb754beeb319b5555b5dac05265e376a22
|
|
|
|
|
|
|
|
|
|
|
|
| |
Something in Session(Backend? Manager?) replaces the user with an
unknown user if it doesn't exist, which later causes a token mismatch.
I didn't find the root cause for this issue, as I stopped digging once I
found a working solution, but it shouldn't realy matter as this is only
test code and we're moving away from User anyway.
Bug: T341953
Change-Id: I6b675a8b1c6b3d7fff8ca1330f8857b7393ab012
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This property shouldn't be needed in modern code, where most things can
use Authority. So much so because TestUser adds a dependency on the
database, but many tests that use TestUser don't even need the database.
ApiTestCase, in particular, sets this property in setUp, thus adding a
database dependency to all API tests, including those that don't need
users or the database at all.
Deprecate the property and replace existing usages in core. The one in
ApiTestCase is much harder to migrate, but this patch replaces the array
with an anonymous ArrayAccess class to allow lazy initialization and
remove DB dependencies.
Bug: T155147
Change-Id: I59c4ed1f6a7572d3a92387b15b8e56625bc376a2
|
|
|
|
|
|
|
| |
Also in case of null nothing changed on the key,
so skip that array handling
Change-Id: I7df8452654d2ecab22c555cbbdc46158f26a4dd1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Error messages are not guaranteed to be stable, and these tests
prevent us from improving them.
Error codes are supposed to be stable, so we should be asserting
that they do not change (especially since many of them are
dynamically generated by the dodgy code in ApiMessageTrait).
Introduce helpers assertApiErrorCode() and expectApiErrorCode()
to be used instead of the usual PHPUnit assertions/expectations
for this case.
Change-Id: I752f82f29bf5f9405ea117ebf9e5cf70335464ad
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Redoing I5ea70120d74 but without moving WebRequest that caused issues
with phan-taint-plugin.
Moving:
- DerivativeRequest
- FauxRequest
- FauxRequestUpload
- PathRouter
- WebRequestUpload
Bug: T321882
Change-Id: I832b133aaf61ee9f6190b0227d2f3de99bd1717b
|
|
|
|
|
|
|
|
|
| |
This reverts commit 2bdc0b2b7209441a42a784157633a8a01b321922.
Reason for revert: T166010#8349431
Bug: T166010
Change-Id: Idcd3025647aec99532f5d69b9c1718c531761283
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Moving:
- DerivativeRequest
- FauxRequest
- FauxRequestUpload
- PathRouter
- WebRequest
- WebRequestUpload
Bug: T166010
Change-Id: I5ea70120d745f2876ae31d039f3f8a51e49e9ad8
|
|
|
|
|
|
|
| |
We do not encourage people to use these groups, they are not widely used,
and this is just forcing cruft into code for no value.
Change-Id: Ia58aa62ea6a1694694fb54acbd717181cd36e051
|
|
|
|
|
|
|
|
|
| |
self::$filterIDsCache caches database state, it gets out of whack when
we reset the database between test cases.
The cache was originally introduced to fix T140302.
Change-Id: I9a05c60d84d92f6798154bfa77c6288576dc53bc
|
|
|
|
|
|
|
| |
Add an optional parameter to doApiRequest/doApiRequestWithToken to automatically prefix parameters.
Change-Id: If69074b12fb4682490e05243ae808c39a17c697b
Bug: T310008
|
|
|
|
|
|
|
|
|
|
|
| |
Removes deprecated API endpoints and modules for dealing with
CSRF tokens.
Note: i18n messages are removed in a followup for ease of revert.
Bug: T280806
Depends-On: Ic83f44587db119ff2e3e6d5ff33a10894e0695e7
Change-Id: I58aedec6942ac5d3c21574cb0072f00ef365098c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
Bug: T285448
Change-Id: I6c91f47321c5ab717812a7dd0d629230b71a3ef1
|
|
|
|
| |
Change-Id: I92ae8455b08b90c613a54d63b992d59efef2c6dc
|
|
|
|
|
|
|
|
|
|
|
|
| |
AuthManager has been converted to a service in 1.35.
AuthManager::$instance is only used in AuthManager::resetCache(),
where it is set to null.
This patch also removes AuthManager::resetCache() because with
removing AuthManager::$instance AuthManager::resetCache() has no
longer any effect.
Change-Id: I8b27f9a2d0d3f7acec6b93f64f9c256084990026
|
|
|
|
|
|
|
|
|
|
|
| |
This is a demo, a lot of tests could be rewritten as a followup
to pass proper Authority when executing tests instead of writing
globals. Much cleaner imho.
An improvement idea is to allow overriding 'default permissions'
when creating a mock Authority.
Change-Id: I38570024e0d5a67a8e1c52f7456c458090ec2b6e
|
|
|
|
|
|
|
|
|
|
|
|
| |
And use it in core
Avoid direct use of super global $_FILES
This can breaks all FauxRequest relaying on $_FILES
in tests or production code via FauxRequest::getUpload.
Falls back to $_FILES for the moment
Bug: T48163
Change-Id: I7392acc9bb682ec6b7025dbed0734c142f45c91a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follows-up 5e6cccc3a4c858.
- Let PHPUnit do the diffing instead of exporting expected value
into the description.
- Use a stricter and complete assertion of the result, not just
one key existence only. Specifically, this means the value (true)
is asserted, and any additional or unexpected properties result in
failure. For example, if all of them were marked as missing+invalid
the old test would pass as it wasn't checking absence. In general,
assertArrayHasKey() is almost always indicates a lax test that can
be improved, or a redundant assertion (such as here, where it was
used to check 'purge' exists before use, but PHP and PHPUnit naturally
validate that already).
Change-Id: Ie7067633e4df0b9a1b451ce4c53a98e8ee3c3ae7
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replaces calls directly to PermissionManager with calls to
the Authority object available from Context or the
GroupPermissionLookup service.
This patch does not address use of PermissionManager for
blocks.
Deprecations:
- ApiBase::checkUserRightsAny deprecated passing optional
User parameter
- ApiBase::checkTitleUserPermissions deprecated passing
LinkTarget as first parameter, takes PageIdentity instead
Bug: T271462
Bug: T271854
Change-Id: I5d7cac1c28a37e074750c46cda03283980a07fca
|
|
|
|
|
| |
Bug: T274036
Change-Id: I911d3041cebe417d162934223b46ea295c6d20e3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some User methods fail if they are called before $wgRequest is
set. But according to the Setup.php comment, it is only set for b/c.
The global request object can be lazy-initialised at any time.
This is sufficient to avoid T263911 (loss/obfuscation of the $wgServer
error message).
In tests, try to keep $wgRequest and RequestContext::$request in sync.
Introduce MediaWikiIntegrationTestCase::setRequest() which sets both at
once, and use that instead of setMwGlobals() or direct assignment.
BlockManagerTest was accidentally exploiting the fact that the global
context request and $wgRequest were separate objects. Making them the
same causes session cookies to appear in the response, breaking the
cookie counts. Use a new response for the test.
Bug: T263911
Bug: T245940
Change-Id: I2be99f7251a837bc6b62be0b152038157dec10f2
|
|
|
|
|
| |
Bug: T243708
Change-Id: Ief59ce77469de4185c031413e64d0dee3ea26e60
|
|
|
|
|
|
|
|
| |
No known uses in any repo on codesearch:
https://codesearch.wmcloud.org/search/?q=doLogin%5C(&i=nope&files=&repos=
Bug: T245355
Change-Id: I606d4f922a3034af786cf64e6d8b211cd12a09af
|
|
|
|
|
|
|
|
| |
Soft deprecated in 1.31
All deployed uses removed
Bug: T244039
Change-Id: I67b1ce00585a1d305b92a0e8fcc11147930cd4f3
|
|
|
|
| |
Change-Id: I90cfe8366c0245c9c67e598d17800684897a4e27
|
|
|
|
| |
Change-Id: I48ee838a7ebf4f25a4883d4c7886b39c2d3916af
|
|
|
|
|
|
| |
Bug: T192167
Depends-On: I581e54278ac5da3f4e399e33f2c7ad468bae6b43
Change-Id: I3a21fb55db76bac51afdd399cf40ed0760e4f343
|
|
|
|
| |
Change-Id: I11f8801ef47ec1a1f63d840116e69667e6f3ae3c
|
|
|
|
|
| |
Bug: T192167
Change-Id: I42b0c8908b4968b95b08f861a40af18dc79fa0a1
|
|
|
|
|
|
|
|
|
| |
Bug: T215843
Depends-On: Ie49709faa6f67b0a31bd546823d29dbfea0a70eb
Depends-On: If8109dbfdeeb88a6265f4cd79d1ae81bff48d934
Depends-On: I36b195fa2d6c23a76631ebaf869c787e44427d60
Depends-On: Iaa171b085fde331eab7d85c7de74523e27fc625a
Change-Id: I330b30d6582034a233fed204c0680b1ce84eec6e
|
|
|
|
|
|
|
|
|
|
| |
This allows setting the expected exception message by the message key,
not text, so it remains correct if the message is updated. This
function could be defined to work with other exception types too, but it
seems useful to have shortcuts for common types like ApiUsageException
or MWException.
Change-Id: Ic86278e9e1e91eea0c045d2b93342f018e1d8e66
|
|
|
|
| |
Change-Id: I79c4e37092958c63a693194b27a9eafae70cb2f8
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed bug: in PHP versions less than 5.6.0, any request that didn't
attempt to add any groups would warn, because it would call array_fill()
with the second argument (num) equal to 0. From PHP 5.6.0, the num
argument to array_fill() is allowed to be 0.
Change-Id: I0c5772f15d8f550dc43fb37c3c58d15dd73ea584
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Also removed a sketchy-looking usage of ?: with a string in
ApiParse.php. In this case I think it was fine, because it would only
cause a bug if a page's display title was '0' but its actual title was
not '0', which is only possible if $wgRestrictDisplayTitle is false,
which is broken by design anyway and I don't think is worth testing.
But ?: used for something that should be interpreted as a string is
generally not a good idea.
One bug fixed: an error message that used an undefined variable.
Depends-On: Id0e6184aff8f9d7e8f32558e1de14faa0168cc1d
Change-Id: I0904bff0f9d80892d0db2ebb590c24fb862f2418
|
|/
|
|
|
|
| |
The function is entirely unnecessary.
Change-Id: I805520e5355119e872e602d0bfc93be26f227128
|
|\ |
|
| |
| |
| |
| |
| | |
Depends-On: I9375bc5f40268fd681a2d447c66a03f40b23390a
Change-Id: Ia21a974f2b463afc9324182137b95c80db86a6aa
|