2020-06-02 23:21:36 +00:00
|
|
|
<?php
|
|
|
|
|
2022-11-13 07:53:42 +00:00
|
|
|
use MediaWiki\Extension\Notifications\Services;
|
2020-06-02 23:21:36 +00:00
|
|
|
use Wikimedia\TestingAccessWrapper;
|
|
|
|
|
2022-04-08 00:38:27 +00:00
|
|
|
/** @covers \MediaWiki\Extension\Notifications\Push\NotificationServiceClient */
|
2020-06-02 23:21:36 +00:00
|
|
|
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' );
|
|
|
|
|
2022-11-13 07:53:42 +00:00
|
|
|
$client = Services::getInstance()->getPushNotificationServiceClient();
|
2020-06-02 23:21:36 +00:00
|
|
|
$client = TestingAccessWrapper::newFromObject( $client );
|
|
|
|
$payload = [ 'deviceTokens' => [ 'foo' ], 'messageType' => 'checkEchoV1' ];
|
|
|
|
$request = $client->constructRequest( 'fcm', $payload );
|
|
|
|
$this->assertInstanceOf( MWHttpRequest::class, $request );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|