2020-05-22 22:02:34 +00:00
|
|
|
<?php
|
|
|
|
|
2022-04-08 00:38:27 +00:00
|
|
|
use MediaWiki\Extension\Notifications\Push\NotificationRequestJob;
|
|
|
|
use MediaWiki\Extension\Notifications\Push\PushNotifier;
|
|
|
|
use MediaWiki\Extension\Notifications\Push\Utils;
|
2020-05-22 22:02:34 +00:00
|
|
|
use Wikimedia\TestingAccessWrapper;
|
|
|
|
|
2022-04-08 00:38:27 +00:00
|
|
|
/** @covers \MediaWiki\Extension\Notifications\Push\PushNotifier */
|
2020-05-22 22:02:34 +00:00
|
|
|
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();
|
2020-08-11 20:34:21 +00:00
|
|
|
$centralId = Utils::getPushUserId( $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'] );
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|