Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
ImageSuggestionsEchoTestHelper
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 send
0.00% covered (danger)
0.00%
0 / 9
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace MediaWiki\Extension\ImageSuggestions;
4
5/**
6 * ImageSuggestions Echo test notification helper
7 *
8 * @file
9 * @ingroup Extensions
10 * @license MIT
11 */
12
13use MediaWiki\Extension\Notifications\Model\Event;
14use MediaWiki\Title\Title;
15use MediaWiki\User\UserIdentity;
16
17class ImageSuggestionsEchoTestHelper {
18    /**
19     * Notify the user if they haven't already been notified on this wiki
20     *
21     * @param UserIdentity $user
22     * @param Title $title
23     * @param string $imageurl
24     */
25    public static function send( UserIdentity $user, Title $title, $imageurl ) {
26        $type = 'image-suggestions';
27
28        Event::create( [
29            'type' => $type,
30            'title' => $title,
31            'extra' => [
32                'imageurl' => $imageurl,
33            ],
34            'agent' => $user,
35        ] );
36    }
37}