Commit graph

12 commits

Author SHA1 Message Date
Alexander Vorwerk
decbaf4f38 phpunit: use ->getServiceContainer() in integration tests
Change-Id: I38299cb65eeaadfdc0eb05db4e8c0b0119cfb37d
2022-01-27 22:04:16 +01: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
Reedy
8c39aab84b Remove or replace usages of "sanity"
Bug: T254646
Change-Id: Ib192dc5704a14d02c7c374d0ab29bac55c5df24a
2021-11-21 19:35:49 +00:00
Bartosz Dziewoński
b1b1ec343f ApiQuerySiteinfo: Fix "rightsinfo"/"url" when $wgRightsPage is set
Bug: T295191
Change-Id: I181b29dbdc8374837789c1d900577e49f62bd8d3
2021-11-05 21:56:01 +01:00
Ammarpad
1cf4eab3ab ApiParse: Support hidden skins
Since $wgSkipSkins is meant to only 'remove skin from preferences',
it should not affect parsing with them.

So these skins need to be allowed here.

To achive this, this patch adds getInstalledSkins() method to SkinFactory
to provide the complete. The method supersedes getSkinNames() which does
the same thing but with ambiguous name.

Description of getAllowedSkins() has been corrected as it was slightly incorrect.

Bug: T237856
Change-Id: I0889b823d27f1a2830cc0205f5a21ed4de744e08
2021-09-20 09:29:24 +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
Timo Tijhof
b281e3e059 api: Fix unstable ApiQuerySiteinfoTest case relying on default settings
This test failed by default in mediawiki-docker-dev or on any other
more (production-like) set up with a protocol-relative $wgServer value.

It passed in CI where it is set to `http://localhost:9412`.

The test also failed when $wgFileExtensions contained additional
entries for any reason.

Fix both of these tests by simplifying their needless inheriting of
live "current" settings and just set them to explicit example values
and them assert the way the code should behave for those values.

Follows-up 27d41f442a.

Remove use of wfExpandUrl() to formulate the "expected" value.
Expected values that are dynamic are an anti-pattern and greatly
decrease confidence in, and self-documenting value of, a test.

Change-Id: I6f7b8d89767ed8eaacbc615a9f22a3b357a6dd58
2021-05-20 18:55:15 +00:00
James D. Forrester
df5eb22f83 Replace uses of DB_MASTER with DB_PRIMARY
Just an auto-replace from codesniffer for now.

Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
2021-04-29 09:24:31 -07:00
Peter Ovchyn
45140daa29 Avoid using User ::getDefaultOption, ::getDefaultOptions
This patch hard-deprecates the methods above

Bug: T276035
Change-Id: Ic36b0702f7547acce0d162d6e0b54bbd4ecf4d81
2021-03-16 17:24:17 +02:00
Umherirrender
a1de8b8700 Tests: Mark more more closures as static
Result of a new sniff I25a17fb22b6b669e817317a0f45051ae9c608208

Bug: T274036
Change-Id: I695873737167a75f0d94901fa40383a33984ca55
2021-02-09 02:55:57 +00:00
Reedy
729f20afc8 Tests: Mark more closures as static
Bug: T274036
Change-Id: I911d3041cebe417d162934223b46ea295c6d20e3
2021-02-07 13:26:56 +01:00
Aaron Schulz
815912062f Move ApiQuery* tests under the /query subdirectory
Consistency aside, this is useful for grouping more tests
into separate threads when using directory based suites.

Bug: T50217
Change-Id: Ife9acd5990c4ae4a5fc18371559e93d7d86fb57d
2020-10-30 03:31:12 +00:00
Renamed from tests/phpunit/includes/api/ApiQuerySiteinfoTest.php (Browse further)