mediawiki-extensions-Echo/tests/phpunit/integration/Push/PushNotifierTest.php

21 lines
706 B
PHP
Raw Normal View History

<?php
use EchoPush\NotificationRequestJob;
use EchoPush\PushNotifier;
use Wikimedia\TestingAccessWrapper;
/** @covers \EchoPush\PushNotifier */
class PushNotifierTest extends MediaWikiIntegrationTestCase {
public function testCreateJobForUser(): void {
$notifier = TestingAccessWrapper::newFromClass( PushNotifier::class );
$user = $this->getTestUser()->getUser();
$centralId = CentralIdLookup::factory()->centralIdFromLocalUser( $user );
$job = $notifier->createJobForUser( $user );
$this->assertInstanceOf( NotificationRequestJob::class, $job );
$this->assertSame( 'EchoPushNotificationRequest', $job->getType() );
$this->assertSame( $centralId, $job->getParams()['centralId'] );
}
}