2020-06-02 23:21:36 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Wikimedia\TestingAccessWrapper;
|
|
|
|
|
|
|
|
/** @covers \EchoPush\NotificationServiceClient */
|
|
|
|
class NotificationServiceClientTest extends MediaWikiIntegrationTestCase {
|
2020-09-21 20:50:32 +00:00
|
|
|
use MockHttpTrait;
|
2020-06-02 23:21:36 +00:00
|
|
|
|
|
|
|
public function testConstructRequest(): void {
|
2020-09-21 20:50:32 +00:00
|
|
|
$this->installMockHttp( 'hi' );
|
|
|
|
|
2020-06-02 23:21:36 +00:00
|
|
|
$client = EchoServices::getInstance()->getPushNotificationServiceClient();
|
|
|
|
$client = TestingAccessWrapper::newFromObject( $client );
|
|
|
|
$payload = [ 'deviceTokens' => [ 'foo' ], 'messageType' => 'checkEchoV1' ];
|
|
|
|
$request = $client->constructRequest( 'fcm', $payload );
|
|
|
|
$this->assertInstanceOf( MWHttpRequest::class, $request );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|