Skip to content

Commit 6ec6bb5

Browse files
authored
Merge pull request #17 from anantjain6/master
Added setHTML(padID, html)
2 parents 30dd5b3 + b4035ba commit 6ec6bb5

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

features/PadContent.feature

+9
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,12 @@ Feature: PadContent API
2929
Then the code should be "0"
3030
And the message should be "ok"
3131
And the data should contain "html"
32+
33+
Scenario: Set HTML for a pad
34+
Given a pad "pad" exists
35+
36+
When I call "setText" with params:
37+
| padID | {{ padID }} |
38+
| html | html |
39+
Then the code should be "0"
40+
And the message should be "ok"

src/EtherpadLite/Client.php

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* @method Response getText($padID, $rev = null) returns the text of a pad
3131
* @method Response setText($padID, $text) sets the text of a pad
3232
* @method Response getHTML($padID, $rev = null) returns the text of a pad formatted as HTML
33+
* @method Response setHTML($padID, $html) sets the HTML of a pad
3334
*
3435
* @method Response getChatHistory($padID, $start = null, $end = null) a part of the chat history, when start and end are given, the whole chat histroy, when no extra parameters are given
3536
* @method Response getChatHead($padID) returns the chatHead (last number of the last chat-message) of the pad
@@ -136,6 +137,7 @@ public static function getMethods(): array
136137
'getText' => ['padID', 'rev'],
137138
'setText' => ['padID', 'text'],
138139
'getHTML' => ['padID', 'rev'],
140+
'setHTML' => ['padID', 'html'],
139141
'getAttributePool' => ['padID'],
140142
'getChatHistory' => ['padID', 'start', 'end'],
141143
'getChatHead' => ['padID'],

tests/RequestTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ public function dataGetParamsProvider()
4242
array('getText', array('padID', 'rev')),
4343
array('setText', array('padID', 'text')),
4444
array('getHTML', array('padID', 'rev')),
45+
array('setHTML', array('padID', 'html')),
4546
array('getChatHistory', array('padID', 'start', 'end')),
4647
array('getChatHead', array('padID')),
4748
array('createPad', array('padID', 'text')),

0 commit comments

Comments
 (0)