Commit graph

16 commits

Author SHA1 Message Date
Ebrahim Byagowi
1be5d40e56 Add namespace and deprecation alias to FileBackendGroup
This patch introduces a namespace declaration for the
MediaWiki\FileBackend to FileBackendGroup and establishes a class
alias marked as deprecated since version 1.43.

Bug: T353458
Change-Id: Id33b6bfa56131978900199786b0082481c6c54a5
2024-05-20 20:06:00 +03:30
Reedy
85396a9c99 tests: Fix @covers and @coversDefaultClass to have leading \
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
2024-02-16 22:43:56 +00:00
Amir Sarabadani
7d137d0452 Deprecate ConfiguredReadOnlyMode service
Currently, we have two services: ReadOnlyMode and
ConfiguredReadOnlyMode. The former takes the latter and can easily
support every functionality of CRO. I added methods to support that
functionality (the current class is quite small so it's not adding a lot
more to a monster class) and basically fully deprecate the service
itself to improve developer experience.

It is only called in two extensions in production with straightforward
fix so I directly went with hard-deprecation.

Bug: T343917
Depends-On: Icec0ad3f30c471b428efe80dfb9129f55a351194
Change-Id: I421fd5c8fee7af41c059419c2bbc85b8dccc04ed
2023-09-12 23:22:13 +00:00
Amir Sarabadani
4bb2886562 Reorg: Migrate WikiMap to WikiMap/ out of includes
And WikiReference

Bug: T321882
Change-Id: I60cf4b9ef02b9d58118caa39172677ddfe03d787
2023-02-27 05:19:46 +01:00
Umherirrender
abf2ea44e8 tests: Handle dynamic created properties on test classes
- Declare missing properties
- Remove unused or avoid set of properties
- Add AllowDynamicProperties

Bug: T314099
Change-Id: Ie631894f2ffbb616f6dd09851405d681f3eb8fcd
2023-01-13 21:03:42 +00:00
Umherirrender
c6fecd5ab0 tests: Replace assertEmpty with assertSame
assertSame avoids use of loose comparisons and
allows to check the expected type

Change-Id: If821d1be2bc1ff9f8b70968a339f33c7a8e8880a
2022-11-25 00:42:53 +01:00
Derick Alangi
cb03a63230 tests: Migrate away from setMwGlobals()
Make use of `overrideConfigValue(s)()` where needed and also
make use of MainConfigNames constants.

NOTE: group multiple calls to setMwGlobals() to one and pass
  an array of values instead.
Change-Id: I3bbfd037bb3765c00c426682cce3ef5cccc1a284
2022-08-22 20:17:49 +00:00
Umherirrender
dee77e59a1 tests: Remove resetServiceForTesting after overrideConfigValues
overrideConfigValues is documented to reset services as well

Change-Id: Ie13a699f6cd912b912d34adb97704bab3cbdff2d
2022-07-27 23:08:27 +02:00
Alexander Vorwerk
9f9426697c Replace usages of deprecated wfWikiID()
The global function wfWikiID() is deprecated since 1.35 and it's usages
should be replaced with WikiMap::getCurrentWikiId().

Bug: T298059
Change-Id: I22d96b7aec17323d15a9bc401d4511ad2ee14165
2021-12-21 02:05:55 +00:00
Alexander Vorwerk
da26927c73 Remove FileBackendGroup::singleton() and ::destroySingletons()
both deprecated since 1.35, hard deprecated since 1.37 and unused.

Bug: T249025
Change-Id: Ie4759fa3fa25202d623317acb444079f10e33817
2021-09-15 19:21:30 +02: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
ZabeMath
08c87c13a3 Hard deprecate FileBackendGroup::singleton() and ::destroySingletons()
both deprecated since 1.35.

Bug: T249025
Change-Id: I271187e8c5ad68459cfad4c0966c8c14d225512f
2021-05-04 21:03:41 +02:00
Max Semenik
09f2feafd6 tests: Make static/non-static functions match
PHP 8 is stricter about this.

Bug: T248925
Change-Id: I0e9c736d0e2a28ce4a1e096a8ec63321d8b41635
2020-04-29 10:59:53 +03:00
Aryeh Gregor
0d3d6be18d Convert FileBackendGroup to service
Bug: T234228
Change-Id: I25575f565eba122cdf971a5945572811d17fa3e1
2019-10-25 10:46:20 +03:00
Aryeh Gregor
0fdb213fe5 Fix FileBackendGroup test for some configurations
The expected value of FileBackendGroup::config()['srvCache'] was being
obtained from MediaWikiServices::getLocalServerObjectCache(), but the
class actually used ObjectCache::getLocalServerInstance( 'hash' ). It
happens these are often the same, so it passed the gate-and-submit jobs,
but it's causing failures on Travis CI.

Follow-up to bd2a439502, which added the failing test. Thanks to
Krinkle for pointing out the failures on CI.

Change-Id: I17651766f4ee2752dfcae9574d2538269dec4ebe
2019-08-29 16:32:40 +03:00
Aryeh Gregor
bd2a439502 Integration tests for FileBackendGroup
100% coverage except for one bit of the code that I didn't understand.
Unit tests to come, together with rewrite as a service.

Change-Id: Ib01758d994a9e5587a4fcb5edc3d80010ef05615
2019-08-28 11:21:44 +03:00