mw-ui-vform-field no longer applies to the form fields on
Special:UserLogin. Instead, target the missing field with
HTMLSubmitField. Also make a note to remove these styles once Codex's
styles for spacing between form fields have been improved.
Change-Id: I83ef3ef4530fc0b57170a75a8e0ad1a5de8e0e89
The new trait provides conveniance methods for logging and throwing
errors based on StatusValue instances.
Change-Id: Id7cbacb744bee79cd8a6f61291a26b36e6243053
The idea is for all entry points to use the MediaWikiEntryPoint
base class, to improve consistency and testability.
Bug: T354216
Change-Id: I3678afe32c7c1a313d2dcb1808286c25ecd167eb
We don't usually compare object serializations with assertEquals as
they tend to make it difficult to know what is and isn't being asserted,
giving the illusion that it checks "everything" but can in some cases
be closer to "too much" or "nothing".
Actual logic:
* https://github.com/sebastianbergmann/phpunit/blob/9.6.17/src/Framework/Assert.php#L330
* https://github.com/sebastianbergmann/phpunit/blob/9.6.17/src/Framework/Constraint/Equality/IsEqual.php
* https://github.com/sebastianbergmann/comparator/blob/5.0.1/src/ObjectComparator.php
* https://github.com/sebastianbergmann/exporter/blob/5.1.2/src/Exporter.php
This means sub classes or value objects are needlessly discarded,
as well as potentially irrelevant state in the object is becoming
part of the test.
It is not a surprise then, that these assertions are not comparing
against any particular desired outcome, but are literally a copy-paste
of the source code, including functions that have no effect in testing
such as `ContentHandler::getLocalizedName( 'testing' )` === 'testing',
and untested expressions like `$wikipage->getTitle()->getPrefixedText()`
instead of an explicit expectation.
Replace this with assertStatusError and limit the assertion to
being !isOK, and error using the specified interface message key.
Testing that the correct parameters are passed is imho not a part
of this test, since the test isn't actually validating it to be
correct or sensible in terms of message contents and parsed outcome,
it is only verifying that we have correctly copied the source, which
still needs the same review as it otherwise would.
Change-Id: I8c7a660489e9000f9790f8d69478a05ad8c446b6
Besides expanding getCodex() to build the Field component and its
constituent parts, this required adding parameters to pass the
cdx-message--inline class to the error box generation code, and passing
the error status to getCodexHtml() so that field subclasses can add
status CSS classes to the components they generate.
Bug: T359021
Change-Id: Iab3f3c81f4de034a3a04b54caf269de6fde4a7f2
This patch promotes a consistent design decision across projects in
MediaWiki core, extensions, and skins. The darker red color meets the
W3C Web Content Accessibility Guidelines (WCAG) at Level AA that text
or images of text must have a contrast ratio of at least 4.5:1 (or 3:1
for large text).
Note: Updated the color palette labels from deprecated tokens to the
current option token.
Bug: T343239
Change-Id: Id2260a8b1e7b091bda1af9aabfcc4ac8cdd67760
=== Objective ===
* Remove reliance on global state via WikiMap.
* Reduce reliance on MediaWikiServices::getInstance().
=== Details ===
Note that this does not increase or introduce use of cross-wiki
database connections. preloadTitleInfo() is not an optimistic
optimisation. We only pass modules to preloadTitleInfo() if the
caller will call WikiModule->getTitleInfo() shortly thereafter.
The Zend hack is no longer needed, as this existed to support PHP 5.5
as per <https://3v4l.org/EU6Ro>.
Remove needless complexity around levering array_intersect_key. This
made sense originally in I82e215745 (dbd11e04aa), when the arrays
had the same keys, but since Ibe7881577 (dbe592df6d) they don't.
Given they don't match, take the direct approach instead.
Bug: T359522
Change-Id: I7d407a1989d28ef329ab430841251c910fe78732
* Remove references to IDatabase from preloadModuleInfo() and with
it the last reference to Rdbms in the ResourceLoader service
(progressing T32956).
* Simplify WikiModule::preloadTitleInfo() so that it doesn't need
an IDatabase object unless
1) there are non-zero WikiModule objects in the batch, and
2) there is a cache miss.
* Remove needless IDatabase parameters passed or mocked for this
method. Note that WikiModule already had `@group Database` set
since each WikiModule::getDB() is called and uses an unmocked
database. The mocked database was only injected to satisfy the
method signature.
Bug: T32956
Bug: T359522
Change-Id: I022f02d6e6bbae46c3258a7c07a1d6723506d8bc
When copying blocks from ipblocks to the new block table, skip rows for
which the relevant ID already exists in the block table. In write-both
mode, it is expected that some blocks will have already been copied.
This also allows the script to be run multiple times on a wiki, so that
it can be used to clean up the current situation in production.
Bug: T355034
Change-Id: I54e65adef685bfc7d4f63853cd50ca0f55e2ecdb
Fixed SkinModuleTest::provideGetFeatureFilePathsOrder as nesting of
arrays for parameters is wrong
Change-Id: I9875008adf62d284c48662ebfbd245d72e5be064