aboutsummaryrefslogtreecommitdiffstats
path: root/tests/phpunit/includes/ReadOnlyModeTest.php
Commit message (Collapse)AuthorAgeFilesLines
* Make ReadOnlyModeTest a pure unit testDannyS7122021-08-051-165/+0
| | | | | | | | Only needed MediaWikiIntegrationTestCase for the handling of temporary files, but its acceptable to create and manipulate files in unit tests too. Change-Id: I3b2bac837c943f1210cc1b804f1afbbb3ecab0f3
* Remove meaningless ->expects( $this->any() ) from all testsThiemo Kreuz2021-04-231-1/+1
| | | | | | | | | | | | | | | It is not entirely meaningless. It might be an indicator that the number of calls to a method is intentionally unlimited. This is similar to e.g. an @inheritDoc PHPDoc comment that marks a method as being "intentionally undocumented". However, what's the meaning of being "intentionally unconstrained"? Let's just not have any constraint then. I feel all these ->expects( $this->any() ) bloat the test code so much that it's never worth it. Change-Id: I9925e7706bd03e1666f6eb0b284cb42b0dd3be23
* MediaWikiTestCase to MediaWikiIntegrationTestCaseaddshore2020-06-301-1/+1
| | | | | | | | | | | | | 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
* Don't pass Config to service constructorsAryeh Gregor2019-05-021-6/+1
| | | | | | | | | | | | | | | | | | | | | | We don't want to depend on the entire site configuration when we only need a few specific settings. This change additionally means that these services no longer see a live version of the settings, but rather a copy. This means in tests you really do have to call overrideMwServices() if you want services to pick up your config changes. ResourceLoader and SearchEngineConfig will need more work to port, because they expose their member Config in a getter, and the getter is actually used. Parser and NamespaceInfo are also relatively complicated, so I split them into separate patches. Tested with 100% code coverage. \o/ Depends-On: If6534b18f6657ec1aba7327463f2661037f995b3 Change-Id: I1a3f358e8659b49de4502dc8216ecb6f35f4e02a
* Drop clearCache() from (Configured)ReadOnlyModeAryeh Gregor2019-04-101-24/+0
| | | | | | | These are services, so tests should just override services to reset them. Change-Id: Icb1a041f8fac1ea0b7421e69b7b31b24171d868b
* Remove unused and unnecessary importsThiemo Mättig2017-06-121-2/+0
| | | | Change-Id: I26e623a4e4ba965c07670369a90c8a95185ea1e4
* A service for read-only modeTim Starling2017-04-191-0/+196
Introduce a service to represent wfReadOnly() and friends. It's necessary to have two service instances, one for wfReadOnly() and one for wfConfiguredReadOnlyReason(), to avoid a circular dependency, since LoadBalancer needs the configured reason during construction, but wfReadOnly() needs to query the currently active load balancer. Not having a cache of the configuration makes it possible to dynamically change the configuration. Ideally things would not change the configuration, and I removed such instances in core, but to support extensions, I added a test ensuring that the configuration can be changed. Change-Id: I9bbee946c10742526d3423208efd68cb3cc5a7ee