Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| FlushUtterancesByExpirationDateOnFileJobQueue | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
| queueJob | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Wikispeech\Utterance; |
| 4 | |
| 5 | /** |
| 6 | * @file |
| 7 | * @ingroup Extensions |
| 8 | * @license GPL-2.0-or-later |
| 9 | */ |
| 10 | |
| 11 | use MediaWiki\MediaWikiServices; |
| 12 | use Mediawiki\Title\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 | */ |
| 23 | class 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 | MediaWikiServices::getInstance()->getService( 'Wikispeech.UtteranceStore' ) |
| 35 | |
| 36 | ) ); |
| 37 | } |
| 38 | } |