Don't call count() with a non-countable value

Triggers a warning in PHP 7.2.

Bug: T206541
Change-Id: I5c25b59cd91871fcdbbf73e01af5a61c05c5fffd
This commit is contained in:
Kunal Mehta 2018-10-12 20:49:42 -07:00
parent 319789827c
commit dbf44b1be7

View file

@ -121,9 +121,10 @@ class EchoUserNotificationGatewayTest extends MediaWikiTestCase {
$db->expects( $this->any() )
->method( 'selectRowCount' )
->will( $this->returnValue( $dbResult['selectRowCount'] ) );
$numRows = is_array( $dbResult['select'] ) ? count( $dbResult['select'] ) : 0;
$db->expects( $this->any() )
->method( 'numRows' )
->will( $this->returnValue( count( $dbResult['select'] ) ) );
->will( $this->returnValue( $numRows ) );
return $db;
}