Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 23
0.00% covered (danger)
0.00%
0 / 5
CRAP
0.00% covered (danger)
0.00%
0 / 1
ApiFlowEditPost
0.00% covered (danger)
0.00%
0 / 23
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
 getAction
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
 getAllowedParams
0.00% covered (danger)
0.00%
0 / 15
0.00% covered (danger)
0.00%
0 / 1
2
 getExamplesMessages
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Flow\Api;
4
5use Wikimedia\ParamValidator\ParamValidator;
6
7class ApiFlowEditPost extends ApiFlowBasePost {
8
9    public function __construct( $api ) {
10        parent::__construct( $api, 'edit-post', 'ep' );
11    }
12
13    protected function getAction() {
14        return 'edit-post';
15    }
16
17    protected function getBlockParams() {
18        return [ 'topic' => $this->extractRequestParams() ];
19    }
20
21    public function getAllowedParams() {
22        return [
23            'postId' => [
24                ParamValidator::PARAM_REQUIRED => true,
25            ],
26            'prev_revision' => [
27                ParamValidator::PARAM_REQUIRED => true,
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-post&page=Topic:S2tycnas4hcucw8w&eppostId=???&epprev_revision=???' .
45                '&epcontent=Nice%20to&20meet%20you&epformat=wikitext'
46                => 'apihelp-flow+edit-post-example-1',
47        ];
48    }
49}