{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/app/pulls/comments/94113271","pull_request_review_id":14643615,"id":94113271,"diff_hunk":"@@ -0,0 +1,621 @@\n+<?php\n+\n+class PortableInfoboxMobileRenderServiceTest extends WikiaBaseTest {\n+\t//todo: https://wikia-inc.atlassian.net/browse/DAT-3076\n+\t//todo: we are testing a lot of functionality and have issues with mocking\n+\t//todo: we should move all render service test to API tests\n+\n+\tprotected function setUp() {\n+\t\t$this->setupFile = dirname( __FILE__ ) . '/../PortableInfobox.setup.php';\n+\t\tparent::setUp();\n+\t}\n+\n+\t/**\n+\t * @param $input to check presence of some additional config fields. Possible fields:\n+\t * 'isInvalidImage' - bool - if getThumbnail should return false\n+\t * 'isMercury' - bool - if we want to test Mercury skin\n+\t * 'isMercuryExperimentalMarkupEnabled' - bool\n+\t * 'smallImageDimensions' - integer - size of small image (both width and height)\n+\t *\n+\t * @return PHPUnit_Framework_MockObject_MockObject\n+\t */\n+\tprivate function mockInfoboxRenderServiceHelper( $input ) {\n+\t\t$isValidHeroDataItem = isset( $input[ 'isValidHeroDataItem' ] ) && $input[ 'isValidHeroDataItem' ];\n+\t\t$isMercury = isset( $input[ 'isMercury' ] ) && $input[ 'isMercury' ];\n+\n+\t\t$createHorizontalGroupData = isset( $input[ 'createHorizontalGroupData' ] ) ?\n+\t\t\t$input[ 'createHorizontalGroupData' ] : null;\n+\t\t$extendImageData = isset( $input[ 'extendImageData' ] ) ? $input[ 'extendImageData' ] : null;\n+\n+\t\t$mock = $this->getMockBuilder( 'Wikia\\PortableInfobox\\Helpers\\PortableInfoboxRenderServiceHelper' )\n+\t\t\t->setMethods( [ 'isValidHeroDataItem', 'validateType', 'isMercury',\n+\t\t\t\t'isMercuryExperimentalMarkupEnabled', 'createHorizontalGroupData', 'extendImageData' ] )\n+\t\t\t->getMock();\n+\t\t$mock->expects( $this->any() )\n+\t\t\t->method( 'isValidHeroDataItem' )\n+\t\t\t->will( $this->returnValue( $isValidHeroDataItem ) );\n+\t\t$mock->expects( $this->any() )\n+\t\t\t->method( 'validateType' )\n+\t\t\t->will( $this->returnValue( true ) );\n+\t\t$mock->expects( $this->any() )\n+\t\t\t->method( 'isMercury' )\n+\t\t\t->will( $this->returnValue( $isMercury ) );\n+\t\t$mock->expects( $this->any() )\n+\t\t\t->method( 'createHorizontalGroupData' )\n+\t\t\t->will( $this->returnValue( $createHorizontalGroupData ) );\n+\t\t$mock->expects( $this->any() )\n+\t\t\t->method( 'extendImageData' )\n+\t\t\t->will( $this->returnValue( $extendImageData ) );\n+\n+\t\t$this->mockClass( 'Wikia\\PortableInfobox\\Helpers\\PortableInfoboxRenderServiceHelper', $mock );\n+\t}\n+\n+\t/**\n+\t * @param $html\n+\t * @return string\n+\t */\n+\tprivate function normalizeHTML( $html ) {\n+\t\t$DOM = new DOMDocument( '1.0' );\n+\t\t$DOM->formatOutput = true;\n+\t\t$DOM->preserveWhiteSpace = false;\n+\t\t$DOM->loadXML( $html );\n+\n+\t\treturn $DOM->saveXML();\n+\t}\n+\n+\t/**\n+\t * @param $input\n+\t * @param $expectedOutput\n+\t * @param $description\n+\t * @param $mockParams\n+\t * @dataProvider testRenderInfoboxDataProvider\n+\t */\n+\tpublic function testRenderInfobox( $input, $expectedOutput, $description, $mockParams ) {\n+\t\t$this->mockInfoboxRenderServiceHelper( $mockParams );\n+\n+\t\t$infoboxRenderService = new PortableInfoboxMobileRenderService();\n+\t\t$actualOutput = $infoboxRenderService->renderInfobox( $input, '', '' );\n+\t\t$expectedHtml = $this->normalizeHTML( $expectedOutput );\n+\t\t$actualHtml = $this->normalizeHTML( $actualOutput );\n+\n+\t\t$this->assertEquals( $expectedHtml, $actualHtml, $description );\n+\t}\n+\n+\tpublic function testRenderInfoboxDataProvider() {\n+\t\treturn [\n+\t\t\t[\n+\t\t\t\t'input' => [ ],\n+\t\t\t\t'output' => '',\n+\t\t\t\t'description' => 'Empty data should yield no infobox markup'\n+\t\t\t],\n+\t\t\t[\n+\t\t\t\t'input' => [\n+\t\t\t\t\t[\n+\t\t\t\t\t\t'type' => 'title',\n+\t\t\t\t\t\t'data' => [\n+\t\t\t\t\t\t\t'value' => 'Test Title'","path":"extensions/wikia/PortableInfobox/tests/PortableInfoboxMobileRenderServiceTest.php","position":96,"original_position":96,"commit_id":"8fde85f70062a9b094002305d37360e639969b53","original_commit_id":"8fde85f70062a9b094002305d37360e639969b53","user":{"login":"WikiaTech","id":13279985,"avatar_url":"https://avatars.githubusercontent.com/u/13279985?v=3","gravatar_id":"","url":"https://api.github.com/users/WikiaTech","html_url":"https://github.com/WikiaTech","followers_url":"https://api.github.com/users/WikiaTech/followers","following_url":"https://api.github.com/users/WikiaTech/following{/other_user}","gists_url":"https://api.github.com/users/WikiaTech/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiaTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiaTech/subscriptions","organizations_url":"https://api.github.com/users/WikiaTech/orgs","repos_url":"https://api.github.com/users/WikiaTech/repos","events_url":"https://api.github.com/users/WikiaTech/events{/privacy}","received_events_url":"https://api.github.com/users/WikiaTech/received_events","type":"User","site_admin":false},"body":"![MINOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-minor.png) Define a constant instead of duplicating this literal \"Test Title\" 5 times. [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](https://sonarqube.wikia-inc.com/coding_rules#rule_key=php%3AS1192)\n![MINOR](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-minor.png) Define a constant instead of duplicating this literal \"value\" 24 times. [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](https://sonarqube.wikia-inc.com/coding_rules#rule_key=php%3AS1192)\n","created_at":"2016-12-29T08:53:29Z","updated_at":"2016-12-29T08:53:29Z","html_url":"https://github.com/Wikia/app/pull/12144#discussion_r94113271","pull_request_url":"https://api.github.com/repos/Wikia/app/pulls/12144","_links":{"self":{"href":"https://api.github.com/repos/Wikia/app/pulls/comments/94113271"},"html":{"href":"https://github.com/Wikia/app/pull/12144#discussion_r94113271"},"pull_request":{"href":"https://api.github.com/repos/Wikia/app/pulls/12144"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/app/pulls/12144","id":99545160,"html_url":"https://github.com/Wikia/app/pull/12144","diff_url":"https://github.com/Wikia/app/pull/12144.diff","patch_url":"https://github.com/Wikia/app/pull/12144.patch","issue_url":"https://api.github.com/repos/Wikia/app/issues/12144","number":12144,"state":"open","locked":false,"title":"XW-2444 | support for custom accent colors in Portable Infoboxes","user":{"login":"rybmat","id":1534495,"avatar_url":"https://avatars.githubusercontent.com/u/1534495?v=3","gravatar_id":"","url":"https://api.github.com/users/rybmat","html_url":"https://github.com/rybmat","followers_url":"https://api.github.com/users/rybmat/followers","following_url":"https://api.github.com/users/rybmat/following{/other_user}","gists_url":"https://api.github.com/users/rybmat/gists{/gist_id}","starred_url":"https://api.github.com/users/rybmat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rybmat/subscriptions","organizations_url":"https://api.github.com/users/rybmat/orgs","repos_url":"https://api.github.com/users/rybmat/repos","events_url":"https://api.github.com/users/rybmat/events{/privacy}","received_events_url":"https://api.github.com/users/rybmat/received_events","type":"User","site_admin":false},"body":"https://wikia-inc.atlassian.net/browse/XW-2444\r\n\r\n* refactored render service\r\n* accent-color-default, accent-color-source, accent-color-text-default, accent-color-text-source attributes added\r\n\r\n//cc @Wikia/x-wing ","created_at":"2016-12-28T12:45:43Z","updated_at":"2016-12-29T08:53:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bf49aaa7f67fddb93e225ca5e150d172aa3c3a19","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/app/pulls/12144/commits","review_comments_url":"https://api.github.com/repos/Wikia/app/pulls/12144/comments","review_comment_url":"https://api.github.com/repos/Wikia/app/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Wikia/app/issues/12144/comments","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/8fde85f70062a9b094002305d37360e639969b53","head":{"label":"Wikia:XW-2444","ref":"XW-2444","sha":"8fde85f70062a9b094002305d37360e639969b53","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":5532313,"name":"app","full_name":"Wikia/app","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/app","description":"Wikia Application Code","fork":false,"url":"https://api.github.com/repos/Wikia/app","forks_url":"https://api.github.com/repos/Wikia/app/forks","keys_url":"https://api.github.com/repos/Wikia/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/app/teams","hooks_url":"https://api.github.com/repos/Wikia/app/hooks","issue_events_url":"https://api.github.com/repos/Wikia/app/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/app/events","assignees_url":"https://api.github.com/repos/Wikia/app/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/app/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/app/tags","blobs_url":"https://api.github.com/repos/Wikia/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/app/languages","stargazers_url":"https://api.github.com/repos/Wikia/app/stargazers","contributors_url":"https://api.github.com/repos/Wikia/app/contributors","subscribers_url":"https://api.github.com/repos/Wikia/app/subscribers","subscription_url":"https://api.github.com/repos/Wikia/app/subscription","commits_url":"https://api.github.com/repos/Wikia/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/app/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/app/merges","archive_url":"https://api.github.com/repos/Wikia/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/app/downloads","issues_url":"https://api.github.com/repos/Wikia/app/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/app/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/app/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/app/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/app/releases{/id}","deployments_url":"https://api.github.com/repos/Wikia/app/deployments","created_at":"2012-08-23T20:55:58Z","updated_at":"2016-12-03T22:51:32Z","pushed_at":"2016-12-29T08:52:47Z","git_url":"git://github.com/Wikia/app.git","ssh_url":"git@github.com:Wikia/app.git","clone_url":"https://github.com/Wikia/app.git","svn_url":"https://github.com/Wikia/app","homepage":"http://dev.wikia.com","size":722093,"stargazers_count":107,"watchers_count":107,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":86,"mirror_url":null,"open_issues_count":120,"forks":86,"open_issues":120,"watchers":107,"default_branch":"dev"}},"base":{"label":"Wikia:dev","ref":"dev","sha":"1f648964165004e34a3904b1c78096073ded71a8","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":5532313,"name":"app","full_name":"Wikia/app","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/app","description":"Wikia Application Code","fork":false,"url":"https://api.github.com/repos/Wikia/app","forks_url":"https://api.github.com/repos/Wikia/app/forks","keys_url":"https://api.github.com/repos/Wikia/app/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/app/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/app/teams","hooks_url":"https://api.github.com/repos/Wikia/app/hooks","issue_events_url":"https://api.github.com/repos/Wikia/app/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/app/events","assignees_url":"https://api.github.com/repos/Wikia/app/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/app/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/app/tags","blobs_url":"https://api.github.com/repos/Wikia/app/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/app/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/app/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/app/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/app/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/app/languages","stargazers_url":"https://api.github.com/repos/Wikia/app/stargazers","contributors_url":"https://api.github.com/repos/Wikia/app/contributors","subscribers_url":"https://api.github.com/repos/Wikia/app/subscribers","subscription_url":"https://api.github.com/repos/Wikia/app/subscription","commits_url":"https://api.github.com/repos/Wikia/app/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/app/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/app/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/app/issues/comments{/number}","contents_url":"https://api.github.com/repos/Wikia/app/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/app/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/app/merges","archive_url":"https://api.github.com/repos/Wikia/app/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/app/downloads","issues_url":"https://api.github.com/repos/Wikia/app/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/app/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/app/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/app/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/app/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/app/releases{/id}","deployments_url":"https://api.github.com/repos/Wikia/app/deployments","created_at":"2012-08-23T20:55:58Z","updated_at":"2016-12-03T22:51:32Z","pushed_at":"2016-12-29T08:52:47Z","git_url":"git://github.com/Wikia/app.git","ssh_url":"git@github.com:Wikia/app.git","clone_url":"https://github.com/Wikia/app.git","svn_url":"https://github.com/Wikia/app","homepage":"http://dev.wikia.com","size":722093,"stargazers_count":107,"watchers_count":107,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":86,"mirror_url":null,"open_issues_count":120,"forks":86,"open_issues":120,"watchers":107,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/app/pulls/12144"},"html":{"href":"https://github.com/Wikia/app/pull/12144"},"issue":{"href":"https://api.github.com/repos/Wikia/app/issues/12144"},"comments":{"href":"https://api.github.com/repos/Wikia/app/issues/12144/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/app/pulls/12144/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/app/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Wikia/app/pulls/12144/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/app/statuses/8fde85f70062a9b094002305d37360e639969b53"}}}}
{"actor":{"display_login":"WikiaTech"}}