{"action":"created","comment":{"url":"https://api.github.com/repos/ably/ably-php/pulls/comments/218752651","pull_request_review_id":156756631,"id":218752651,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODc1MjY1MQ==","diff_hunk":"@@ -0,0 +1,128 @@\n+<?php\n+namespace tests;\n+use Ably\\AblyRest;\n+use Ably\\Models\\Message;\n+\n+require_once __DIR__ . '/factories/TestApp.php';\n+\n+\n+class ChannelIdempotentTest extends \\PHPUnit_Framework_TestCase {\n+    protected static $testApp;\n+    protected static $defaultOptions;\n+    protected static $ably;\n+\n+    public static function setUpBeforeClass() {\n+        self::$testApp = new TestApp();\n+        self::$defaultOptions = self::$testApp->getOptions();\n+        self::$ably = new AblyRest( array_merge( self::$defaultOptions, [\n+            'key' => self::$testApp->getAppKeyDefault()->string,\n+            'idempotentRestPublishing' => true,\n+        ] ) );\n+    }\n+\n+    public static function tearDownAfterClass() {\n+        self::$testApp->release();\n+    }\n+\n+    /**\n+     * RSL1j\n+     */\n+    public function testMessageSerialization() {\n+        $channel = self::$ably->channel( 'messageSerialization' );\n+\n+        $msg = new Message();\n+        $msg->name = 'name';\n+        $msg->data = 'data';\n+        $msg->clientId = 'clientId';\n+        $msg->id = 'foobar';\n+\n+        $body = $channel->__publish_request_body( $msg );\n+        $body = json_decode($body);\n+\n+        $this->assertTrue( property_exists($body, 'name') );\n+        $this->assertTrue( property_exists($body, 'data') );\n+        $this->assertTrue( property_exists($body, 'clientId') );\n+        $this->assertTrue( property_exists($body, 'id') );\n+    }\n+\n+    /**\n+     * RSL1k1\n+     */\n+    public function testIdempotentLibraryGenerated() {\n+        $channel = self::$ably->channel( 'idempotentLibraryGenerated' );\n+\n+        $msg = new Message();\n+        $msg->name = 'name';\n+        $msg->data = 'data';\n+\n+        $body = $channel->__publish_request_body( $msg );\n+        $body = json_decode($body);\n+\n+        $id = explode ( \":\", $body->id);\n+        $this->assertEquals( count($id), 2);\n+        $this->assertGreaterThanOrEqual( base64_decode($id[0]), 9);\n+        $this->assertEquals( $id[1], \"0\");","path":"tests/ChannelIdempotentTest.php","position":64,"original_position":64,"commit_id":"c2675b580530b1872c079ed7713ed2e18f48276b","original_commit_id":"c2675b580530b1872c079ed7713ed2e18f48276b","user":{"login":"mattheworiordan","id":43789,"node_id":"MDQ6VXNlcjQzNzg5","avatar_url":"https://avatars3.githubusercontent.com/u/43789?v=4","gravatar_id":"","url":"https://api.github.com/users/mattheworiordan","html_url":"https://github.com/mattheworiordan","followers_url":"https://api.github.com/users/mattheworiordan/followers","following_url":"https://api.github.com/users/mattheworiordan/following{/other_user}","gists_url":"https://api.github.com/users/mattheworiordan/gists{/gist_id}","starred_url":"https://api.github.com/users/mattheworiordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattheworiordan/subscriptions","organizations_url":"https://api.github.com/users/mattheworiordan/orgs","repos_url":"https://api.github.com/users/mattheworiordan/repos","events_url":"https://api.github.com/users/mattheworiordan/events{/privacy}","received_events_url":"https://api.github.com/users/mattheworiordan/received_events","type":"User","site_admin":false},"body":"Can you not do a history request to get this info?","created_at":"2018-09-19T10:36:16Z","updated_at":"2018-09-19T10:37:15Z","html_url":"https://github.com/ably/ably-php/pull/58#discussion_r218752651","pull_request_url":"https://api.github.com/repos/ably/ably-php/pulls/58","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ably/ably-php/pulls/comments/218752651"},"html":{"href":"https://github.com/ably/ably-php/pull/58#discussion_r218752651"},"pull_request":{"href":"https://api.github.com/repos/ably/ably-php/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/ably/ably-php/pulls/58","id":214235366,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE0MjM1MzY2","html_url":"https://github.com/ably/ably-php/pull/58","diff_url":"https://github.com/ably/ably-php/pull/58.diff","patch_url":"https://github.com/ably/ably-php/pull/58.patch","issue_url":"https://api.github.com/repos/ably/ably-php/issues/58","number":58,"state":"open","locked":false,"title":"Idempotent","user":{"login":"jdavid","id":596769,"node_id":"MDQ6VXNlcjU5Njc2OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/596769?v=4","gravatar_id":"","url":"https://api.github.com/users/jdavid","html_url":"https://github.com/jdavid","followers_url":"https://api.github.com/users/jdavid/followers","following_url":"https://api.github.com/users/jdavid/following{/other_user}","gists_url":"https://api.github.com/users/jdavid/gists{/gist_id}","starred_url":"https://api.github.com/users/jdavid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdavid/subscriptions","organizations_url":"https://api.github.com/users/jdavid/orgs","repos_url":"https://api.github.com/users/jdavid/repos","events_url":"https://api.github.com/users/jdavid/events{/privacy}","received_events_url":"https://api.github.com/users/jdavid/received_events","type":"User","site_admin":false},"body":"Not ready for merge as only 1 item is done (TO3n), but prefer to get early feedback.","created_at":"2018-09-10T08:31:37Z","updated_at":"2018-09-19T10:37:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cc27bdc271ddcd8d07c428440a8e0e3c0431f4aa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ably/ably-php/pulls/58/commits","review_comments_url":"https://api.github.com/repos/ably/ably-php/pulls/58/comments","review_comment_url":"https://api.github.com/repos/ably/ably-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ably/ably-php/issues/58/comments","statuses_url":"https://api.github.com/repos/ably/ably-php/statuses/c2675b580530b1872c079ed7713ed2e18f48276b","head":{"label":"ably:idempotent","ref":"idempotent","sha":"c2675b580530b1872c079ed7713ed2e18f48276b","user":{"login":"ably","id":1859245,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NTkyNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/1859245?v=4","gravatar_id":"","url":"https://api.github.com/users/ably","html_url":"https://github.com/ably","followers_url":"https://api.github.com/users/ably/followers","following_url":"https://api.github.com/users/ably/following{/other_user}","gists_url":"https://api.github.com/users/ably/gists{/gist_id}","starred_url":"https://api.github.com/users/ably/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ably/subscriptions","organizations_url":"https://api.github.com/users/ably/orgs","repos_url":"https://api.github.com/users/ably/repos","events_url":"https://api.github.com/users/ably/events{/privacy}","received_events_url":"https://api.github.com/users/ably/received_events","type":"Organization","site_admin":false},"repo":{"id":7289345,"node_id":"MDEwOlJlcG9zaXRvcnk3Mjg5MzQ1","name":"ably-php","full_name":"ably/ably-php","private":false,"owner":{"login":"ably","id":1859245,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NTkyNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/1859245?v=4","gravatar_id":"","url":"https://api.github.com/users/ably","html_url":"https://github.com/ably","followers_url":"https://api.github.com/users/ably/followers","following_url":"https://api.github.com/users/ably/following{/other_user}","gists_url":"https://api.github.com/users/ably/gists{/gist_id}","starred_url":"https://api.github.com/users/ably/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ably/subscriptions","organizations_url":"https://api.github.com/users/ably/orgs","repos_url":"https://api.github.com/users/ably/repos","events_url":"https://api.github.com/users/ably/events{/privacy}","received_events_url":"https://api.github.com/users/ably/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ably/ably-php","description":"PHP client library SDK for Ably realtime messaging service","fork":false,"url":"https://api.github.com/repos/ably/ably-php","forks_url":"https://api.github.com/repos/ably/ably-php/forks","keys_url":"https://api.github.com/repos/ably/ably-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ably/ably-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ably/ably-php/teams","hooks_url":"https://api.github.com/repos/ably/ably-php/hooks","issue_events_url":"https://api.github.com/repos/ably/ably-php/issues/events{/number}","events_url":"https://api.github.com/repos/ably/ably-php/events","assignees_url":"https://api.github.com/repos/ably/ably-php/assignees{/user}","branches_url":"https://api.github.com/repos/ably/ably-php/branches{/branch}","tags_url":"https://api.github.com/repos/ably/ably-php/tags","blobs_url":"https://api.github.com/repos/ably/ably-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ably/ably-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ably/ably-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/ably/ably-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ably/ably-php/statuses/{sha}","languages_url":"https://api.github.com/repos/ably/ably-php/languages","stargazers_url":"https://api.github.com/repos/ably/ably-php/stargazers","contributors_url":"https://api.github.com/repos/ably/ably-php/contributors","subscribers_url":"https://api.github.com/repos/ably/ably-php/subscribers","subscription_url":"https://api.github.com/repos/ably/ably-php/subscription","commits_url":"https://api.github.com/repos/ably/ably-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/ably/ably-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/ably/ably-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/ably/ably-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/ably/ably-php/contents/{+path}","compare_url":"https://api.github.com/repos/ably/ably-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ably/ably-php/merges","archive_url":"https://api.github.com/repos/ably/ably-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ably/ably-php/downloads","issues_url":"https://api.github.com/repos/ably/ably-php/issues{/number}","pulls_url":"https://api.github.com/repos/ably/ably-php/pulls{/number}","milestones_url":"https://api.github.com/repos/ably/ably-php/milestones{/number}","notifications_url":"https://api.github.com/repos/ably/ably-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ably/ably-php/labels{/name}","releases_url":"https://api.github.com/repos/ably/ably-php/releases{/id}","deployments_url":"https://api.github.com/repos/ably/ably-php/deployments","created_at":"2012-12-22T18:59:01Z","updated_at":"2018-06-12T14:37:00Z","pushed_at":"2018-09-11T10:15:00Z","git_url":"git://github.com/ably/ably-php.git","ssh_url":"git@github.com:ably/ably-php.git","clone_url":"https://github.com/ably/ably-php.git","svn_url":"https://github.com/ably/ably-php","homepage":"https://www.ably.io/download","size":808,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":7,"open_issues":12,"watchers":6,"default_branch":"master"}},"base":{"label":"ably:master","ref":"master","sha":"08761a8d77c6c42029af09c37e5fff790acf452b","user":{"login":"ably","id":1859245,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NTkyNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/1859245?v=4","gravatar_id":"","url":"https://api.github.com/users/ably","html_url":"https://github.com/ably","followers_url":"https://api.github.com/users/ably/followers","following_url":"https://api.github.com/users/ably/following{/other_user}","gists_url":"https://api.github.com/users/ably/gists{/gist_id}","starred_url":"https://api.github.com/users/ably/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ably/subscriptions","organizations_url":"https://api.github.com/users/ably/orgs","repos_url":"https://api.github.com/users/ably/repos","events_url":"https://api.github.com/users/ably/events{/privacy}","received_events_url":"https://api.github.com/users/ably/received_events","type":"Organization","site_admin":false},"repo":{"id":7289345,"node_id":"MDEwOlJlcG9zaXRvcnk3Mjg5MzQ1","name":"ably-php","full_name":"ably/ably-php","private":false,"owner":{"login":"ably","id":1859245,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NTkyNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/1859245?v=4","gravatar_id":"","url":"https://api.github.com/users/ably","html_url":"https://github.com/ably","followers_url":"https://api.github.com/users/ably/followers","following_url":"https://api.github.com/users/ably/following{/other_user}","gists_url":"https://api.github.com/users/ably/gists{/gist_id}","starred_url":"https://api.github.com/users/ably/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ably/subscriptions","organizations_url":"https://api.github.com/users/ably/orgs","repos_url":"https://api.github.com/users/ably/repos","events_url":"https://api.github.com/users/ably/events{/privacy}","received_events_url":"https://api.github.com/users/ably/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ably/ably-php","description":"PHP client library SDK for Ably realtime messaging service","fork":false,"url":"https://api.github.com/repos/ably/ably-php","forks_url":"https://api.github.com/repos/ably/ably-php/forks","keys_url":"https://api.github.com/repos/ably/ably-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ably/ably-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ably/ably-php/teams","hooks_url":"https://api.github.com/repos/ably/ably-php/hooks","issue_events_url":"https://api.github.com/repos/ably/ably-php/issues/events{/number}","events_url":"https://api.github.com/repos/ably/ably-php/events","assignees_url":"https://api.github.com/repos/ably/ably-php/assignees{/user}","branches_url":"https://api.github.com/repos/ably/ably-php/branches{/branch}","tags_url":"https://api.github.com/repos/ably/ably-php/tags","blobs_url":"https://api.github.com/repos/ably/ably-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ably/ably-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ably/ably-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/ably/ably-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ably/ably-php/statuses/{sha}","languages_url":"https://api.github.com/repos/ably/ably-php/languages","stargazers_url":"https://api.github.com/repos/ably/ably-php/stargazers","contributors_url":"https://api.github.com/repos/ably/ably-php/contributors","subscribers_url":"https://api.github.com/repos/ably/ably-php/subscribers","subscription_url":"https://api.github.com/repos/ably/ably-php/subscription","commits_url":"https://api.github.com/repos/ably/ably-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/ably/ably-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/ably/ably-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/ably/ably-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/ably/ably-php/contents/{+path}","compare_url":"https://api.github.com/repos/ably/ably-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ably/ably-php/merges","archive_url":"https://api.github.com/repos/ably/ably-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ably/ably-php/downloads","issues_url":"https://api.github.com/repos/ably/ably-php/issues{/number}","pulls_url":"https://api.github.com/repos/ably/ably-php/pulls{/number}","milestones_url":"https://api.github.com/repos/ably/ably-php/milestones{/number}","notifications_url":"https://api.github.com/repos/ably/ably-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ably/ably-php/labels{/name}","releases_url":"https://api.github.com/repos/ably/ably-php/releases{/id}","deployments_url":"https://api.github.com/repos/ably/ably-php/deployments","created_at":"2012-12-22T18:59:01Z","updated_at":"2018-06-12T14:37:00Z","pushed_at":"2018-09-11T10:15:00Z","git_url":"git://github.com/ably/ably-php.git","ssh_url":"git@github.com:ably/ably-php.git","clone_url":"https://github.com/ably/ably-php.git","svn_url":"https://github.com/ably/ably-php","homepage":"https://www.ably.io/download","size":808,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":7,"open_issues":12,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ably/ably-php/pulls/58"},"html":{"href":"https://github.com/ably/ably-php/pull/58"},"issue":{"href":"https://api.github.com/repos/ably/ably-php/issues/58"},"comments":{"href":"https://api.github.com/repos/ably/ably-php/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/ably/ably-php/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/ably/ably-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ably/ably-php/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/ably/ably-php/statuses/c2675b580530b1872c079ed7713ed2e18f48276b"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mattheworiordan"}}