From 0ff0a6bcf383786939b2051df6e6fe71b61bd799 Mon Sep 17 00:00:00 2001 From: louis Date: Wed, 6 Mar 2019 13:07:16 +0100 Subject: [PATCH 1/2] test against etherpad 1.7.5 --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 02c790f..1fef2e0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,14 +4,14 @@ jobs: build: docker: - image: circleci/php:7.1 - - image: systemli/etherpad-lite:1.6.1 + - image: systemli/etherpad-lite:1.7.5 steps: - checkout - run: sudo composer self-update - restore_cache: keys: - composer-{{ checksum "composer.lock" }} - - run: composer install -n --prefer-dist + - run: composer install - save_cache: key: composer-{{ checksum "composer.lock" }} paths: @@ -21,7 +21,7 @@ jobs: command: vendor/bin/phpunit - run: name: Wait for Etherpad - command: dockerize -wait tcp://localhost:9001 -timeout 1m + command: dockerize -wait http://localhost:9001 -timeout 1m - run: name: Running Behat command: vendor/bin/behat -f progress From e57de32549295a0df267449fd342c9e3a1c7be50 Mon Sep 17 00:00:00 2001 From: louis Date: Wed, 6 Mar 2019 13:21:17 +0100 Subject: [PATCH 2/2] update to etherpad lite api 1.3.0 --- README.md | 2 +- features/Chat.feature | 11 ------ features/Pad.feature | 68 ------------------------------------- features/PadContent.feature | 35 ------------------- src/EtherpadLite/Client.php | 24 ------------- 5 files changed, 1 insertion(+), 139 deletions(-) diff --git a/README.md b/README.md index 9edcb89..ac24e76 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This package provides an easy access to [Etherpad Lite](https://github.com/ether/etherpad-lite) throw there built-in [HTTP API](http://etherpad.org/doc/v1.2.11/#index_http_api). -**Supported API Version: 1.2.13 (Release: 1.6.1)** +**Supported API Version: 1.3.0 (Release: 1.7.5)** ## Installation diff --git a/features/Chat.feature b/features/Chat.feature index c129062..8412aa6 100644 --- a/features/Chat.feature +++ b/features/Chat.feature @@ -19,14 +19,3 @@ Feature: Chat API Then the code should be "0" And the message should be "ok" And the data should contain "chatHead" - - Scenario: Get the chat head for a pad - Given a pad "pad" exists - And an author "author" exists - - When I call "appendChatMessage" with params: - | padID | {{ padID }} | - | text | text | - | authorID | {{ authorID }} | - Then the code should be "0" - And the message should be "ok" diff --git a/features/Pad.feature b/features/Pad.feature index 3d1ce98..22d8392 100644 --- a/features/Pad.feature +++ b/features/Pad.feature @@ -38,49 +38,6 @@ Feature: Pad API And the message should be "ok" And the data should contain "revisions" - Scenario: Get saved revisions from a non existing pad - When I call "getSavedRevisionsCount" with params: - | padID | pad | - Then the code should be "1" - And the message should be "padID does not exist" - - Scenario: Get saved revisions from a pad - Given a pad "new_pad" exists - - When I call "getSavedRevisionsCount" with params: - | padID | {{ padID }} | - Then the code should be "0" - And the message should be "ok" - And the data should contain "savedRevisions" - - Scenario: List saved revisions from a non existing pad - When I call "listSavedRevisions" with params: - | padID | pad | - Then the code should be "1" - And the message should be "padID does not exist" - - Scenario: List saved revisions from a pad - Given a pad "new_pad" exists - When I call "listSavedRevisions" with params: - | padID | {{ padID }} | - Then the code should be "0" - And the message should be "ok" - And the data should contain "savedRevisions" - - Scenario: Save revision for a non existing pad - When I call "saveRevision" with params: - | padID | pad | - Then the code should be "1" - And the message should be "padID does not exist" - - Scenario: Save revision for a pad - Given a pad "new_pad" exists - - When I call "saveRevision" with params: - | padID | {{ padID }} | - Then the code should be "0" - And the message should be "ok" - Scenario: Get current editing user count for a non existing pad When I call "padUsersCount" with params: | padID | pad | @@ -127,22 +84,6 @@ Feature: Pad API Then the code should be "0" And the message should be "ok" - Scenario: Move a non existing pad - When I call "movePad" with params: - | sourceID | pad1 | - | destinationID | pad2 | - Then the code should be "1" - And the message should be "padID does not exist" - - Scenario: Move a pad - Given a pad "pad1" exists - - When I call "movePad" with params: - | sourceID | {{ padID }} | - | destinationID | pad2 | - Then the code should be "0" - And the message should be "ok" - Scenario: Get readonly id for a non existing pad When I call "getReadOnlyID" with params: | padID | pad | @@ -158,15 +99,6 @@ Feature: Pad API And the message should be "ok" And the data should contain "readOnlyID" -# Scenario: Get pad id from a readonly pad -# Given a readonly pad -# -# When I call "getPadID" with params: -# | readOnlyID | {{ readOnlyID }} | -# Then the code should be "0" -# And the message should be "ok" -# And the data should contain "padID" - Scenario: Set public status for a pad Given a group pad exists diff --git a/features/PadContent.feature b/features/PadContent.feature index 21b4d56..812c430 100644 --- a/features/PadContent.feature +++ b/features/PadContent.feature @@ -21,15 +21,6 @@ Feature: PadContent API Then the code should be "0" And the message should be "ok" - Scenario: Append text for a pad - Given a pad "pad" exists - - When I call "appendText" with params: - | padID | {{ padID }} | - | text | text | - Then the code should be "0" - And the message should be "ok" - Scenario: Get html for a pad Given a pad "pad" exists @@ -38,29 +29,3 @@ Feature: PadContent API Then the code should be "0" And the message should be "ok" And the data should contain "html" - -# Scenario: Set html for a pad -# Given a pad "pad" exists -# -# When I call "setHTML" with params: -# | padID | {{ padID }} | -# | html | html | -# Then the code should be "0" -# And the message should be "ok" - - Scenario: Get attribute pool for a pad - Given a pad "pad" exists - - When I call "getAttributePool" with params: - | padID | {{ padID }} | - Then the code should be "0" - And the message should be "ok" - And the data should contain "pool" - - Scenario: Get revision changeset for a pad - Given a pad "pad" exists - - When I call "getRevisionChangeset" with params: - | padID | {{ padID }} | - Then the code should be "0" - And the message should be "ok" diff --git a/src/EtherpadLite/Client.php b/src/EtherpadLite/Client.php index c090e32..bad3872 100644 --- a/src/EtherpadLite/Client.php +++ b/src/EtherpadLite/Client.php @@ -29,30 +29,17 @@ * * @method Response getText($padID, $rev = null) returns the text of a pad * @method Response setText($padID, $text) sets the text of a pad - * @method Response appendText($padID, $text) appends text to a pad * @method Response getHTML($padID, $rev = null) returns the text of a pad formatted as HTML - * @method Response setHTML($padID, $html) sets the html of a pad - * @method Response getAttributePool($padID) returns the attribute pool of a pad - * @method Response getRevisionChangeset($padID, $revision = null) get the changeset at a given revision, or last revision if 'rev' is not defined. - * @method Response createDiffHTML($padID, $startRev, $endRev) returns an object of diffs from 2 points in a pad - * @method Response restoreRevision($padID, $revision) restores revision from past as new changeset * * @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 * @method Response getChatHead($padID) returns the chatHead (last number of the last chat-message) of the pad - * @method Response appendChatMessage($padID, $text, $authorID, $time = null) creates a chat message, saves it to the database and sends it to all connected clients of this pad * * @method Response createPad($padID, $text = null) creates a new (non-group) pad. Note that if you need to create a group Pad, you should call createGroupPad. * @method Response getRevisionsCount($padID) returns the number of revisions of this pad - * @method Response getSavedRevisionsCount($padID) returns the number of saved revisions of this pad - * @method Response listSavedRevisions($padID) returns a list of saved revisions of this pad - * @method Response saveRevision($padID, $revision = null) save a revision of a pad * @method Response padUsersCount($padID) returns the number of user that are currently editing this pad * @method Response padUsers($padID) returns the list of users that are currently editing this pad * @method Response deletePad($padID) deletes a pad - * @method Response movePad($sourceID, $destinationID, $force = false) moves a pad. If force is true and the destination pad exists, it will be overwritten. - * @method Response copyPad($sourceID, $destinationID, $force = false) copies a pad with full history and chat. If force is true and the destination pad exists, it will be overwritten. * @method Response getReadOnlyID($padID) returns the read only link of a pad - * @method Response getPadID($readOnlyID) returns the id of a pad which is assigned to the readOnlyID * @method Response setPublicStatus($padID, $publicStatus) sets a boolean for the public status of a pad * @method Response getPublicStatus($padID) return true of false * @method Response setPassword($padID, $password) returns ok or a error message @@ -148,28 +135,17 @@ public static function getMethods(): array 'listSessionsOfAuthor' => ['authorID'], 'getText' => ['padID', 'rev'], 'setText' => ['padID', 'text'], - 'appendText' => ['padID', 'text'], 'getHTML' => ['padID', 'rev'], - 'setHTML' => ['padID', 'html'], 'getAttributePool' => ['padID'], - 'createDiffHTML' => ['padID', 'startRev', 'endRev'], - 'restoreRevision' => ['padID', 'rev'], - 'getRevisionChangeset' => ['padID'], 'getChatHistory' => ['padID', 'start', 'end'], 'getChatHead' => ['padID'], - 'appendChatMessage' => ['padID', 'text', 'authorID'], 'createPad' => ['padID', 'text'], 'getRevisionsCount' => ['padID'], - 'getSavedRevisionsCount' => ['padID'], 'listSavedRevisions' => ['padID'], - 'saveRevision' => ['padID'], 'padUsersCount' => ['padID'], 'padUsers' => ['padID'], 'deletePad' => ['padID'], - 'movePad' => ['sourceID', 'destinationID'], - 'copyPad' => ['sourceID', 'destinationID'], 'getReadOnlyID' => ['padID'], - 'getPadID' => ['readOnlyID'], 'setPublicStatus' => ['padID', 'publicStatus'], 'getPublicStatus' => ['padID'], 'setPassword' => ['padID', 'password'],