$this->mParams['file'] and $this->mParams['chunk'] are set to instance
of \Wikimedia\ParamValidator\Util\UploadedFile in the validation step.
Use ApiMain::getUpload
Fix ApiUploadTestCase to set error key to OK,
the null gets converted to UPLOAD_ERR_NO_FILE in
\Wikimedia\ParamValidator\Util\UploadedFile::getError
and breaking the test.
Change-Id: If57307a3f8278fd3fa25732231595bf148935679
We are getting rid of the schema of implementing this interface and
calling self::READ_* constants, it's confusing, inconsistent, prone to
clashes and isn't really useful for non-ORM systems (which we are not)
Bug: T354194
Change-Id: I4c722807b27db4e59f5ba3acc3ddb57fca9140b1
… or with $this->fail() from the PHPUnit TestCase base class.
I hope this makes the code more readable, i.e. communicate the
intention better. The output should be the same, i.e. the test fails
as before in case of an error.
Change-Id: Ied8a045141ac92d6af6398682bb5d9ca7ca88c49
Parsing titles is expensive, it happens in the test function itself via
Title::newFromText and also the called editPage() needs to parse the
title, better to pass the title object there.
Title::newFromText has a cache, that share the title object between the
api code and the test code.
Use independent title objects for testing. This requires some
Title::READ_LATEST to ensure the changed database after the api call is
used.
Change-Id: I00c14e270a5f4078f80d78696ca2e39acf138e95
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
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
This brings significant modularization to the Action API's parameter
validation, and allows the Action API and MW REST API to share
validation code.
Note there are several changes in this patch that may affect other code;
see the entries in RELEASE-NOTES-1.35 for details.
Bug: T142080
Bug: T232672
Bug: T21195
Bug: T34675
Bug: T154774
Change-Id: I1462edc1701278760fa695308007006868b249fc
Depends-On: I10011be060fe6d27c7527312ad41218786b3f40d
Add public, protected or private to function missing a visibility
Enable the tests folder for the phpcs sniff
Change-Id: Ibefce76ea9984c47e08c94889ea2eafca7565e2c
The siteinfo API response's 'writeapi' value is now hard-set to true,
as are the ResourceLoader variables wgEnableAPI and wgEnableWriteAPI,
to be deprecated later.
Bug: T115414
Change-Id: I54ff9428b247ba203d67aba079149393f323d5a9