Consistency aside, this is useful for grouping more tests
into separate threads when using directory based suites.
Bug: T50217
Change-Id: Ife9acd5990c4ae4a5fc18371559e93d7d86fb57d
* Avoid partial assertions using array subsets.
Instead, explicitly ignore the keys we want to ignore,
and then assert the array in full.
This way, newly added properties are explicitly detected
by the test, and it also automatically means that no bad
properties can be added. For example, properties like 'new',
'minor' and 'bot' express their meaning by sheer existence
and must never be tolerated to exist.
This was motivated by the many assertArraySubset() deprecation
warnings that were making the CI build output very noisy,
and thus it was difficult to quickly find real problems.
- For testNamespaceParam() I added rcprop=title, as it was
only asserting those keys. The alternative was to repeat
all the assertions for the overall output, which other tests
already did.
* Avoid using User::getName() or Title::getPrefixedText()
in the asserted expected value. Be explicit. This also
makes the test run considerably faster.
* Use 'tablesUsed' the way we normally do in MediaWiki unit
tests, by declaring the class member. (We never use
TestCase constructors.)
* Remove use of harcoded DB truncation for 'recentchanges'.
MediaWikiIntegrationTestCase does this already, which is what
`@group Database` and `tablesUsed` are for.
* Remove use of mutable TestUser, the user is never mutated.
This allows the internal registry to re-use the same instance.
* Remove use of assertArrayHasKey() where it only checked
something the test would immediately assert on the next line.
We already have PHPUnit configured in general to assert and
fail directly upon any undefined key access.
* Use sample names like Foo, Bar and Quux which are easier
to remember and distinguish than overly long and similar
titles with some word or number added at the end of them.
Change-Id: I8133e1199e3b1d053be7053795172891ad2bf48b
Done automatically using the master version of MW codesniffer and
running composer fix.
Bug: T192167
Change-Id: If6b40f515fde32ab5eff074a90e821c30c791827
Storing the user name or IP in every row in large tables like revision
and logging takes up space and makes operations on these tables slower.
This patch begins the process of moving those into one "actor" table
which other tables can reference with a single integer field.
A subsequent patch will remove the old columns.
Bug: T167246
Depends-On: I9293fd6e0f958d87e52965de925046f1bb8f8a50
Change-Id: I8d825eb02c69cc66d90bd41325133fd3f99f0226
This patch does two major things to the newly introduced
ApiQueryRecentChangesIntegrationTest:
* It rips the confusingly complicated assertArraySubsetsEqual appart.
* It removes all wikitext content. Note that no assertion is done on this
content (not even in the test that is about adding a category). The tests
run just fine with automatically generated content. I had to introduce the
$i counter to make sure consecutive edits are done with different content.
Otherwise the later edit is not stored.
Change-Id: Iae585be86f3fd9bff7d2b4b7b218d5b0b4258603