mediawiki-extensions-Echo/tests/phpunit/Api/Push/ApiEchoPushSubscriptionsTest.php
James D. Forrester 291ea47dd3 tests: Namespace the PHP classes
This might make dependencies easier to find.

Change-Id: I158fd9f63f18a2b8da0368ac95d5fb5aa9bca3ff
2024-10-03 20:30:06 +00:00

28 lines
651 B
PHP

<?php
namespace MediaWiki\Extension\Notifications\Test\API;
use MediaWiki\Api\ApiUsageException;
use MediaWiki\Tests\Api\ApiTestCase;
/**
* @group medium
* @group API
* @covers \MediaWiki\Extension\Notifications\Push\Api\ApiEchoPushSubscriptions
*/
class ApiEchoPushSubscriptionsTest extends ApiTestCase {
public function testRequiresToken(): void {
$this->overrideConfigValue( 'EchoEnablePush', true );
$params = [
'action' => 'echopushsubscriptions',
'command' => 'create',
'platform' => 'apns',
'platformtoken' => 'ABC123',
];
$this->expectException( ApiUsageException::class );
$this->doApiRequest( $params );
}
}