{"action":"created","comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments/35572683","id":35572683,"diff_hunk":"@@ -0,0 +1,1618 @@\n+<?php\n+/**\n+ * @package     Joomla.UnitTest\n+ * @subpackage  Installer\n+ *\n+ * @copyright   Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.\n+ * @license     GNU General Public License version 2 or later; see LICENSE\n+ */\n+\n+/**\n+ * Test class for JInstallerAdapter.\n+ *\n+ * @package     Joomla.UnitTest\n+ * @subpackage  Installer\n+ * @since       3.4.4\n+ */\n+class JInstallerAdapterTest extends TestCaseDatabase\n+{\n+\t/**\n+\t * Used in tests for callbacks involving JInstaller::setOverwrite()\n+\t *\n+\t * @var  boolean\n+\t */\n+\tprotected static $installerOverwrite;\n+\n+\t/**\n+\t * Used in tests for callbacks involving JInstaller::setUpgrade()\n+\t *\n+\t * @var  boolean\n+\t */\n+\tprotected static $installerUpgrade;\n+\n+\t/**\n+\t * Sample Manifest String\n+\t */\n+\tprotected $sampleManifest = '<extension><name>com_content</name><element>com_content</element><description>Dummy Description Text</description><update><schemas><schemapath type=\"mysql\">sql/updates/mysql</schemapath></schemas></update></extension>';\n+\n+\t/**\n+\t * Setup for testing.\n+\t *\n+\t * @return  void\n+\t *\n+\t */\n+\tpublic function setUp()\n+\t{\n+\t\tparent::setUp();\n+\n+\t\t// Mock JFilter\n+\t\t$filterMock = $this->getMock('JFilterInput', array('filter'));\n+\t\t$filterSig = md5(serialize(array(array(), array(), 0, 0, 1)));\n+\t\tTestReflection::setValue('JFilterInput', 'instances', array($filterSig => $filterMock));\n+\t}\n+\n+\t/**\n+\t * Overrides the parent tearDown method.\n+\t *\n+\t * @return  void\n+\t *\n+\t * @see     PHPUnit_Framework_TestCase::tearDown()\n+\t */\n+\tprotected function tearDown()\n+\t{\n+\t\t// Reset the dispatcher instance.\n+\t\tTestReflection::setValue('JFilterInput', 'instances', array());\n+\n+\t\tparent::tearDown();\n+\t}\n+\n+\t/**\n+\t * @testdox Tests the public constructor\n+\t */\n+\tpublic function testConstructor()\n+\t{\n+\t\t$mockInstaller = $this->getMock('JInstaller');\n+\t\t$mockDatabase = $this->getMockDatabase();\n+\t\t$object = $this->getMockForAbstractClass('JInstallerAdapter', array($mockInstaller, $mockDatabase, array('foo' => 'bar')));\n+\n+\t\t$this->assertInstanceOf(","path":"tests/unit/suites/libraries/cms/installer/JInstallerAdapterTest.php","position":78,"original_position":78,"commit_id":"28d84851ba87be4566dcb82ff3732ee46f0eb7ae","original_commit_id":"28d84851ba87be4566dcb82ff3732ee46f0eb7ae","user":{"login":"mbabker","id":368545,"avatar_url":"https://avatars.githubusercontent.com/u/368545?v=3","gravatar_id":"","url":"https://api.github.com/users/mbabker","html_url":"https://github.com/mbabker","followers_url":"https://api.github.com/users/mbabker/followers","following_url":"https://api.github.com/users/mbabker/following{/other_user}","gists_url":"https://api.github.com/users/mbabker/gists{/gist_id}","starred_url":"https://api.github.com/users/mbabker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbabker/subscriptions","organizations_url":"https://api.github.com/users/mbabker/orgs","repos_url":"https://api.github.com/users/mbabker/repos","events_url":"https://api.github.com/users/mbabker/events{/privacy}","received_events_url":"https://api.github.com/users/mbabker/received_events","type":"User","site_admin":false},"body":"`$this->assertAttributeInstanceOf('JTableExtension', 'extension', 'object');`\r\n\r\nDon't need to use our Reflection helpers here.  Use the PHPUnit API as it's practical.","created_at":"2015-07-27T18:56:54Z","updated_at":"2015-07-27T18:56:54Z","html_url":"https://github.com/joomla/joomla-cms/pull/7569#discussion_r35572683","pull_request_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/7569","_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments/35572683"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/7569#discussion_r35572683"},"pull_request":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/7569"}}},"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/7569","id":40936243,"html_url":"https://github.com/joomla/joomla-cms/pull/7569","diff_url":"https://github.com/joomla/joomla-cms/pull/7569.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/7569.patch","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7569","number":7569,"state":"open","locked":false,"title":"Add unit tests for JInstallerAdapter","user":{"login":"wilsonge","id":1986000,"avatar_url":"https://avatars.githubusercontent.com/u/1986000?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonge","html_url":"https://github.com/wilsonge","followers_url":"https://api.github.com/users/wilsonge/followers","following_url":"https://api.github.com/users/wilsonge/following{/other_user}","gists_url":"https://api.github.com/users/wilsonge/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonge/subscriptions","organizations_url":"https://api.github.com/users/wilsonge/orgs","repos_url":"https://api.github.com/users/wilsonge/repos","events_url":"https://api.github.com/users/wilsonge/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonge/received_events","type":"User","site_admin":false},"body":"This gives us code coverage of ~75% of the lines in the class (15/23 methods in the class)","created_at":"2015-07-27T18:51:37Z","updated_at":"2015-07-27T18:56:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"932f716991882c3f7f387978f788b4169748bd03","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/7569/commits","review_comments_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/7569/comments","review_comment_url":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/7569/comments","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/28d84851ba87be4566dcb82ff3732ee46f0eb7ae","head":{"label":"wilsonge:installertests","ref":"installertests","sha":"28d84851ba87be4566dcb82ff3732ee46f0eb7ae","user":{"login":"wilsonge","id":1986000,"avatar_url":"https://avatars.githubusercontent.com/u/1986000?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonge","html_url":"https://github.com/wilsonge","followers_url":"https://api.github.com/users/wilsonge/followers","following_url":"https://api.github.com/users/wilsonge/following{/other_user}","gists_url":"https://api.github.com/users/wilsonge/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonge/subscriptions","organizations_url":"https://api.github.com/users/wilsonge/orgs","repos_url":"https://api.github.com/users/wilsonge/repos","events_url":"https://api.github.com/users/wilsonge/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonge/received_events","type":"User","site_admin":false},"repo":{"id":9136608,"name":"joomla-cms","full_name":"wilsonge/joomla-cms","owner":{"login":"wilsonge","id":1986000,"avatar_url":"https://avatars.githubusercontent.com/u/1986000?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonge","html_url":"https://github.com/wilsonge","followers_url":"https://api.github.com/users/wilsonge/followers","following_url":"https://api.github.com/users/wilsonge/following{/other_user}","gists_url":"https://api.github.com/users/wilsonge/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonge/subscriptions","organizations_url":"https://api.github.com/users/wilsonge/orgs","repos_url":"https://api.github.com/users/wilsonge/repos","events_url":"https://api.github.com/users/wilsonge/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonge/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wilsonge/joomla-cms","description":"Home of the Joomla! Content Management System","fork":true,"url":"https://api.github.com/repos/wilsonge/joomla-cms","forks_url":"https://api.github.com/repos/wilsonge/joomla-cms/forks","keys_url":"https://api.github.com/repos/wilsonge/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wilsonge/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wilsonge/joomla-cms/teams","hooks_url":"https://api.github.com/repos/wilsonge/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/wilsonge/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/wilsonge/joomla-cms/events","assignees_url":"https://api.github.com/repos/wilsonge/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/wilsonge/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/wilsonge/joomla-cms/tags","blobs_url":"https://api.github.com/repos/wilsonge/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wilsonge/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wilsonge/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/wilsonge/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wilsonge/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/wilsonge/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/wilsonge/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/wilsonge/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/wilsonge/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/wilsonge/joomla-cms/subscription","commits_url":"https://api.github.com/repos/wilsonge/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/wilsonge/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/wilsonge/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/wilsonge/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/wilsonge/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/wilsonge/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wilsonge/joomla-cms/merges","archive_url":"https://api.github.com/repos/wilsonge/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wilsonge/joomla-cms/downloads","issues_url":"https://api.github.com/repos/wilsonge/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/wilsonge/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/wilsonge/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/wilsonge/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wilsonge/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/wilsonge/joomla-cms/releases{/id}","created_at":"2013-03-31T21:30:21Z","updated_at":"2015-04-17T01:23:09Z","pushed_at":"2015-07-27T18:47:26Z","git_url":"git://github.com/wilsonge/joomla-cms.git","ssh_url":"git@github.com:wilsonge/joomla-cms.git","clone_url":"https://github.com/wilsonge/joomla-cms.git","svn_url":"https://github.com/wilsonge/joomla-cms","homepage":"http://joomla.org","size":136286,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":1,"default_branch":"staging"}},"base":{"label":"joomla:staging","ref":"staging","sha":"dbabc0edb5e5e26090bf3a4588d9cdc0379db368","user":{"login":"joomla","id":751633,"avatar_url":"https://avatars.githubusercontent.com/u/751633?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"repo":{"id":2464908,"name":"joomla-cms","full_name":"joomla/joomla-cms","owner":{"login":"joomla","id":751633,"avatar_url":"https://avatars.githubusercontent.com/u/751633?v=3","gravatar_id":"","url":"https://api.github.com/users/joomla","html_url":"https://github.com/joomla","followers_url":"https://api.github.com/users/joomla/followers","following_url":"https://api.github.com/users/joomla/following{/other_user}","gists_url":"https://api.github.com/users/joomla/gists{/gist_id}","starred_url":"https://api.github.com/users/joomla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joomla/subscriptions","organizations_url":"https://api.github.com/users/joomla/orgs","repos_url":"https://api.github.com/users/joomla/repos","events_url":"https://api.github.com/users/joomla/events{/privacy}","received_events_url":"https://api.github.com/users/joomla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/joomla/joomla-cms","description":"Home of the Joomla! Content Management System","fork":false,"url":"https://api.github.com/repos/joomla/joomla-cms","forks_url":"https://api.github.com/repos/joomla/joomla-cms/forks","keys_url":"https://api.github.com/repos/joomla/joomla-cms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/joomla/joomla-cms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/joomla/joomla-cms/teams","hooks_url":"https://api.github.com/repos/joomla/joomla-cms/hooks","issue_events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/events{/number}","events_url":"https://api.github.com/repos/joomla/joomla-cms/events","assignees_url":"https://api.github.com/repos/joomla/joomla-cms/assignees{/user}","branches_url":"https://api.github.com/repos/joomla/joomla-cms/branches{/branch}","tags_url":"https://api.github.com/repos/joomla/joomla-cms/tags","blobs_url":"https://api.github.com/repos/joomla/joomla-cms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/joomla/joomla-cms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/joomla/joomla-cms/git/refs{/sha}","trees_url":"https://api.github.com/repos/joomla/joomla-cms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/joomla/joomla-cms/statuses/{sha}","languages_url":"https://api.github.com/repos/joomla/joomla-cms/languages","stargazers_url":"https://api.github.com/repos/joomla/joomla-cms/stargazers","contributors_url":"https://api.github.com/repos/joomla/joomla-cms/contributors","subscribers_url":"https://api.github.com/repos/joomla/joomla-cms/subscribers","subscription_url":"https://api.github.com/repos/joomla/joomla-cms/subscription","commits_url":"https://api.github.com/repos/joomla/joomla-cms/commits{/sha}","git_commits_url":"https://api.github.com/repos/joomla/joomla-cms/git/commits{/sha}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/comments{/number}","issue_comment_url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments{/number}","contents_url":"https://api.github.com/repos/joomla/joomla-cms/contents/{+path}","compare_url":"https://api.github.com/repos/joomla/joomla-cms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/joomla/joomla-cms/merges","archive_url":"https://api.github.com/repos/joomla/joomla-cms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/joomla/joomla-cms/downloads","issues_url":"https://api.github.com/repos/joomla/joomla-cms/issues{/number}","pulls_url":"https://api.github.com/repos/joomla/joomla-cms/pulls{/number}","milestones_url":"https://api.github.com/repos/joomla/joomla-cms/milestones{/number}","notifications_url":"https://api.github.com/repos/joomla/joomla-cms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/joomla/joomla-cms/labels{/name}","releases_url":"https://api.github.com/repos/joomla/joomla-cms/releases{/id}","created_at":"2011-09-27T02:07:38Z","updated_at":"2015-07-27T15:40:29Z","pushed_at":"2015-07-27T18:51:37Z","git_url":"git://github.com/joomla/joomla-cms.git","ssh_url":"git@github.com:joomla/joomla-cms.git","clone_url":"https://github.com/joomla/joomla-cms.git","svn_url":"https://github.com/joomla/joomla-cms","homepage":"http://joomla.org","size":334613,"stargazers_count":1612,"watchers_count":1612,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1791,"mirror_url":null,"open_issues_count":537,"forks":1791,"open_issues":537,"watchers":1612,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/7569"},"html":{"href":"https://github.com/joomla/joomla-cms/pull/7569"},"issue":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/7569"},"comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/issues/7569/comments"},"review_comments":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/7569/comments"},"review_comment":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/joomla/joomla-cms/pulls/7569/commits"},"statuses":{"href":"https://api.github.com/repos/joomla/joomla-cms/statuses/28d84851ba87be4566dcb82ff3732ee46f0eb7ae"}}}}