Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
77.78% |
14 / 18 |
|
80.00% |
4 / 5 |
CRAP | |
0.00% |
0 / 1 |
ApiFlowEditHeader | |
77.78% |
14 / 18 |
|
80.00% |
4 / 5 |
5.27 | |
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% |
11 / 11 |
|
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 ApiFlowEditHeader extends ApiFlowBasePost { |
8 | |
9 | public function __construct( $api, $modName ) { |
10 | parent::__construct( $api, $modName, 'eh' ); |
11 | } |
12 | |
13 | /** |
14 | * Taken from ext.flow.base.js |
15 | * @return array |
16 | */ |
17 | protected function getBlockParams() { |
18 | return [ 'header' => $this->extractRequestParams() ]; |
19 | } |
20 | |
21 | protected function getAction() { |
22 | return 'edit-header'; |
23 | } |
24 | |
25 | public function getAllowedParams() { |
26 | return [ |
27 | 'prev_revision' => [ |
28 | ], |
29 | 'content' => [ |
30 | ParamValidator::PARAM_REQUIRED => true, |
31 | ], |
32 | 'format' => [ |
33 | ParamValidator::PARAM_DEFAULT => 'wikitext', |
34 | ParamValidator::PARAM_TYPE => [ 'html', 'wikitext' ], |
35 | ], |
36 | ] + parent::getAllowedParams(); |
37 | } |
38 | |
39 | /** |
40 | * @inheritDoc |
41 | */ |
42 | protected function getExamplesMessages() { |
43 | return [ |
44 | 'action=flow&submodule=edit-header&page=Talk:Sandbox&ehprev_revision=???&ehcontent=Nice%20to&20meet%20you&ehformat=wikitext' |
45 | => 'apihelp-flow+edit-header-example-1', |
46 | ]; |
47 | } |
48 | } |