Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
76.19% |
16 / 21 |
|
80.00% |
4 / 5 |
CRAP | |
0.00% |
0 / 1 |
| ApiFlowEditTopicSummary | |
76.19% |
16 / 21 |
|
80.00% |
4 / 5 |
5.34 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAction | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getBlockParams | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
1 | |||
| getAllowedParams | |
100.00% |
10 / 10 |
|
100.00% |
1 / 1 |
1 | |||
| getExamplesMessages | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace Flow\Api; |
| 4 | |
| 5 | use Wikimedia\ParamValidator\ParamValidator; |
| 6 | |
| 7 | class ApiFlowEditTopicSummary extends ApiFlowBasePost { |
| 8 | |
| 9 | public function __construct( $api ) { |
| 10 | parent::__construct( $api, 'edit-topic-summary', 'ets' ); |
| 11 | } |
| 12 | |
| 13 | protected function getAction() { |
| 14 | return 'edit-topic-summary'; |
| 15 | } |
| 16 | |
| 17 | protected function getBlockParams() { |
| 18 | return [ |
| 19 | 'topicsummary' => $this->extractRequestParams(), |
| 20 | 'topic' => [], |
| 21 | ]; |
| 22 | } |
| 23 | |
| 24 | public function getAllowedParams() { |
| 25 | return [ |
| 26 | 'prev_revision' => null, |
| 27 | 'summary' => [ |
| 28 | ParamValidator::PARAM_REQUIRED => true, |
| 29 | ], |
| 30 | 'format' => [ |
| 31 | ParamValidator::PARAM_DEFAULT => 'wikitext', |
| 32 | ParamValidator::PARAM_TYPE => [ 'html', 'wikitext' ], |
| 33 | ], |
| 34 | ] + parent::getAllowedParams(); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * @inheritDoc |
| 39 | */ |
| 40 | protected function getExamplesMessages() { |
| 41 | return [ |
| 42 | 'action=flow&submodule=edit-topic-summary&page=Topic:S2tycnas4hcucw8w&wetsprev_revision=???' . |
| 43 | '&etssummary=Nice%20to&20meet%20you&etsformat=wikitext' |
| 44 | => 'apihelp-flow+edit-topic-summary-example-1', |
| 45 | ]; |
| 46 | } |
| 47 | } |