Amir Sarabadani
bbe704b5c1
Reorg: Move some of request related classes to MediaWiki/Request
...
Redoing I5ea70120d74 but without moving WebRequest that caused issues
with phan-taint-plugin.
Moving:
- DerivativeRequest
- FauxRequest
- FauxRequestUpload
- PathRouter
- WebRequestUpload
Bug: T321882
Change-Id: I832b133aaf61ee9f6190b0227d2f3de99bd1717b
2022-10-28 10:15:31 +00:00
Zabe
f6b9381d7f
Revert "Reorg: Move some of request related classes to MediaWiki/Request"
...
This reverts commit 2bdc0b2b72 .
Reason for revert: T166010#8349431
Bug: T166010
Change-Id: Idcd3025647aec99532f5d69b9c1718c531761283
2022-10-27 13:14:16 +00:00
Amir Sarabadani
2bdc0b2b72
Reorg: Move some of request related classes to MediaWiki/Request
...
Moving:
- DerivativeRequest
- FauxRequest
- FauxRequestUpload
- PathRouter
- WebRequest
- WebRequestUpload
Bug: T166010
Change-Id: I5ea70120d745f2876ae31d039f3f8a51e49e9ad8
2022-10-26 16:49:10 +02:00
Derick Alangi
86d4a253e7
tests: Migrate setMwGlobals() to overrideConfigValue(s)()
...
Directories covered are: /api/, /auth/ and /block/, more to come.
Change-Id: I9dfb0773cbfff36cba7389ed2d9b3c7b1b22612e
2022-07-19 15:42:15 +01:00
Alexander Vorwerk
decbaf4f38
phpunit: use ->getServiceContainer() in integration tests
...
Change-Id: I38299cb65eeaadfdc0eb05db4e8c0b0119cfb37d
2022-01-27 22:04:16 +01:00
Daimona Eaytoy
2688c59606
tests: Replace usages of deprecated WikiPage::doDeleteArticleReal
...
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
2022-01-17 15:38:02 +00:00
Kosta Harlan
0c2cc804e1
phpunit: Use is_file/is_dir instead of file_exists
...
Yes, it's a micro-optimization. See https://bugs.php.net/bug.php?id=78285
and https://thephp.cc/articles/caching-makes-everything-faster-right
for more info.
Change-Id: Ib8e8e9794e15066476f35cdb1236df8b983274d6
2022-01-03 21:47:56 +01:00
libraryupgrader
5357695270
build: Updating dependencies
...
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
2021-07-22 03:36:05 +00:00
Umherirrender
f338645527
Create FauxRequestUpload to fake uploads in tests
...
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
2021-04-06 23:10:43 +02:00
Umherirrender
0b33adc9ca
Use MediaWikiServices::getRepoGroup in api related classes
...
Change-Id: Ifa75012ea5572b56be499f355f9b97663ad17fcc
2020-04-11 23:58:00 +00:00
DannyS712
cf2c2a0778
Tests: Replace ::doDeleteArticle with WikiPage::doDeleteArticleReal
...
Not including WikiPageDbTestBase, which is testing the method
Bug: T248000
Change-Id: I1848a79be9e25759654053e88ef956269342f588
2020-03-25 11:34:17 -07:00
DannyS712
c013ac2ccc
Tests: Pass a user to FileDeleteForm::doDelete
...
Bug: T245682
Change-Id: Iab5b07877c836d6b67de47bb56c56b91a1bcf688
2020-02-19 22:32:31 +00:00
Brad Jorsch
c2b1525908
API: Use ParamValidator library
...
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
2020-02-04 13:36:14 -05:00
Max Semenik
48a323f702
tests: Add explicit return type void to setUp() and tearDown()
...
Bug: T192167
Depends-On: I581e54278ac5da3f4e399e33f2c7ad468bae6b43
Change-Id: I3a21fb55db76bac51afdd399cf40ed0760e4f343
2019-10-30 14:31:22 -07:00
James D. Forrester
9be9e77b51
build: Upgrade mediawiki-codesniffer from 26.0.0 to 28.0.0
...
Newly-disabled general rules:
* MediaWiki.Commenting.FunctionComment.MissingSplatVariadicArg
* MediaWiki.Commenting.FunctionComment.SuperfluousVariadicArgComment
* MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedException
* MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedExceptionMessage
* MediaWiki.Commenting.PhpunitAnnotations.ForbiddenExpectedExceptionMessageRegExp
* MediaWiki.Usage.NullableType.PHP71NullableStyle
* MediaWiki.Usage.PHPUnitTypeHints.MissingTypehint
* PSR12.Files.ImportStatement.LeadingSlash
* PSR12.Properties.ConstantVisibility.NotFound
Change-Id: Ifcf8c6d5fecc47a32741114b5a5b746a41510045
2019-10-11 10:05:43 -07:00
Umherirrender
5bd311b1a2
Add public as visibility in tests folder
...
Add public, protected or private to function missing a visibility
Enable the tests folder for the phpcs sniff
Change-Id: Ibefce76ea9984c47e08c94889ea2eafca7565e2c
2019-10-10 21:55:37 +02:00
James D. Forrester
225b462a50
Drop deprecated EnableAPI and EnableWriteAPI settings
...
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
2018-04-18 00:30:34 +00:00
Umherirrender
040063a4ba
Rename ApiTestCaseUpload
...
Having *TestCase at end of the class name makes it easier to detect it
as TestCase class
Change-Id: Ic7ae7328e729c0f2d97afcf7c5be793d6a8df58f
2018-03-16 18:40:38 +01:00