Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
FlushUtterancesByExpirationDateOnFileJobQueue
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 queueJob
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Wikispeech\Utterance;
4
5/**
6 * @file
7 * @ingroup Extensions
8 * @license GPL-2.0-or-later
9 */
10
11use MediaWiki\MediaWikiServices;
12use Title;
13
14/**
15 * This used to be a single static method located in
16 * {@link FlushUtterancesByExpirationDateOnFileJob}
17 * but due to mocking not allowed in static scope, this had to be refactored
18 * to this new class. Feel free to suggest better solutions that can replace
19 * this method.
20 *
21 * @since 0.1.7
22 */
23class FlushUtterancesByExpirationDateOnFileJobQueue {
24    /**
25     * Queues a job.
26     *
27     * @since 0.1.7
28     */
29    public function queueJob() {
30        $jobQueueGroup = MediaWikiServices::getInstance()->getJobQueueGroup();
31        $jobQueueGroup->push( new FlushUtterancesByExpirationDateOnFileJob(
32                Title::newMainPage(),
33                []
34            ) );
35    }
36}