mediawiki-extensions-Echo/tests/phpunit/integration/Push/PushNotifierTest.php
Reedy c76761eff3 Move EchoPush namespace to MediaWiki\Extension\Notifications\Push
Bug: T305667
Change-Id: I5a7846a0fc383bddbf6511d6ba73c8be7d7760c7
2022-04-25 13:56:09 +01:00

22 lines
802 B
PHP

<?php
use MediaWiki\Extension\Notifications\Push\NotificationRequestJob;
use MediaWiki\Extension\Notifications\Push\PushNotifier;
use MediaWiki\Extension\Notifications\Push\Utils;
use Wikimedia\TestingAccessWrapper;
/** @covers \MediaWiki\Extension\Notifications\Push\PushNotifier */
class PushNotifierTest extends MediaWikiIntegrationTestCase {
public function testCreateJob(): void {
$notifier = TestingAccessWrapper::newFromClass( PushNotifier::class );
$user = $this->getTestUser()->getUser();
$centralId = Utils::getPushUserId( $user );
$job = $notifier->createJob( $user );
$this->assertInstanceOf( NotificationRequestJob::class, $job );
$this->assertSame( 'EchoPushNotificationRequest', $job->getType() );
$this->assertSame( $centralId, $job->getParams()['centralId'] );
}
}