2020-05-22 22:02:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use EchoPush\NotificationRequestJob;
|
|
|
|
use EchoPush\PushNotifier;
|
|
|
|
use Wikimedia\TestingAccessWrapper;
|
|
|
|
|
|
|
|
/** @covers \EchoPush\PushNotifier */
|
|
|
|
class PushNotifierTest extends MediaWikiIntegrationTestCase {
|
|
|
|
|
2020-06-17 19:59:42 +00:00
|
|
|
public function testCreateJob(): void {
|
2020-05-22 22:02:34 +00:00
|
|
|
$notifier = TestingAccessWrapper::newFromClass( PushNotifier::class );
|
|
|
|
$user = $this->getTestUser()->getUser();
|
|
|
|
$centralId = CentralIdLookup::factory()->centralIdFromLocalUser( $user );
|
2020-06-17 19:59:42 +00:00
|
|
|
$job = $notifier->createJob( $user );
|
2020-05-22 22:02:34 +00:00
|
|
|
$this->assertInstanceOf( NotificationRequestJob::class, $job );
|
|
|
|
$this->assertSame( 'EchoPushNotificationRequest', $job->getType() );
|
|
|
|
$this->assertSame( $centralId, $job->getParams()['centralId'] );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|