Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
NotificationJob | |
0.00% |
0 / 6 |
|
0.00% |
0 / 2 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
6 | |||
run | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\Notifications\Jobs; |
4 | |
5 | use Job; |
6 | use MediaWiki\Extension\Notifications\Controller\NotificationController; |
7 | use MediaWiki\Extension\Notifications\Mapper\EventMapper; |
8 | use MediaWiki\Title\Title; |
9 | |
10 | class NotificationJob extends Job { |
11 | |
12 | public function __construct( Title $title, array $params ) { |
13 | $command = isset( $params['jobReleaseTimestamp'] ) ? 'DelayedEchoNotificationJob' : 'EchoNotificationJob'; |
14 | parent::__construct( $command, $title, $params ); |
15 | } |
16 | |
17 | public function run() { |
18 | $eventMapper = new EventMapper(); |
19 | $event = $eventMapper->fetchById( $this->params['eventId'], true ); |
20 | NotificationController::notify( $event, false ); |
21 | |
22 | return true; |
23 | } |
24 | } |