mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-12-11 15:38:37 +00:00
21 lines
706 B
PHP
21 lines
706 B
PHP
|
<?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'] );
|
||
|
}
|
||
|
|
||
|
}
|