mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Merge "Avoid use of IDatabase::update return value"
This commit is contained in:
commit
f84c49a9f9
|
@ -122,7 +122,7 @@ class EchoUserNotificationGateway {
|
|||
return false;
|
||||
}
|
||||
|
||||
return $dbw->update(
|
||||
$dbw->update(
|
||||
self::$notificationTable,
|
||||
[ 'notification_read_timestamp' => $dbw->timestamp( wfTimestampNow() ) ],
|
||||
[
|
||||
|
@ -131,6 +131,8 @@ class EchoUserNotificationGateway {
|
|||
],
|
||||
__METHOD__
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,9 +24,9 @@ class EchoUserNotificationGatewayTest extends MediaWikiTestCase {
|
|||
$gateway = new EchoUserNotificationGateway( User::newFromId( 1 ), $this->mockMWEchoDbFactory( [ 'update' => true ] ) );
|
||||
$this->assertTrue( $gateway->markAllRead( [ 2 ] ) );
|
||||
|
||||
// unsuccessful update
|
||||
// null update
|
||||
$gateway = new EchoUserNotificationGateway( User::newFromId( 1 ), $this->mockMWEchoDbFactory( [ 'update' => false ] ) );
|
||||
$this->assertFalse( $gateway->markAllRead( [ 2 ] ) );
|
||||
$this->assertTrue( $gateway->markAllRead( [ 2 ] ) );
|
||||
}
|
||||
|
||||
public function testGetNotificationCount() {
|
||||
|
|
Loading…
Reference in a new issue