Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 1
FlowEnabledOnTalkpagePresentationModel
0.00% covered (danger)
0.00%
0 / 13
0.00% covered (danger)
0.00%
0 / 5
30
0.00% covered (danger)
0.00%
0 / 1
 getIconType
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 canRender
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getPrimaryLink
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
 getSecondaryLinks
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
 getHeaderMessage
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Flow\Notifications;
4
5class FlowEnabledOnTalkpagePresentationModel extends FlowPresentationModel {
6
7    /** @inheritDoc */
8    public function getIconType() {
9        return 'chat';
10    }
11
12    /** @inheritDoc */
13    public function canRender() {
14        return $this->hasTitle();
15    }
16
17    /** @inheritDoc */
18    public function getPrimaryLink() {
19        return [
20            'url' => $this->event->getTitle()->getFullURL(),
21            'label' => $this->msg( 'flow-notification-link-text-enabled-on-talkpage' )->text()
22        ];
23    }
24
25    /**
26     * All Flow notifications have the 'Agent' link except this one.
27     *
28     * @return array[]
29     */
30    public function getSecondaryLinks() {
31        $userTalkLink = $this->getPageLink(
32            $this->event->getTitle(), '', true
33        );
34        return [ $userTalkLink ];
35    }
36
37    /** @inheritDoc */
38    public function getHeaderMessage() {
39        $msg = parent::getHeaderMessage();
40        $msg->params( $this->getTruncatedTitleText( $this->event->getTitle(), true ) );
41        return $msg;
42    }
43
44}