{"action":"created","comment":{"url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/comments/26287910","id":26287910,"diff_hunk":"@@ -0,0 +1,317 @@\n+<?php\n+/**\n+ * Part of Windwalker project Test files.\n+ *\n+ * @copyright  Copyright (C) 2011 - 2014 SMS Taiwan, Inc. All rights reserved.\n+ * @license    GNU General Public License version 2 or later; see LICENSE\n+ */\n+\n+namespace Windwalker\\Test\\Helper;\n+\n+use Windwalker\\Helper\\ArrayHelper;\n+\n+/**\n+ * Test class of Windwalker\\Helper\\ArrayHelper\n+ *\n+ * @since 2.0\n+ */\n+class ArrayHelperTest extends \\PHPUnit_Framework_TestCase\n+{\n+\t/**\n+\t * Tears down the fixture, for example, closes a network connection.\n+\t * This method is called after a test is executed.\n+\t *\n+\t * @return void\n+\t */\n+\tprotected function tearDown()\n+\t{\n+\t}\n+\n+\t/**\n+\t * Method to test repair().\n+\t *\n+\t * @return void\n+\t *\n+\t * @covers \\Windwalker\\Helper\\ArrayHelper::getByPath\n+\t */\n+\tpublic function testGetByPath()\n+\t{\n+\t\t$object                 = new \\stdClass;\n+\t\t$object->Alice          = 'Julia';\n+\t\t$object->Johnny         = array(\n+\t\t\t'David' => 123,\n+\t\t\t'Peter' => 'John',\n+\t\t);\n+\t\t$object->Vanessa        = new \\stdClass;\n+\t\t$object->Vanessa->Maria = 'Catherine';\n+\n+\t\t$data = array(\n+\t\t\t'Jones'  => array(\n+\t\t\t\t'Sakura' => 223\n+\t\t\t),\n+\t\t\t'Arthur' => array(\n+\t\t\t\t'Lancelot' => array(\n+\t\t\t\t\t'Jessica' => $object,\n+\t\t\t\t\t'Rose'    => array(\n+\t\t\t\t\t\t'Taylor' => 323\n+\t\t\t\t\t)\n+\t\t\t\t)\n+\t\t\t)\n+\t\t);\n+\n+\t\t// Test null return\n+\t\t$this->assertEquals(null, ArrayHelper::getByPath($data, ''));\n+\t\t$this->assertEquals(null, ArrayHelper::getByPath($data, null));\n+\t\t$this->assertEquals(null, ArrayHelper::getByPath($data, []));\n+\t\t$this->assertEquals(null, ArrayHelper::getByPath($data, new \\stdClass));\n+\n+\t\t// Test paths\n+\t\t$this->assertEquals(223, ArrayHelper::getByPath($data, 'Jones.Sakura'));\n+\t\t$this->assertEquals(array('Taylor' => 323), ArrayHelper::getByPath($data, 'Arthur.Lancelot.Rose'));\n+\t\t$this->assertEquals(323, ArrayHelper::getByPath($data, 'Arthur.Lancelot.Rose.Taylor'));\n+\t\t$this->assertEquals('Julia', ArrayHelper::getByPath($data, 'Arthur.Lancelot.Jessica.Alice'));\n+\t\t$this->assertEquals(array('David' => 123, 'Peter' => 'John'), ArrayHelper::getByPath($data, 'Arthur.Lancelot.Jessica.Johnny'));\n+\t\t$this->assertEquals(123, ArrayHelper::getByPath($data, 'Arthur.Lancelot.Jessica.Johnny.David'));\n+\t\t$this->assertEquals('John', ArrayHelper::getByPath($data, 'Arthur.Lancelot.Jessica.Johnny.Peter'));","path":"test/Helper/ArrayHelperTest.php","position":75,"original_position":75,"commit_id":"d2d69909be83128326d2aee352da7a386a464c72","original_commit_id":"d2d69909be83128326d2aee352da7a386a464c72","user":{"login":"asika32764","id":1639206,"avatar_url":"https://avatars.githubusercontent.com/u/1639206?v=3","gravatar_id":"","url":"https://api.github.com/users/asika32764","html_url":"https://github.com/asika32764","followers_url":"https://api.github.com/users/asika32764/followers","following_url":"https://api.github.com/users/asika32764/following{/other_user}","gists_url":"https://api.github.com/users/asika32764/gists{/gist_id}","starred_url":"https://api.github.com/users/asika32764/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asika32764/subscriptions","organizations_url":"https://api.github.com/users/asika32764/orgs","repos_url":"https://api.github.com/users/asika32764/repos","events_url":"https://api.github.com/users/asika32764/events{/privacy}","received_events_url":"https://api.github.com/users/asika32764/received_events","type":"User","site_admin":false},"body":"圓桌武士？","created_at":"2015-03-12T09:35:45Z","updated_at":"2015-03-12T09:35:45Z","html_url":"https://github.com/smstw/windwalker-joomla-rad/pull/21#discussion_r26287910","pull_request_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/comments/26287910"},"html":{"href":"https://github.com/smstw/windwalker-joomla-rad/pull/21#discussion_r26287910"},"pull_request":{"href":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/21","id":31019186,"html_url":"https://github.com/smstw/windwalker-joomla-rad/pull/21","diff_url":"https://github.com/smstw/windwalker-joomla-rad/pull/21.diff","patch_url":"https://github.com/smstw/windwalker-joomla-rad/pull/21.patch","issue_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/issues/21","number":21,"state":"open","locked":false,"title":"[Test] Add test case of ArrayHelper","user":{"login":"LeoOnTheEarth","id":726108,"avatar_url":"https://avatars.githubusercontent.com/u/726108?v=3","gravatar_id":"","url":"https://api.github.com/users/LeoOnTheEarth","html_url":"https://github.com/LeoOnTheEarth","followers_url":"https://api.github.com/users/LeoOnTheEarth/followers","following_url":"https://api.github.com/users/LeoOnTheEarth/following{/other_user}","gists_url":"https://api.github.com/users/LeoOnTheEarth/gists{/gist_id}","starred_url":"https://api.github.com/users/LeoOnTheEarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeoOnTheEarth/subscriptions","organizations_url":"https://api.github.com/users/LeoOnTheEarth/orgs","repos_url":"https://api.github.com/users/LeoOnTheEarth/repos","events_url":"https://api.github.com/users/LeoOnTheEarth/events{/privacy}","received_events_url":"https://api.github.com/users/LeoOnTheEarth/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-03-12T09:28:42Z","updated_at":"2015-03-12T09:35:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b39a58e9f0bfdcd897fe5d0d67056f7ff6555d9d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/21/commits","review_comments_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/21/comments","review_comment_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/comments{/number}","comments_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/issues/21/comments","statuses_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/statuses/d2d69909be83128326d2aee352da7a386a464c72","head":{"label":"LeoOnTheEarth:add-test-array-helper","ref":"add-test-array-helper","sha":"d2d69909be83128326d2aee352da7a386a464c72","user":{"login":"LeoOnTheEarth","id":726108,"avatar_url":"https://avatars.githubusercontent.com/u/726108?v=3","gravatar_id":"","url":"https://api.github.com/users/LeoOnTheEarth","html_url":"https://github.com/LeoOnTheEarth","followers_url":"https://api.github.com/users/LeoOnTheEarth/followers","following_url":"https://api.github.com/users/LeoOnTheEarth/following{/other_user}","gists_url":"https://api.github.com/users/LeoOnTheEarth/gists{/gist_id}","starred_url":"https://api.github.com/users/LeoOnTheEarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeoOnTheEarth/subscriptions","organizations_url":"https://api.github.com/users/LeoOnTheEarth/orgs","repos_url":"https://api.github.com/users/LeoOnTheEarth/repos","events_url":"https://api.github.com/users/LeoOnTheEarth/events{/privacy}","received_events_url":"https://api.github.com/users/LeoOnTheEarth/received_events","type":"User","site_admin":false},"repo":{"id":21337069,"name":"windwalker-joomla-rad","full_name":"LeoOnTheEarth/windwalker-joomla-rad","owner":{"login":"LeoOnTheEarth","id":726108,"avatar_url":"https://avatars.githubusercontent.com/u/726108?v=3","gravatar_id":"","url":"https://api.github.com/users/LeoOnTheEarth","html_url":"https://github.com/LeoOnTheEarth","followers_url":"https://api.github.com/users/LeoOnTheEarth/followers","following_url":"https://api.github.com/users/LeoOnTheEarth/following{/other_user}","gists_url":"https://api.github.com/users/LeoOnTheEarth/gists{/gist_id}","starred_url":"https://api.github.com/users/LeoOnTheEarth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeoOnTheEarth/subscriptions","organizations_url":"https://api.github.com/users/LeoOnTheEarth/orgs","repos_url":"https://api.github.com/users/LeoOnTheEarth/repos","events_url":"https://api.github.com/users/LeoOnTheEarth/events{/privacy}","received_events_url":"https://api.github.com/users/LeoOnTheEarth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/LeoOnTheEarth/windwalker-joomla-rad","description":"Windwalker RAD framework for Joomla CMS","fork":true,"url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad","forks_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/forks","keys_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/teams","hooks_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/hooks","issue_events_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/issues/events{/number}","events_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/events","assignees_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/assignees{/user}","branches_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/branches{/branch}","tags_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/tags","blobs_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/git/refs{/sha}","trees_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/statuses/{sha}","languages_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/languages","stargazers_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/stargazers","contributors_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/contributors","subscribers_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/subscribers","subscription_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/subscription","commits_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/commits{/sha}","git_commits_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/git/commits{/sha}","comments_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/comments{/number}","issue_comment_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/issues/comments{/number}","contents_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/contents/{+path}","compare_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/merges","archive_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/downloads","issues_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/issues{/number}","pulls_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/pulls{/number}","milestones_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/milestones{/number}","notifications_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/labels{/name}","releases_url":"https://api.github.com/repos/LeoOnTheEarth/windwalker-joomla-rad/releases{/id}","created_at":"2014-06-30T02:13:09Z","updated_at":"2014-11-28T03:22:33Z","pushed_at":"2015-03-12T09:28:06Z","git_url":"git://github.com/LeoOnTheEarth/windwalker-joomla-rad.git","ssh_url":"git@github.com:LeoOnTheEarth/windwalker-joomla-rad.git","clone_url":"https://github.com/LeoOnTheEarth/windwalker-joomla-rad.git","svn_url":"https://github.com/LeoOnTheEarth/windwalker-joomla-rad","homepage":"http://ventoviro.github.io/windwalker-rad-doc/","size":2531,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"staging"}},"base":{"label":"smstw:dev-2.1","ref":"dev-2.1","sha":"734ba9c44b8cf10eb09a7229fb203c6c2575d846","user":{"login":"smstw","id":5608018,"avatar_url":"https://avatars.githubusercontent.com/u/5608018?v=3","gravatar_id":"","url":"https://api.github.com/users/smstw","html_url":"https://github.com/smstw","followers_url":"https://api.github.com/users/smstw/followers","following_url":"https://api.github.com/users/smstw/following{/other_user}","gists_url":"https://api.github.com/users/smstw/gists{/gist_id}","starred_url":"https://api.github.com/users/smstw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smstw/subscriptions","organizations_url":"https://api.github.com/users/smstw/orgs","repos_url":"https://api.github.com/users/smstw/repos","events_url":"https://api.github.com/users/smstw/events{/privacy}","received_events_url":"https://api.github.com/users/smstw/received_events","type":"Organization","site_admin":false},"repo":{"id":24495433,"name":"windwalker-joomla-rad","full_name":"smstw/windwalker-joomla-rad","owner":{"login":"smstw","id":5608018,"avatar_url":"https://avatars.githubusercontent.com/u/5608018?v=3","gravatar_id":"","url":"https://api.github.com/users/smstw","html_url":"https://github.com/smstw","followers_url":"https://api.github.com/users/smstw/followers","following_url":"https://api.github.com/users/smstw/following{/other_user}","gists_url":"https://api.github.com/users/smstw/gists{/gist_id}","starred_url":"https://api.github.com/users/smstw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smstw/subscriptions","organizations_url":"https://api.github.com/users/smstw/orgs","repos_url":"https://api.github.com/users/smstw/repos","events_url":"https://api.github.com/users/smstw/events{/privacy}","received_events_url":"https://api.github.com/users/smstw/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/smstw/windwalker-joomla-rad","description":"Windwalker RAD framework for Joomla CMS","fork":true,"url":"https://api.github.com/repos/smstw/windwalker-joomla-rad","forks_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/forks","keys_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/keys{/key_id}","collaborators_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/teams","hooks_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/hooks","issue_events_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/issues/events{/number}","events_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/events","assignees_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/assignees{/user}","branches_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/branches{/branch}","tags_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/tags","blobs_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/git/refs{/sha}","trees_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/git/trees{/sha}","statuses_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/statuses/{sha}","languages_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/languages","stargazers_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/stargazers","contributors_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/contributors","subscribers_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/subscribers","subscription_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/subscription","commits_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/commits{/sha}","git_commits_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/git/commits{/sha}","comments_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/comments{/number}","issue_comment_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/issues/comments{/number}","contents_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/contents/{+path}","compare_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/compare/{base}...{head}","merges_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/merges","archive_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/downloads","issues_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/issues{/number}","pulls_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls{/number}","milestones_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/milestones{/number}","notifications_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/labels{/name}","releases_url":"https://api.github.com/repos/smstw/windwalker-joomla-rad/releases{/id}","created_at":"2014-09-26T10:20:58Z","updated_at":"2015-01-12T10:06:54Z","pushed_at":"2015-01-12T10:06:54Z","git_url":"git://github.com/smstw/windwalker-joomla-rad.git","ssh_url":"git@github.com:smstw/windwalker-joomla-rad.git","clone_url":"https://github.com/smstw/windwalker-joomla-rad.git","svn_url":"https://github.com/smstw/windwalker-joomla-rad","homepage":"http://ventoviro.github.io/windwalker-rad-doc/","size":2467,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":17,"forks":0,"open_issues":17,"watchers":0,"default_branch":"dev-2.1"}},"_links":{"self":{"href":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/21"},"html":{"href":"https://github.com/smstw/windwalker-joomla-rad/pull/21"},"issue":{"href":"https://api.github.com/repos/smstw/windwalker-joomla-rad/issues/21"},"comments":{"href":"https://api.github.com/repos/smstw/windwalker-joomla-rad/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/smstw/windwalker-joomla-rad/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/smstw/windwalker-joomla-rad/statuses/d2d69909be83128326d2aee352da7a386a464c72"}}}}