mediawiki-extensions-Echo/tests/phpunit/integration/Push/NotificationServiceClientTest.php
daniel 7170b0f35f Use MockHttpTrait
Use the mock HTTP request, in preparation for I1702c11928f87

Depends-On: I8ce17da7315b87b8dd0e502e601b9ac488089456
Needed-By: I1702c11928f8760bb41b41f4c7c04d7af03f62e2
Bug: T262443
Change-Id: I390856b4609635cee22253071f21ce63ff716791
2020-09-29 09:05:50 +00:00

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 );
}
}