mediawiki-extensions-Echo/tests/phpunit/integration/Push/PushNotifierTest.php
Michael Holloway a2412732f6 Push: Add additional job params for logging
Adds additional job parameters to help diagnose the apparent issue of
jobs being performed twice on Beta.

Bug: T255068
Change-Id: Ib257a24056539487e1110fe286fa4535c3fec94a
2020-06-17 17:58:21 -04:00

21 lines
692 B
PHP

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