2020-05-15 17:19:03 +00:00
|
|
|
<?php
|
|
|
|
|
2024-06-12 18:31:47 +00:00
|
|
|
use MediaWiki\Tests\Api\ApiTestCase;
|
|
|
|
|
2020-05-15 17:19:03 +00:00
|
|
|
/**
|
|
|
|
* @group medium
|
|
|
|
* @group API
|
2022-04-08 00:47:34 +00:00
|
|
|
* @covers \MediaWiki\Extension\Notifications\Push\Api\ApiEchoPushSubscriptions
|
2020-05-15 17:19:03 +00:00
|
|
|
*/
|
|
|
|
class ApiEchoPushSubscriptionsTest extends ApiTestCase {
|
|
|
|
|
|
|
|
public function testRequiresToken(): void {
|
|
|
|
$this->setMwGlobals( 'wgEchoEnablePush', true );
|
|
|
|
$params = [
|
|
|
|
'action' => 'echopushsubscriptions',
|
|
|
|
'command' => 'create',
|
|
|
|
'platform' => 'apns',
|
|
|
|
'platformtoken' => 'ABC123',
|
|
|
|
];
|
|
|
|
$this->expectException( ApiUsageException::class );
|
|
|
|
$this->doApiRequest( $params );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|