mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-11 15:38:37 +00:00
7170b0f35f
Use the mock HTTP request, in preparation for I1702c11928f87 Depends-On: I8ce17da7315b87b8dd0e502e601b9ac488089456 Needed-By: I1702c11928f8760bb41b41f4c7c04d7af03f62e2 Bug: T262443 Change-Id: I390856b4609635cee22253071f21ce63ff716791
20 lines
615 B
PHP
20 lines
615 B
PHP
<?php
|
|
|
|
use Wikimedia\TestingAccessWrapper;
|
|
|
|
/** @covers \EchoPush\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 );
|
|
}
|
|
|
|
}
|