mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-21 04:03:40 +00:00
291ea47dd3
This might make dependencies easier to find. Change-Id: I158fd9f63f18a2b8da0368ac95d5fb5aa9bca3ff
26 lines
829 B
PHP
26 lines
829 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\Notifications\Test\Integration\Push;
|
|
|
|
use MediaWiki\Extension\Notifications\Services;
|
|
use MediaWikiIntegrationTestCase;
|
|
use MockHttpTrait;
|
|
use MWHttpRequest;
|
|
use Wikimedia\TestingAccessWrapper;
|
|
|
|
/** @covers \MediaWiki\Extension\Notifications\Push\NotificationServiceClient */
|
|
class NotificationServiceClientTest extends MediaWikiIntegrationTestCase {
|
|
use MockHttpTrait;
|
|
|
|
public function testConstructRequest(): void {
|
|
$this->installMockHttp( 'hi' );
|
|
|
|
$client = Services::getInstance()->getPushNotificationServiceClient();
|
|
$client = TestingAccessWrapper::newFromObject( $client );
|
|
$payload = [ 'deviceTokens' => [ 'foo' ], 'messageType' => 'checkEchoV1' ];
|
|
$request = $client->constructRequest( 'fcm', $payload );
|
|
$this->assertInstanceOf( MWHttpRequest::class, $request );
|
|
}
|
|
|
|
}
|