Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
71.43% |
10 / 14 |
|
80.00% |
4 / 5 |
CRAP | |
0.00% |
0 / 1 |
ApiFlowViewHeader | |
71.43% |
10 / 14 |
|
80.00% |
4 / 5 |
5.58 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getBlockParams | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getAction | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getAllowedParams | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 | |||
getExamplesMessages | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace Flow\Api; |
4 | |
5 | use Wikimedia\ParamValidator\ParamValidator; |
6 | |
7 | class ApiFlowViewHeader extends ApiFlowBaseGet { |
8 | public function __construct( $api, $modName ) { |
9 | parent::__construct( $api, $modName, 'vh' ); |
10 | } |
11 | |
12 | /** |
13 | * Taken from ext.flow.base.js |
14 | * @return array |
15 | */ |
16 | protected function getBlockParams() { |
17 | return [ 'header' => $this->extractRequestParams() ]; |
18 | } |
19 | |
20 | protected function getAction() { |
21 | return 'view-header'; |
22 | } |
23 | |
24 | public function getAllowedParams() { |
25 | return [ |
26 | 'format' => [ |
27 | ParamValidator::PARAM_TYPE => [ 'html', 'wikitext', 'fixed-html' ], |
28 | ParamValidator::PARAM_DEFAULT => 'fixed-html', |
29 | ], |
30 | 'revId' => null, |
31 | ]; |
32 | } |
33 | |
34 | /** |
35 | * @inheritDoc |
36 | */ |
37 | protected function getExamplesMessages() { |
38 | return [ |
39 | 'action=flow&submodule=view-header&page=Talk:Sandbox&vhformat=wikitext&revId=' |
40 | => 'apihelp-flow+view-header-example-1', |
41 | ]; |
42 | } |
43 | } |