Changes from patch set Icb93c79f4843b59dae80d3eda1a880457a1a68f2
Also some swaps from assertEquals to assertSame/True/False/Null
Change-Id: Ife497ae6cb1888b77eb25e85b76df72adc65641a
Use MediaWikiIntegrationTestCase::getExistingTestPage instead
of custom helper method createPage(), and remove unneeded
setting of globals
Change-Id: I63c4cd5a62d0c901cca596b4a52490153271f0c6
This re-applies I15cc5a64d7fcc3d09f9175a3ca8dd8180761f085
This reverts the revert in af71ce1864.
Reason for revert: should no longer fail with Title::assertProperPage no longer checking for fragments.
Change-Id: I60b8cd14c8304ad34a69e22b978fa476430a867c
This reverts commit 07d885248b.
Reason for revert: breaks tests in weird and unexpected ways
Bug: T279796
Bug: T281180
Change-Id: Iedc12256c8cd17498bcc12e184a12acbe5f2ac3b
* Remove mention of the once-new-now-deprecated assertArraySubset()
method of PHPUnit.
* Rename private "the_properties" to use camelCase and have a
clearer name in relation to "$properties" (actual vs expected).
* Avoid dynamically computing the expected values at run time.
In particular I found array_replace_recursive() making the
test hard to review for correctness.
Previously, it changed our expected properties to contain the
additional properties from the actual return value, and then
compared the two, which is somewhat confusing, since those
values are not actually what we gave the test nor what we
care about.
Instead use the expectedProperties array unmodified, and
run the assertion only on the subset of keys we want to assert.
Change-Id: I526d8a47296adcb84ed427639e149e69a83c8280
Repeating the variable name doesn't do anything. Documentation
generators don't need it. It's more stuff to read that doesn't add new
information. And it can become outdated.
Note there are two types of @var docs. When used inline (and not on a
class property) the variable name is needed.
Change-Id: If5a520405efacd8cefd90b878c999b842b91ac61
This avoids error-prone code written separately in every test. In
addition to no existing tests resetting the TitleFormatter (more
services probably need to be reset as well), they mostly reset only the
namespace cache on $wgContLang, which wouldn't help for any other
language.
The parser test runner still doesn't do this, but maybe it should.
Change-Id: I44b7a1aec48f14b0950907fa14bd0df80f674296
MWNamespace has three internal caches, only one of which can be cleared
(and that somewhat oddly by passing a boolean to
MWNamespace::getCanonicalNamespaces()).
This change introduces a MWNamespace::clearCaches() method to clear all
three caches. It also adds some resetting in tests that seemed to be
missing it.
Change-Id: I1dcfcd8713888b3ff8fc75e95329ba72bd95d0c9
It looks like there is something missing after the last statement
Also remove some other empty lines at begin of functions, ifs or loops
while at these files
Change-Id: Ib00b5cfd31ca4dcd0c32ce33754d3c80bae70641