diff options
author | Thiemo Kreuz <thiemo.kreuz@wikimedia.de> | 2019-09-17 16:03:28 +0200 |
---|---|---|
committer | Thiemo Kreuz (WMDE) <thiemo.kreuz@wikimedia.de> | 2019-09-27 19:15:38 +0000 |
commit | c2211946f7dd4e59faf6d759e9a78bf140699c3e (patch) | |
tree | f181189fc40a2f96368e87a96aad40a346ee904b /tests/phpunit/unit/includes/diff/DiffOpTest.php | |
parent | fa0f6f34972c0e0f4aac24a03b3efdfc45f256f6 (diff) | |
download | mediawikicore-c2211946f7dd4e59faf6d759e9a78bf140699c3e.tar.gz mediawikicore-c2211946f7dd4e59faf6d759e9a78bf140699c3e.zip |
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
Diffstat (limited to 'tests/phpunit/unit/includes/diff/DiffOpTest.php')
-rw-r--r-- | tests/phpunit/unit/includes/diff/DiffOpTest.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/phpunit/unit/includes/diff/DiffOpTest.php b/tests/phpunit/unit/includes/diff/DiffOpTest.php index 17487acbca22..6566e142be42 100644 --- a/tests/phpunit/unit/includes/diff/DiffOpTest.php +++ b/tests/phpunit/unit/includes/diff/DiffOpTest.php @@ -42,7 +42,7 @@ class DiffOpTest extends \MediaWikiUnitTestCase { $this->assertEquals( 'foo', $obj->getClosing( 0 ) ); $this->assertEquals( 'bar', $obj->getClosing( 1 ) ); $this->assertEquals( 'baz', $obj->getClosing( 2 ) ); - $this->assertEquals( null, $obj->getClosing( 3 ) ); + $this->assertNull( $obj->getClosing( 3 ) ); } /** |