mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2025-01-09 05:14:39 +00:00
1d31fd753a
Finishes the implementation of the stubbed NotificationServiceClient. Sends push notification request messages to the endpoint configured in the EchoPushServiceBaseUrl setting. For example, to send messages to an instance of mediawiki/services/push-notifications running on the host machine while running MediaWiki in Docker, add the following line to LocalSettings.php: $wgEchoPushServiceBaseUrl = 'http://172.17.0.1:8900/v1/message'; Bug: T252899 Change-Id: Icab7825e9080d6b1a4cfc5e12fed1da221ce4610
17 lines
560 B
PHP
17 lines
560 B
PHP
<?php
|
|
|
|
use Wikimedia\TestingAccessWrapper;
|
|
|
|
/** @covers \EchoPush\NotificationServiceClient */
|
|
class NotificationServiceClientTest extends MediaWikiIntegrationTestCase {
|
|
|
|
public function testConstructRequest(): void {
|
|
$client = EchoServices::getInstance()->getPushNotificationServiceClient();
|
|
$client = TestingAccessWrapper::newFromObject( $client );
|
|
$payload = [ 'deviceTokens' => [ 'foo' ], 'messageType' => 'checkEchoV1' ];
|
|
$request = $client->constructRequest( 'fcm', $payload );
|
|
$this->assertInstanceOf( MWHttpRequest::class, $request );
|
|
}
|
|
|
|
}
|