tests: Replace PHPUnit's loose assertEquals(null) with assertNull()
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Tue, 17 Sep 2019 14:03:28 +0000 (16:03 +0200)
committerThiemo Kreuz (WMDE) <thiemo.kreuz@wikimedia.de>
Fri, 27 Sep 2019 19:15:38 +0000 (19:15 +0000)
commitc2211946f7dd4e59faf6d759e9a78bf140699c3e
treef181189fc40a2f96368e87a96aad40a346ee904b
parentfa0f6f34972c0e0f4aac24a03b3efdfc45f256f6
tests: Replace PHPUnit's loose assertEquals(null) with assertNull()

assertEquals( null, … ) still succeeds when the actual value is 0, false,
an empty string, even an empty array. All these should be reported as a
failure, I would argue.

Note this patch previously also touched assertSame( null ). I reverted
these. The only benefit would have been consistency within this codebase,
but there is no strict reason to prefer one over the other. assertNull()
and assertSame( null ) are functionally identical.

Change-Id: I92102e833a8bc6af90b9516826abf111e2b79aac
14 files changed:
tests/phpunit/includes/changes/CategoryMembershipChangeTest.php
tests/phpunit/includes/content/WikitextContentTest.php
tests/phpunit/includes/db/LBFactoryTest.php
tests/phpunit/includes/db/LoadBalancerTest.php
tests/phpunit/includes/filebackend/FileBackendTest.php
tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php
tests/phpunit/includes/pager/RangeChronologicalPagerTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderContextTest.php
tests/phpunit/includes/session/CookieSessionProviderTest.php
tests/phpunit/unit/includes/FauxResponseTest.php
tests/phpunit/unit/includes/changes/ChangesListFilterGroupTest.php
tests/phpunit/unit/includes/diff/DiffOpTest.php
tests/phpunit/unit/includes/language/LanguageCodeTest.php
tests/phpunit/unit/includes/session/SessionUnitTest.php