| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
OpenAPI specs include an "info" section that includes strings such
as "title" and "description" that are intended to be human-readable.
Make all such strings translatable.
Bug: T385855
Change-Id: I15285be6d196c0e7fd7e922f23058d7c09b6b31a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Same as Ia294bf4 did for 1-line comments. This patch removes slightly
more complex 2-line PHPDoc comments that don't add any new information
to the code, but literally repeat what the code already says.
They say "don't document the code, code the documentation", and we
are doing this more and more. We just tend to forget to remove the
obsolete comments.
Note I'm also removing a line of text in a few cases when it's very
short and literally says the same as the method name. Again, such
comments add zero new information.
Change-Id: I01535404bab458c6c47e48e5456403b7a64198ed
|
|
|
|
|
|
|
|
| |
Adds an assertion to check that the message keys used in parameter
descriptions are defines.
Bug: T376493
Change-Id: I789a5c2b95a5647a4e8d484c4b069d810478dd6f
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
This avoids creation of session leaking into other tests
Also avoids that the session backend stores the session and
consuming memory until the end of the tests
Change-Id: Ib7a0a5df0f16bb25a6111a4a3f7cfadc489e7e25
|
|
|
|
|
|
|
|
| |
The discovery endpoint provides basic information about accessing the
wiki's APIs, as well as a directory of available modules.
Bug: T365753
Change-Id: I161aa68566da91867b650e13c8aadc87cd0c428c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This applies JSON Schema validation in phpunit tests where appropriate:
1) In ModuleSpecHandlerTest, the generated OpenApi specs are validated
against the OpenAPI 3 schema.
2) In RestStructureTest, module definition files are validated against
the mwapi schema.
This patch introduces a new trait to make it easy for phpunit test cases
to perform validation.
This patch also fixes some issues with the docs/rest/mwapi-1.0.json
schema and the includes/Rest/content.v1.json module definition.
Change-Id: I966cddb337c9373ed3a369496548a8d8c538ae84
|
|
|
|
|
| |
Bug: T368133
Change-Id: I2af5880fdf4d6fb3f8047e24e3a3d69a08a433f7
|
|
|
|
|
| |
Bug: T368133
Change-Id: Ib0e881d13b4709bc31831e1bc7d88ad6041589a1
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
We no longer have to check for 'body' PARAM_SOURCE from within getParamSettings
Bug: T367394
Change-Id: I16075fde2db6ea47f61d1d2df1e07a4ef46b537b
|
|/
|
|
|
|
|
|
|
| |
And deprecated aliases for the the no namespaced classes.
ReplicatedBagOStuff that already is deprecated isn't moved.
Bug: T353458
Change-Id: Ie01962517e5b53e59b9721e9996d4f1ea95abb51
|
|
|
|
|
|
|
| |
Changes to the use statements done automatically via script
Addition of missing use statement done manually
Change-Id: I4ff4d0c10820dc2a3b8419b4115fadf81a76f7a2
|
|
|
|
|
| |
Bug: T359364
Change-Id: I3646140ee8e16800c43f37958fc4b6ff00edcad6
|
|
|
|
|
|
|
| |
Modules group together endpoints by a shared prefix. The idea is that each module has its own version and can generated self-contained self-documentation. This allows clients to have clear expectations about the endpoints of each module, no matter what wiki they are accessing. So far, each wiki may be exposing a different set of endpoints, with no way to provide a spec that describes that set of endpoints in a way that would be consistent across wikis and stable over time.
Bug: T362480
Change-Id: Iebcde4645d472d27eee5a30adb6eee12cc7d046b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since we introduced support for the "body" PARAM_SOURCE in
getParamSettings, fields in the request body can be defined in the same
way that path and query parameters are defined. However, body fields are
treated separately by the framework, and the value of body fields are
available through getValidatedBody(), rather than getValidatedParams().
Because of that, it makes sense to have a method that returns the param
settings just for the body fields. This also allows handler classes to
override this method separately to specify body fields. That way, it
also becomes possible to have body fields that have the same name as
other parameters.
Bug: T362850
Change-Id: Ia85bf7e46c949a999052d91f1b0d7d579a880108
|
|
|
|
|
| |
Bug: T358850
Change-Id: Idce281198604e0983f35776e03d607b7a280cc7e
|
|
|
|
|
| |
Bug: T358558
Change-Id: I0536e0d659b53c8f85bf7685beffbb5c5d027998
|
|
|
|
|
|
|
|
| |
The idea is for all entry points to use the MediaWikiEntryPoint
base class, to improve consistency and testability.
Bug: T354216
Change-Id: I3678afe32c7c1a313d2dcb1808286c25ecd167eb
|
|
|
|
|
| |
Bug: T353458
Change-Id: I4dbef138fd0110c14c70214282519189d70c94fb
|
|
|
|
|
| |
Bug: T166010
Change-Id: I4066885a7ea071d22497abcdb3f95e73e154d08c
|
|
|
|
|
|
|
| |
This has been approved as part of RFC T166010
Bug: T321882
Change-Id: I6bbdbbe6ea48cc1f50bc568bb8780fc7c5361a6f
|
|
|
|
|
| |
Bug: T155147
Change-Id: Iae2512c66c32b209ea8579beecb3de94a744da14
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
Mocks a ContainerInterface to support a specific list of services,
with has() and get() working correctly, and uses that for a real
ObjectFactory object.
Change-Id: Ie49b5a34e0f449cc4b9f6b31d6cc1bc943d04b43
|
|
|
|
|
|
|
|
| |
This is a modified version of Ie282bc5b5f5df0bbd6a40c8362ba73fcbbf36c2e
which was reverted in 5c7cca87763b5f40cf9a3788aca957082c3bd4e7.
Bug: T321969
Change-Id: I566d54a473aa51c4cdaada21a49d63c0624aab93
|
|
|
|
|
|
|
|
| |
This reverts commit d32c260ed0c5f24ef7c1233501f684d612fef5a9.
Reason for revert: Timo has reservations, I'll submit an updated version later.
Change-Id: I71d4d61a879fda4dccfc105127446cfedde75a7b
|
|
|
|
|
|
|
| |
This collects metrics on how often each endpoint is hit, and with which
code it responds.
Change-Id: Ie282bc5b5f5df0bbd6a40c8362ba73fcbbf36c2e
|
|
|
|
|
|
|
|
|
|
|
|
| |
PHPUnit tests will fail to run in the IDE if they access the service
container.
Note that the structure test will not include routes registered by
extensions when run without the phpunit wrapper: data providers are
executed before config is loaded, so extensions do not have a chance to
register.
Change-Id: If9d408456686b408062204bec4b41c95f60ab775
|
|
|
|
|
|
|
|
|
|
|
|
| |
With PHPUnit 9, tests without @covers tags are considered risky and emit
warnings. Not having @covers is bad practice anyway, so use
@coversNothing instead to make the intention clear, and re-enable the
phpcs rule.
Also rewrite an assertion in ResourcesTest that was bothering me.
Bug: T243600
Change-Id: I6dd683f93b6b2faed5f107be2ca7860602277fbc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: Idb413be4b8cba8611afdc022af59810ce1a4531e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
My personal best practice is to not document @params when there
is a @dataProvider. I mean, these test…() functions are not
meant to be called from anywhere. They do not really need
documentation. @param tags don't do much but duplicate what the
@dataProvider does. This is error-prone, as demonstrated by the
examples in this patch.
This patch also removes @throws tags from tests. A test…() can
never throw an exception. Otherwise the test would fail.
Most of these are found by the not yet released I10559d8.
Change-Id: I3782bca43f875687cd2be972144a7ab6b298454e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are not only 100% identical to the actual code, but also:
* It's error-prone. Some are already wrong.
* These test…() functions are not meant to be called from
anywhere. What is the target audience for this documentation?
* There is a @dataProvider. What such @param tags actually do is
document the provider, but in an odd place. Just looking at
the provider should give the same information.
* The MediaWiki CodeSniffer allows to skip @param when there is
a @dataProvider, for the reasone listed.
Change-Id: I0f6f42f9a15776df944a0da48a50f9d5a2fb6349
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Creates an OPTIONS handler that handles any OPTIONS requests that are
not already handled by a handler. CORS has no mechanism to ensure the
user is authenticated, so the Router will reject cross-origin requests
from anon users.
This change allows authenticated users to make cross-origin
requests if they authenticate with OAuth or if
$wgRestAllowCrossOriginCookieAuth is enabled.
Bug: T232176
Bug: T262712
Change-Id: I128b4bdbec4f6bea35142153c951fd7b79617106
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: If05ba2884ba8e256c7fee45164eee1fc2d014589
|
|
|
|
|
|
|
| |
… and avoid assertEmpty() on arrays, in favor of a much more strict
assertSame( [] ).
Change-Id: I20266b0b1fc38a3a87666ba1b0793cb2b37d94a9
|
|
This tests validity of parameter definitions for the MW REST API, like
ApiStructureTest does for the Action API.
Bug: T243437
Change-Id: Iac9ca951d00573be6efe00cc07478c3581c84588
|