mediawiki-extensions-Echo/tests/phpunit/integration/Push/NotificationServiceClientTest.php
Reedy c76761eff3 Move EchoPush namespace to MediaWiki\Extension\Notifications\Push
Bug: T305667
Change-Id: I5a7846a0fc383bddbf6511d6ba73c8be7d7760c7
2022-04-25 13:56:09 +01:00

20 lines
645 B
PHP

<?php
use Wikimedia\TestingAccessWrapper;
/** @covers \MediaWiki\Extension\Notifications\Push\NotificationServiceClient */
class NotificationServiceClientTest extends MediaWikiIntegrationTestCase {
use MockHttpTrait;
public function testConstructRequest(): void {
$this->installMockHttp( 'hi' );
$client = EchoServices::getInstance()->getPushNotificationServiceClient();
$client = TestingAccessWrapper::newFromObject( $client );
$payload = [ 'deviceTokens' => [ 'foo' ], 'messageType' => 'checkEchoV1' ];
$request = $client->constructRequest( 'fcm', $payload );
$this->assertInstanceOf( MWHttpRequest::class, $request );
}
}