Fix assertArrayEquals() calls with bogus 3rd parameter
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Thu, 14 Mar 2019 13:53:41 +0000 (14:53 +0100)
committerThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Thu, 14 Mar 2019 17:02:08 +0000 (18:02 +0100)
commit8c33a391a089c105dae619209149e72ca54a84a0
tree42cdd93377cf2ea6fa0fed00913da5415c020e7e
parent43a0144346da4e6edbbadee0b7d9def53357bc10
Fix assertArrayEquals() calls with bogus 3rd parameter

This issue came up in I8a49143, see
https://integration.wikimedia.org/ci/job/mediawiki-quibble-vendor-postgres-php70-docker/2453/console
The third parameter of assertArrayEquals() is called $ordered and is
meant to take the order of elements into account. Providing a string sets
this to true. The SQL query in ChangesListSpecialPageTest seems to behave
a bit random in Postgres and does not always return the elements in the
same order. This is fine. It's just the assertion that was to strict, by
accident.

I found a few more instances of the same issue with a regular expression.
In most cases I intentionally changed it to assertSame() because the order
of elements is actually guaranteed by the code, and needs to be (e.g.
mixing width and height of an image would be fatal).

Change-Id: Ice66cab873a7271d55809a486ce28cf637e43e33
tests/phpunit/includes/media/DjVuTest.php
tests/phpunit/includes/specialpage/ChangesListSpecialPageTest.php
tests/phpunit/maintenance/categoryChangesAsRdfTest.php
tests/phpunit/structure/ResourcesTest.php