mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2025-01-06 03:45:25 +00:00
a5bcc65504
Updates the push subscription query to retrieve a provider string rather than only its numeric internal ID. Change-Id: I910173409e48e8b6a6739d3122165c40b0d52b7f
23 lines
691 B
PHP
23 lines
691 B
PHP
<?php
|
|
|
|
use EchoPush\Subscription;
|
|
use Wikimedia\Timestamp\ConvertibleTimestamp;
|
|
|
|
/** @covers \EchoPush\Subscription */
|
|
class SubscriptionTest extends MediaWikiUnitTestCase {
|
|
|
|
public function testNewFromRow(): void {
|
|
$row = new stdClass();
|
|
$row->eps_token = 'ABC123';
|
|
$row->epp_name = 'fcm';
|
|
$row->eps_updated = '2020-01-01 10:10:10';
|
|
|
|
$subscription = Subscription::newFromRow( $row );
|
|
$this->assertSame( 'ABC123', $subscription->getToken() );
|
|
$this->assertSame( 'fcm', $subscription->getProvider() );
|
|
$this->assertInstanceOf( ConvertibleTimestamp::class, $subscription->getUpdated() );
|
|
$this->assertSame( '1577873410', $subscription->getUpdated()->getTimestamp() );
|
|
}
|
|
|
|
}
|