mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 01:10:07 +00:00
Merge "Adjust doc for EchoNotification::readTimestamp"
This commit is contained in:
commit
ceda28121f
|
@ -28,7 +28,7 @@ class EchoNotification extends EchoAbstractEntity implements Bundleable {
|
|||
protected $timestamp;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
* @var string|null
|
||||
*/
|
||||
protected $readTimestamp;
|
||||
|
||||
|
@ -152,11 +152,7 @@ class EchoNotification extends EchoAbstractEntity implements Bundleable {
|
|||
$notification->user = User::newFromId( $row->notification_user );
|
||||
// Notification timestamp should never be empty
|
||||
$notification->timestamp = wfTimestamp( TS_MW, $row->notification_timestamp );
|
||||
// Only convert to MW format if it is not empty, otherwise
|
||||
// wfTimestamp would use current timestamp for empty cases
|
||||
if ( $row->notification_read_timestamp ) {
|
||||
$notification->readTimestamp = wfTimestamp( TS_MW, $row->notification_read_timestamp );
|
||||
}
|
||||
$notification->readTimestamp = wfTimestampOrNull( TS_MW, $row->notification_read_timestamp );
|
||||
$notification->bundleHash = $row->notification_bundle_hash;
|
||||
|
||||
return $notification;
|
||||
|
|
|
@ -32,7 +32,7 @@ class EchoNotificationMapperTest extends MediaWikiIntegrationTestCase {
|
|||
'event_agent_ip' => '',
|
||||
'notification_user' => 1,
|
||||
'notification_timestamp' => '20140615101010',
|
||||
'notification_read_timestamp' => '',
|
||||
'notification_read_timestamp' => null,
|
||||
'notification_bundle_hash' => 'testhash',
|
||||
]
|
||||
];
|
||||
|
|
|
@ -54,7 +54,7 @@ class EchoNotificationTest extends MediaWikiIntegrationTestCase {
|
|||
'notification_user' => 1,
|
||||
'notification_event' => 1,
|
||||
'notification_timestamp' => time(),
|
||||
'notification_read_timestamp' => '',
|
||||
'notification_read_timestamp' => null,
|
||||
'notification_bundle_hash' => 'testhash',
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue