Thank you Brad, the missing @covers line is indeed what threw me off.
Also, as Trey noted, it's easy to miss negative cases. Testing every guard
statement is certainly good, but does not feel as natural or as critical as
testing the "happy path"...
-- daniel
Am 26.04.2018 um 23:13 schrieb Brad Jorsch (Anomie):
On Thu, Apr 26, 2018 at 3:55 PM, Kunal Mehta
<legoktm(a)member.fsf.org> wrote:
| includes/Storage/RevisionSlots.php |
58.33 | 49.35 |
Most of the issue there is that hasSameContent() is not being recorded as
"covered" at all because you forgot the @covers annotation on
testHasSameContent().
I also see an added uncovered line in setSlotsInternal(). Probably that too
is actually being covered but nothing has a @covers annotation for the
method.
| includes/Storage/SlotRecord.php |
94.64 | 94.51 |
Coverage of all the existing code is unchanged. The patch adds 13 lines in
hasSameContentAs(), but only covers 12 of them with tests. Line 594 was
missed, which explains the slight decrease.
In this case no method-level @covers is needed because SlotRecordTest has
"@covers \MediaWiki\Storage\SlotRecord" at the class level.