This never worked because it looked for `element` instead of `elements`.
The test repeated the same mistake.
Bug: T278576
Bug: T255717
Change-Id: I9bfceb6b8bd761244af6eda0e2ae08e98238aa76
While not documented or tested, aliases previously not only adding
but also replaced values.
Instead, emit a warning to inform skin developers of this conflict.
Note that the `content-links => elements` alias already behaves
this way (only if not already set), which the other aliases would
now be consistent with.
Change-Id: I66ae66b37bba14b2f65710f3d32f17d4e9a5a7a3
* Function alls are either complete on one line or one arg
per line. Avoid confusing calls where the args are on their
own line as this creates visual ambiguity over how many args
are passed, and what each piece belongs to. For example, is
`true` or `false` passed as 2nd arg to applyFeaturesCompatibility?
* Replace comment about list-form behaviour with something that
provides intention and insight instead of merely repeating what
can already be seen from the code.
* Fix malformed `@param` docs that used variable as part of sentence.
* Use named data providers to ease PHPUnit debugging,
and to make code coverage reports on doc.wikimedia.org more useful.
Change-Id: I2efd6cc7ac59c80684c9411025c4226473a36d43
* Move docs for deprecated aliases from top-level mentions into
footnotes under primary docs. Still easy to search for, but no
longer advertised as important for skin devs to know about
or scan past when reading.
* Fix bug in 'legacy' logic where the key was not unset, thus
mandating a needless entry in FEATURES constant. With the bug
fixed, this internal entry is no longer needed.
* Fix bug in 'interface' logic where the key was not unset
when the value is false. This would break the "skins.vector.styles"
module otherwise, and had a similar workaround in place that
is now no longer needed.
* Remove other unneeded entries in FEATURES for keys that were
already being unset by applyFeaturesCompatibility().
* Remove deprecation warnings in favour of letting ResourceModules
give a stable interface from ResourceLoader to skin.json.
* Add missing test to confirm no-op behaviour.
Bug: T374262
Change-Id: I9f4b1d48127d0afe67bada44d8dc4472507f9506
I believe this makes the code less brittle, and also makes it a bit
more obvious what these strings are meant to represent.
Change-Id: Ia39b5c80af4b495931d0a68fd091b783645dd709
Fixed SkinModuleTest::provideGetFeatureFilePathsOrder as nesting of
arrays for parameters is wrong
Change-Id: I9875008adf62d284c48662ebfbd245d72e5be064
Changes SkinModule::getStyles to output config features
first, then skin customization styles last. This requires
using the ResourceLoader::makeCombinedStyles method to
first combine feature styles, then combine style related styles,
and return the concatenated result in SkinModule::getStyles().
The resulting stylesheet ordering is changed so that all
skin customization styles are always output after core styles,
which allows skins to override core-styles via cascade order instead
of increased specificity.
Previous output order:
- all (core+custom)
- print (core+custom)
- screen (core+custom)
- other custom
New output order:
- all (core)
- print (core)
- screen (core)
- other (core)
- all (custom)
- print (custom)
- screen (custom)
- other (custom)
SkinModule is refactored to separate logo-related style
generation, as well as skin feature generation, in order to maintain
testability. Tests are also refactored to better cover different
skin feature configurations.
Bug: T354975
Change-Id: I261742c0ae4c3d57353bf1854af66f39df6132f7
This reverts commit afdc92987f.
Also reverts Ib44687b which was a follow-up.
Reason for revert: Caused T357929
Bug: T357929
Bug: T354975
Change-Id: Ic6d0b472cc2b26cb7c375bf9a5d2e03a4d6c6a18
Leave class aliases behind because they might be being used somewhere,
but we don't normally flag these kinds of things in the release notes,
do we?
Bug: T357823
Change-Id: I7fc7f34494d5c4df81f6746d63df1d0f990f8ae9
Reorders ResourceLoader\\SkinModule style output so that all styles
produced by skins are output after styles that are produces by
skin "features" such as normalize.
Refactors & expands SkinModuleTest.php to include tests for default
values, print styles and correct style ordering.
Bug: T354975
Change-Id: I0000b4ad8eb2de40be293f0e693d873c282ea785
It has been deprecated since 1.35, hard deprecated since at least I9776d11d4e2d184
No grep result in wmf-config
Change-Id: I2c67bab3e3212f25a0cbce7301f5e32a082f76da
Creates a new resourceLoader module which holds the
scripts and styles related to the temp user (IP masking) banner
described in T339379.
The temp user banner includes a tooltip which explains
what temporary accounts are. This is built using OO.ui.PopupWidget
and includes a clock icon and parsed i18n messages.
The Tooltip dependencies are loaded and instantiated on a click event
in order to minimize the dependencies on page load.
Bug: T339379
Change-Id: Ie2631221b0a07dd3bf55e970805d30fbb3cac190
Depends-on: Id5a4a9a00e50420c50868c54f899d36d7ddd373d
Depends-on: Icf622c4be910f5d14de95355efa02c05930179bf
Creates a new skin component for informing users with
temporary accounts that they can login or register if they choose.
Adds:
- New skin component: SkinComponentTempUserBanner.php
- Skin feature: "temp-user-banner"
- Associated styles
- New i18n messages for banner
NOTE: This component is not registered via the skinComponentRegistry
because it doesn't output any data, only a string of HTML.
Instead it is appended to the body element before the skin is rendered.
Bug: T330510
Change-Id: I1e137dbd29f3c73efac901f43f8a8258e2a111fc
Just methods where adding "static" to the declaration was enough, I
didn't do anything with providers that used $this.
Initially by search and replace. There were many mistakes which I
found mostly by running the PHPStorm inspection which searches for
$this usage in a static method. Later I used the PHPStorm "make static"
action which avoids the more obvious mistakes.
Bug: T332865
Change-Id: I47ed6692945607dfa5c139d42edbd934fa4f3a36
While working on the site notice in Vector we've noticed these
styles are proving more problematic than helpful so splitting these
up allows us more granularity in the styles we ship.
The core interface styles are now enabled by default as they contain
important logic relating to empty portlets and the print footer
Bug: T316027
Change-Id: Ib5ae640bb260cee46e654228b785c776722c7003
I consider it busywork to maintain this, for no tangible benefit.
Limiting the credited coverage to a class is limiting enough to
exclude unintended coverage from reports. Especially as this
helps ensure tracking coverage correctly for implementation details
such as helper methods and internal methods that do not warrant
their own test as that would defeat the purpose of tests exercising
the contract and demonstrating good usage.
Change-Id: Icf865f15cbd86585bbc02fc4943a960efb40c0eb
Calling ->onlyMethods( [] ) with an empty array does have an effect.
By default, all methods are mocked, which means the original code is
not called. Calling ->onlyMethods( [] ) turns this around. No methods
are mocked but all call the original code.
This is almost the same as ->enableProxyingToOriginalMethods(). The
difference is that ->enableProxyingToOriginalMethods() also requires
the original constructor to be called, but ->onlyMethods( [] ) does
not.
We can get rid of this confusing setup in tests that don't need it.
All tests in this patch that succeed with a simple ->createMock()
just demonstrated that they don't need it.
Change-Id: I341323a1ca793c039498f80b7f073c124b6b6ae0
createMock() does the same, but is much easier to read.
A small difference is that some of the replacements made in this
patch didn't use disableOriginalConstructor() before. In case this
was relevant we should see the respective test fail. If not we can
save some CPU cycles and skip these constructors.
Change-Id: Ib98fb06e0fe753b7a53cb087a47e1159515a8ad5
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader itself.
Move the tests by analogy.
I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".
I did not address DependencyStore which continues to have a non-standard
location and namespace.
Revert of a241d83e0a.
Bug: T308718
Change-Id: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
This reverts commit e08ea8ccb9.
Reason for revert: Breaks Phan in extensions, and as far as I’m aware,
this change isn’t urgently needed for anything, so the simplest fix is
to revert it again for now. After PHP 7.4 it should be safer to try this
again (we hopefully won’t need the two “hack” classes by then).
Bug: T308443
Change-Id: Iff3318cbf97a67f821f78e60da62a583f63e389e
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader and
ResourceLoaderContext.
Move the tests by analogy.
I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".
I did not address DependencyStore which continues to have a non-standard
location and namespace.
Change-Id: I92998ae6a82e0b935c13e02a183e7c324fa410a3
2022-05-16 14:41:27 +10:00
Renamed from tests/phpunit/includes/resourceloader/ResourceLoaderSkinModuleTest.php (Browse further)