tests: Remove use of wfRandomString() for test fixtures
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 4 May 2019 20:41:10 +0000 (21:41 +0100)
committerKrinkle <krinklemail@gmail.com>
Mon, 6 May 2019 17:22:03 +0000 (17:22 +0000)
commit4938038175bf2cb6168291c766ff15337209370b
treedea788b7fe9aa1e453820e67a99b75df350f2b62
parent2bcd74d9681689792e6430b595a095aa7fa084d9
tests: Remove use of wfRandomString() for test fixtures

This reduces confidence in the test. There is no guruantee that
it won't return the same value twice during the duration of a full
PHPUnit run of all test suites, whether twice in a row or 20 minutes
apart.

For a test that needs a string of any kind, use an explicit, consinstent
and cheap literal value.

For a test that specifically needs some kind of uniqueness compared to
something else within the same test case, do so explicitly.

Tests that require something globally unique (for some undefined/vague
definition of "global") were not found, and should not exist anyway.

Also, in libs/objectcache tests, fix order of parameters in some
assertions (expected first, then actual), and use assertFalse/assertSame
instead of assertEqual for cases where false is expected to remove
tolerance of other loosely equal values.

Change-Id: Ifc60e88178da471330b94bfbf12e2731d2efc77d
tests/phpunit/includes/GlobalFunctions/GlobalTest.php
tests/phpunit/includes/TestUserRegistry.php
tests/phpunit/includes/config/GlobalVarConfigTest.php
tests/phpunit/includes/filebackend/FileBackendTest.php
tests/phpunit/includes/jobqueue/JobQueueTest.php
tests/phpunit/includes/libs/objectcache/MultiWriteBagOStuffTest.php
tests/phpunit/includes/libs/objectcache/ReplicatedBagOStuffTest.php