{"action":"created","comment":{"url":"https://api.github.com/repos/weiboad/kafka-php/pulls/comments/156033355","pull_request_review_id":82427583,"id":156033355,"diff_hunk":"@@ -0,0 +1,538 @@\n+<?php\n+/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4 foldmethod=marker: */\n+// +---------------------------------------------------------------------------\n+// | SWAN [ $_SWANBR_SLOGAN_$ ]\n+// +---------------------------------------------------------------------------\n+// | Copyright $_SWANBR_COPYRIGHT_$\n+// +---------------------------------------------------------------------------\n+// | Version  $_SWANBR_VERSION_$\n+// +---------------------------------------------------------------------------\n+// | Licensed ( $_SWANBR_LICENSED_URL_$ )\n+// +---------------------------------------------------------------------------\n+// | $_SWANBR_WEB_DOMAIN_$\n+// +---------------------------------------------------------------------------\n+\n+namespace KafkaTest\\Base;\n+\n+use \\Kafka\\Socket;\n+use \\Kafka\\Config;\n+use \\KafkaTest\\Base\\Stream\\Simple as SimpleStream;\n+use \\KafkaTest\\Base\\Stream\\StreamMock;\n+\n+/**\n++------------------------------------------------------------------------------\n+* Kafka protocol since Kafka v0.8\n++------------------------------------------------------------------------------\n+*\n+* @package\n+* @version $_SWANBR_VERSION_$\n+* @copyright Copyleft\n+* @author $_SWANBR_AUTHOR_$\n++------------------------------------------------------------------------------\n+*/\n+\n+class SocketTest extends \\PHPUnit\\Framework\\TestCase\n+{\n+    // {{{ consts\n+    // }}}\n+    // {{{ members\n+    // }}}\n+    // {{{ functions\n+    // {{{ public function tearDown()\n+\n+    public function tearDown()\n+    {\n+        $this->clearStreamMock();\n+    }\n+\n+    // }}}\n+    // {{{ public function testConstruct()\n+\n+    /**\n+     * testConstruct\n+     *\n+     * @access public\n+     * @return void\n+     */\n+    public function testConstruct()\n+    {\n+        $host   = '127.0.0.1';\n+        $port   = 9092;\n+        $socket = new Socket($host, $port);\n+        $this->assertSame($host, $socket->getHost());\n+        $this->assertSame($port, $socket->getPort());\n+        $this->assertNull($socket->getConfig());\n+        $this->assertNull($socket->getSaslProvider());\n+\n+        $config = $this->getMockForAbstractClass(Config::class);\n+        $socket->setConfig($config);\n+        $this->assertEquals($config, $socket->getConfig());\n+        \n+        \n+        $sasl = new \\Kafka\\Sasl\\Plain('username', 'password');\n+        $socket->setSaslProvider($sasl);\n+        $this->assertEquals($sasl, $socket->getSaslProvider());\n+\n+        $socket->setSendTimeoutSec(200);\n+        $this->assertEquals(200, $socket->getSendTimeoutSec());\n+        $socket->setSendTimeoutUsec(330.11);\n+        $this->assertEquals(330.11, $socket->getSendTimeoutUsec());\n+        $socket->setRecvTimeoutSec(130.11);\n+        $this->assertEquals(130.11, $socket->getRecvTimeoutSec());\n+        $socket->setRecvTimeoutUsec(430.11);\n+        $this->assertEquals(430.11, $socket->getRecvTimeoutUsec());\n+        $socket->setMaxWriteAttempts(3);\n+        $this->assertEquals(3, $socket->getMaxWriteAttempts());\n+\n+        $this->assertNull($socket->getSocket());\n+    }\n+\n+    // }}}\n+    // {{{ public function testCreateStreamHostName()\n+\n+    /**\n+     * testCreateStreamHostName\n+     *\n+     * @expectedException \\Kafka\\Exception\n+     * @expectedExceptionMessage Cannot open null host.\n+     * @access public\n+     * @return void\n+     */\n+    public function testCreateStreamHostName()\n+    {\n+        \\uopz_flags(Socket::class, 'createStream', ZEND_ACC_PUBLIC);","path":"tests/Base/SocketTest.php","position":103,"original_position":103,"commit_id":"285a54a473e7a219e7076eee0bbbdeee5fd5bdc8","original_commit_id":"285a54a473e7a219e7076eee0bbbdeee5fd5bdc8","user":{"login":"lcobucci","id":201963,"avatar_url":"https://avatars2.githubusercontent.com/u/201963?v=4","gravatar_id":"","url":"https://api.github.com/users/lcobucci","html_url":"https://github.com/lcobucci","followers_url":"https://api.github.com/users/lcobucci/followers","following_url":"https://api.github.com/users/lcobucci/following{/other_user}","gists_url":"https://api.github.com/users/lcobucci/gists{/gist_id}","starred_url":"https://api.github.com/users/lcobucci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcobucci/subscriptions","organizations_url":"https://api.github.com/users/lcobucci/orgs","repos_url":"https://api.github.com/users/lcobucci/repos","events_url":"https://api.github.com/users/lcobucci/events{/privacy}","received_events_url":"https://api.github.com/users/lcobucci/received_events","type":"User","site_admin":false},"body":"Private methods should be tested through public ones","created_at":"2017-12-11T10:29:17Z","updated_at":"2017-12-11T10:34:26Z","html_url":"https://github.com/weiboad/kafka-php/pull/150#discussion_r156033355","pull_request_url":"https://api.github.com/repos/weiboad/kafka-php/pulls/150","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/weiboad/kafka-php/pulls/comments/156033355"},"html":{"href":"https://github.com/weiboad/kafka-php/pull/150#discussion_r156033355"},"pull_request":{"href":"https://api.github.com/repos/weiboad/kafka-php/pulls/150"}}},"pull_request":{"url":"https://api.github.com/repos/weiboad/kafka-php/pulls/150","id":156965976,"html_url":"https://github.com/weiboad/kafka-php/pull/150","diff_url":"https://github.com/weiboad/kafka-php/pull/150.diff","patch_url":"https://github.com/weiboad/kafka-php/pull/150.patch","issue_url":"https://api.github.com/repos/weiboad/kafka-php/issues/150","number":150,"state":"open","locked":false,"title":"Add sasl support","user":{"login":"nmred","id":1736508,"avatar_url":"https://avatars2.githubusercontent.com/u/1736508?v=4","gravatar_id":"","url":"https://api.github.com/users/nmred","html_url":"https://github.com/nmred","followers_url":"https://api.github.com/users/nmred/followers","following_url":"https://api.github.com/users/nmred/following{/other_user}","gists_url":"https://api.github.com/users/nmred/gists{/gist_id}","starred_url":"https://api.github.com/users/nmred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmred/subscriptions","organizations_url":"https://api.github.com/users/nmred/orgs","repos_url":"https://api.github.com/users/nmred/repos","events_url":"https://api.github.com/users/nmred/events{/privacy}","received_events_url":"https://api.github.com/users/nmred/received_events","type":"User","site_admin":false},"body":"Add SASL support\r\n#134 ","created_at":"2017-12-07T11:13:38Z","updated_at":"2017-12-11T10:34:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88f1d63c2044187153ebbd8500337b4ad59e21f4","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/weiboad/kafka-php/milestones/3","html_url":"https://github.com/weiboad/kafka-php/milestone/3","labels_url":"https://api.github.com/repos/weiboad/kafka-php/milestones/3/labels","id":2511683,"number":3,"title":"v0.2.1 release update","description":"- support ssl connect","creator":{"login":"nmred","id":1736508,"avatar_url":"https://avatars2.githubusercontent.com/u/1736508?v=4","gravatar_id":"","url":"https://api.github.com/users/nmred","html_url":"https://github.com/nmred","followers_url":"https://api.github.com/users/nmred/followers","following_url":"https://api.github.com/users/nmred/following{/other_user}","gists_url":"https://api.github.com/users/nmred/gists{/gist_id}","starred_url":"https://api.github.com/users/nmred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmred/subscriptions","organizations_url":"https://api.github.com/users/nmred/orgs","repos_url":"https://api.github.com/users/nmred/repos","events_url":"https://api.github.com/users/nmred/events{/privacy}","received_events_url":"https://api.github.com/users/nmred/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":3,"state":"open","created_at":"2017-05-10T03:53:54Z","updated_at":"2017-12-07T11:22:56Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/weiboad/kafka-php/pulls/150/commits","review_comments_url":"https://api.github.com/repos/weiboad/kafka-php/pulls/150/comments","review_comment_url":"https://api.github.com/repos/weiboad/kafka-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/weiboad/kafka-php/issues/150/comments","statuses_url":"https://api.github.com/repos/weiboad/kafka-php/statuses/285a54a473e7a219e7076eee0bbbdeee5fd5bdc8","head":{"label":"weiboad:add_sasl_support","ref":"add_sasl_support","sha":"285a54a473e7a219e7076eee0bbbdeee5fd5bdc8","user":{"login":"weiboad","id":19903383,"avatar_url":"https://avatars3.githubusercontent.com/u/19903383?v=4","gravatar_id":"","url":"https://api.github.com/users/weiboad","html_url":"https://github.com/weiboad","followers_url":"https://api.github.com/users/weiboad/followers","following_url":"https://api.github.com/users/weiboad/following{/other_user}","gists_url":"https://api.github.com/users/weiboad/gists{/gist_id}","starred_url":"https://api.github.com/users/weiboad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weiboad/subscriptions","organizations_url":"https://api.github.com/users/weiboad/orgs","repos_url":"https://api.github.com/users/weiboad/repos","events_url":"https://api.github.com/users/weiboad/events{/privacy}","received_events_url":"https://api.github.com/users/weiboad/received_events","type":"Organization","site_admin":false},"repo":{"id":21408546,"name":"kafka-php","full_name":"weiboad/kafka-php","owner":{"login":"weiboad","id":19903383,"avatar_url":"https://avatars3.githubusercontent.com/u/19903383?v=4","gravatar_id":"","url":"https://api.github.com/users/weiboad","html_url":"https://github.com/weiboad","followers_url":"https://api.github.com/users/weiboad/followers","following_url":"https://api.github.com/users/weiboad/following{/other_user}","gists_url":"https://api.github.com/users/weiboad/gists{/gist_id}","starred_url":"https://api.github.com/users/weiboad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weiboad/subscriptions","organizations_url":"https://api.github.com/users/weiboad/orgs","repos_url":"https://api.github.com/users/weiboad/repos","events_url":"https://api.github.com/users/weiboad/events{/privacy}","received_events_url":"https://api.github.com/users/weiboad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/weiboad/kafka-php","description":"kafka php client","fork":false,"url":"https://api.github.com/repos/weiboad/kafka-php","forks_url":"https://api.github.com/repos/weiboad/kafka-php/forks","keys_url":"https://api.github.com/repos/weiboad/kafka-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weiboad/kafka-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weiboad/kafka-php/teams","hooks_url":"https://api.github.com/repos/weiboad/kafka-php/hooks","issue_events_url":"https://api.github.com/repos/weiboad/kafka-php/issues/events{/number}","events_url":"https://api.github.com/repos/weiboad/kafka-php/events","assignees_url":"https://api.github.com/repos/weiboad/kafka-php/assignees{/user}","branches_url":"https://api.github.com/repos/weiboad/kafka-php/branches{/branch}","tags_url":"https://api.github.com/repos/weiboad/kafka-php/tags","blobs_url":"https://api.github.com/repos/weiboad/kafka-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weiboad/kafka-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weiboad/kafka-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/weiboad/kafka-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weiboad/kafka-php/statuses/{sha}","languages_url":"https://api.github.com/repos/weiboad/kafka-php/languages","stargazers_url":"https://api.github.com/repos/weiboad/kafka-php/stargazers","contributors_url":"https://api.github.com/repos/weiboad/kafka-php/contributors","subscribers_url":"https://api.github.com/repos/weiboad/kafka-php/subscribers","subscription_url":"https://api.github.com/repos/weiboad/kafka-php/subscription","commits_url":"https://api.github.com/repos/weiboad/kafka-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/weiboad/kafka-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/weiboad/kafka-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/weiboad/kafka-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/weiboad/kafka-php/contents/{+path}","compare_url":"https://api.github.com/repos/weiboad/kafka-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weiboad/kafka-php/merges","archive_url":"https://api.github.com/repos/weiboad/kafka-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weiboad/kafka-php/downloads","issues_url":"https://api.github.com/repos/weiboad/kafka-php/issues{/number}","pulls_url":"https://api.github.com/repos/weiboad/kafka-php/pulls{/number}","milestones_url":"https://api.github.com/repos/weiboad/kafka-php/milestones{/number}","notifications_url":"https://api.github.com/repos/weiboad/kafka-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weiboad/kafka-php/labels{/name}","releases_url":"https://api.github.com/repos/weiboad/kafka-php/releases{/id}","deployments_url":"https://api.github.com/repos/weiboad/kafka-php/deployments","created_at":"2014-07-02T02:11:08Z","updated_at":"2017-12-11T10:06:07Z","pushed_at":"2017-12-11T09:09:39Z","git_url":"git://github.com/weiboad/kafka-php.git","ssh_url":"git@github.com:weiboad/kafka-php.git","clone_url":"https://github.com/weiboad/kafka-php.git","svn_url":"https://github.com/weiboad/kafka-php","homepage":"","size":556,"stargazers_count":597,"watchers_count":597,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":202,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":202,"open_issues":19,"watchers":597,"default_branch":"master"}},"base":{"label":"weiboad:master","ref":"master","sha":"1590e97310d55eca5a0c13cd28f6af3c9f5f5994","user":{"login":"weiboad","id":19903383,"avatar_url":"https://avatars3.githubusercontent.com/u/19903383?v=4","gravatar_id":"","url":"https://api.github.com/users/weiboad","html_url":"https://github.com/weiboad","followers_url":"https://api.github.com/users/weiboad/followers","following_url":"https://api.github.com/users/weiboad/following{/other_user}","gists_url":"https://api.github.com/users/weiboad/gists{/gist_id}","starred_url":"https://api.github.com/users/weiboad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weiboad/subscriptions","organizations_url":"https://api.github.com/users/weiboad/orgs","repos_url":"https://api.github.com/users/weiboad/repos","events_url":"https://api.github.com/users/weiboad/events{/privacy}","received_events_url":"https://api.github.com/users/weiboad/received_events","type":"Organization","site_admin":false},"repo":{"id":21408546,"name":"kafka-php","full_name":"weiboad/kafka-php","owner":{"login":"weiboad","id":19903383,"avatar_url":"https://avatars3.githubusercontent.com/u/19903383?v=4","gravatar_id":"","url":"https://api.github.com/users/weiboad","html_url":"https://github.com/weiboad","followers_url":"https://api.github.com/users/weiboad/followers","following_url":"https://api.github.com/users/weiboad/following{/other_user}","gists_url":"https://api.github.com/users/weiboad/gists{/gist_id}","starred_url":"https://api.github.com/users/weiboad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weiboad/subscriptions","organizations_url":"https://api.github.com/users/weiboad/orgs","repos_url":"https://api.github.com/users/weiboad/repos","events_url":"https://api.github.com/users/weiboad/events{/privacy}","received_events_url":"https://api.github.com/users/weiboad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/weiboad/kafka-php","description":"kafka php client","fork":false,"url":"https://api.github.com/repos/weiboad/kafka-php","forks_url":"https://api.github.com/repos/weiboad/kafka-php/forks","keys_url":"https://api.github.com/repos/weiboad/kafka-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weiboad/kafka-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weiboad/kafka-php/teams","hooks_url":"https://api.github.com/repos/weiboad/kafka-php/hooks","issue_events_url":"https://api.github.com/repos/weiboad/kafka-php/issues/events{/number}","events_url":"https://api.github.com/repos/weiboad/kafka-php/events","assignees_url":"https://api.github.com/repos/weiboad/kafka-php/assignees{/user}","branches_url":"https://api.github.com/repos/weiboad/kafka-php/branches{/branch}","tags_url":"https://api.github.com/repos/weiboad/kafka-php/tags","blobs_url":"https://api.github.com/repos/weiboad/kafka-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weiboad/kafka-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weiboad/kafka-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/weiboad/kafka-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weiboad/kafka-php/statuses/{sha}","languages_url":"https://api.github.com/repos/weiboad/kafka-php/languages","stargazers_url":"https://api.github.com/repos/weiboad/kafka-php/stargazers","contributors_url":"https://api.github.com/repos/weiboad/kafka-php/contributors","subscribers_url":"https://api.github.com/repos/weiboad/kafka-php/subscribers","subscription_url":"https://api.github.com/repos/weiboad/kafka-php/subscription","commits_url":"https://api.github.com/repos/weiboad/kafka-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/weiboad/kafka-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/weiboad/kafka-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/weiboad/kafka-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/weiboad/kafka-php/contents/{+path}","compare_url":"https://api.github.com/repos/weiboad/kafka-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weiboad/kafka-php/merges","archive_url":"https://api.github.com/repos/weiboad/kafka-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weiboad/kafka-php/downloads","issues_url":"https://api.github.com/repos/weiboad/kafka-php/issues{/number}","pulls_url":"https://api.github.com/repos/weiboad/kafka-php/pulls{/number}","milestones_url":"https://api.github.com/repos/weiboad/kafka-php/milestones{/number}","notifications_url":"https://api.github.com/repos/weiboad/kafka-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weiboad/kafka-php/labels{/name}","releases_url":"https://api.github.com/repos/weiboad/kafka-php/releases{/id}","deployments_url":"https://api.github.com/repos/weiboad/kafka-php/deployments","created_at":"2014-07-02T02:11:08Z","updated_at":"2017-12-11T10:06:07Z","pushed_at":"2017-12-11T09:09:39Z","git_url":"git://github.com/weiboad/kafka-php.git","ssh_url":"git@github.com:weiboad/kafka-php.git","clone_url":"https://github.com/weiboad/kafka-php.git","svn_url":"https://github.com/weiboad/kafka-php","homepage":"","size":556,"stargazers_count":597,"watchers_count":597,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":202,"mirror_url":null,"archived":false,"open_issues_count":19,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":202,"open_issues":19,"watchers":597,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/weiboad/kafka-php/pulls/150"},"html":{"href":"https://github.com/weiboad/kafka-php/pull/150"},"issue":{"href":"https://api.github.com/repos/weiboad/kafka-php/issues/150"},"comments":{"href":"https://api.github.com/repos/weiboad/kafka-php/issues/150/comments"},"review_comments":{"href":"https://api.github.com/repos/weiboad/kafka-php/pulls/150/comments"},"review_comment":{"href":"https://api.github.com/repos/weiboad/kafka-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/weiboad/kafka-php/pulls/150/commits"},"statuses":{"href":"https://api.github.com/repos/weiboad/kafka-php/statuses/285a54a473e7a219e7076eee0bbbdeee5fd5bdc8"}},"author_association":"OWNER"}}
{"actor":{"display_login":"lcobucci"}}