Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 1
ApiFlowEditTitle
0.00% covered (danger)
0.00%
0 / 15
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 / 8
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 ApiFlowEditTitle extends ApiFlowBasePost {
8
9    public function __construct( $api, $modName ) {
10        parent::__construct( $api, $modName, 'et' );
11    }
12
13    /**
14     * Taken from ext.flow.base.js
15     * @return array
16     */
17    protected function getBlockParams() {
18        return [ 'topic' => $this->extractRequestParams() ];
19    }
20
21    protected function getAction() {
22        return 'edit-title';
23    }
24
25    public function getAllowedParams() {
26        return [
27            'prev_revision' => [
28                ParamValidator::PARAM_REQUIRED => true,
29            ],
30            'content' => [
31                ParamValidator::PARAM_REQUIRED => true,
32            ],
33        ] + parent::getAllowedParams();
34    }
35
36    /**
37     * @inheritDoc
38     */
39    protected function getExamplesMessages() {
40        return [
41            'action=flow&submodule=edit-title&page=Topic:S2tycnas4hcucw8w&etprev_revision=???&ehtcontent=Nice%20to&20meet%20you'
42                => 'apihelp-flow+edit-title-example-1',
43        ];
44    }
45}