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
ApiFlowViewTopic
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
 __construct
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getBlockParams
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getAction
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getAllowedParams
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
 getExamplesMessages
0.00% covered (danger)
0.00%
0 / 4
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Flow\Api;
4
5use Wikimedia\ParamValidator\ParamValidator;
6
7class ApiFlowViewTopic extends ApiFlowBaseGet {
8    public function __construct( $api, $modName ) {
9        parent::__construct( $api, $modName, 'vt' );
10    }
11
12    /**
13     * Taken from ext.flow.base.js
14     *
15     * @return array
16     */
17    protected function getBlockParams() {
18        return [ 'topic' => $this->extractRequestParams() ];
19    }
20
21    protected function getAction() {
22        return 'view-topic';
23    }
24
25    public function getAllowedParams() {
26        return [
27            'format' => [
28                ParamValidator::PARAM_TYPE => [ 'html', 'wikitext', 'fixed-html' ],
29                ParamValidator::PARAM_DEFAULT => 'fixed-html',
30            ],
31        ];
32    }
33
34    /**
35     * @inheritDoc
36     */
37    protected function getExamplesMessages() {
38        return [
39            'action=flow&submodule=view-topic&page=Topic:S2tycnas4hcucw8w'
40                => 'apihelp-flow+view-topic-example-1',
41        ];
42    }
43}