2020-05-15 17:19:03 +00:00
|
|
|
<?php
|
|
|
|
|
2024-02-22 15:31:00 +00:00
|
|
|
namespace MediaWiki\Extension\Notifications\Test\API;
|
|
|
|
|
|
|
|
use MediaWiki\Api\ApiUsageException;
|
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 {
|
2024-07-26 12:45:47 +00:00
|
|
|
$this->overrideConfigValue( 'EchoEnablePush', true );
|
2020-05-15 17:19:03 +00:00
|
|
|
$params = [
|
|
|
|
'action' => 'echopushsubscriptions',
|
|
|
|
'command' => 'create',
|
|
|
|
'platform' => 'apns',
|
|
|
|
'platformtoken' => 'ABC123',
|
|
|
|
];
|
|
|
|
$this->expectException( ApiUsageException::class );
|
|
|
|
$this->doApiRequest( $params );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|