{"action":"created","comment":{"url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/comments/46148799","id":46148799,"diff_hunk":"@@ -0,0 +1,90 @@\n+<?php\n+namespace Tribe\\Events\\Admin\\Bar;\n+\n+use Pimple\\Container;\n+use Tribe__Events__Admin__Bar__Admin_Bar as Admin_Bar;\n+use Tribe__Events__Constants as Constants;\n+\n+class Admin_BarTest extends \\Codeception\\TestCase\\WPTestCase {\n+\n+\tprotected $backupGlobals = false;\n+\n+\tpublic function setUp() {\n+\t\t// before\n+\t\tparent::setUp();\n+\n+\t\t// your set up methods here\n+\t}\n+\n+\tpublic function tearDown() {\n+\t\t// your tear down methods here\n+\n+\t\t// then\n+\t\tparent::tearDown();\n+\t}\n+\n+\t/**\n+\t * @test\n+\t * it should return admin bar disabled if constant set\n+\t */\n+\tpublic function it_should_return_admin_bar_disabled_if_constant_set() {\n+\t\t$constants                                = new Constants( true );\n+\t\t$constants['TRIBE_DISABLE_TOOLBAR_ITEMS'] = true;\n+\n+\t\t$sut = new Admin_Bar( null, $constants );\n+\n+\t\t$this->assertFalse( $sut->is_enabled() );\n+\t}\n+\n+\t/**\n+\t * @test\n+\t * it should return admin bar disabled if is network admin\n+\t */\n+\tpublic function it_should_return_admin_bar_disabled_if_is_network_admin() {\n+\t\t// cannot do this... final class...\n+\t\t// $screen = $this->prophesize( '\\WP_Screen' );\n+\t\t// $screen->in_admin( 'network' )->willReturn( true );\n+\t\t// $GLOBALS['current_screen'] = $screen->reveal();\n+\n+\t\t// so we mock the screnn object the 1995 way\n+\t\t$GLOBALS['current_screen'] = new Dummy_WP_Screen( true );\n+\n+\t\t$sut = new Admin_Bar();\n+\n+\t\t$this->assertFalse( $sut->is_enabled() );\n+\t}\n+\n+\t/**\n+\t * @test\n+\t * it should configure the admin bar\n+\t */\n+\tpublic function it_should_configure_the_admin_bar() {\n+\t\t$constants    = new Constants( true );\n+\t\t$configurator = $this->prophesize( 'Tribe__Events__Admin__Bar__Configurator_Interface' );\n+\t\t$admin_bar    = $this->getMockBuilder( 'WP_Admin_Bar' )->disableOriginalConstructor()->getMock();\n+\t\t$configurator->configure( $admin_bar )->willReturn( true );\n+\n+\t\t$sut = new Admin_Bar( $configurator->reveal(), $constants );\n+\t\t$sut->init( $admin_bar );\n+\n+\t\t$configurator->configure( $admin_bar )->shouldHaveBeenCalled();\n+\t}\n+}\n+\n+\n+class Dummy_WP_Screen {","path":"tests/functional/Tribe/Events/Admin/Bar/Admin_BarTest.php","position":75,"original_position":75,"commit_id":"7f0534e47825f0e8cfa11d5240e95cc06b6a56a3","original_commit_id":"7f0534e47825f0e8cfa11d5240e95cc06b6a56a3","user":{"login":"borkweb","id":430385,"avatar_url":"https://avatars.githubusercontent.com/u/430385?v=3","gravatar_id":"","url":"https://api.github.com/users/borkweb","html_url":"https://github.com/borkweb","followers_url":"https://api.github.com/users/borkweb/followers","following_url":"https://api.github.com/users/borkweb/following{/other_user}","gists_url":"https://api.github.com/users/borkweb/gists{/gist_id}","starred_url":"https://api.github.com/users/borkweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borkweb/subscriptions","organizations_url":"https://api.github.com/users/borkweb/orgs","repos_url":"https://api.github.com/users/borkweb/repos","events_url":"https://api.github.com/users/borkweb/events{/privacy}","received_events_url":"https://api.github.com/users/borkweb/received_events","type":"User","site_admin":false},"body":"I mean, I can see why that feels silly. But nestling it next to another class is also kind of wonky.","created_at":"2015-11-30T14:31:42Z","updated_at":"2015-11-30T14:31:42Z","html_url":"https://github.com/moderntribe/the-events-calendar/pull/462#discussion_r46148799","pull_request_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/462","_links":{"self":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/comments/46148799"},"html":{"href":"https://github.com/moderntribe/the-events-calendar/pull/462#discussion_r46148799"},"pull_request":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/462"}}},"pull_request":{"url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/462","id":52007471,"html_url":"https://github.com/moderntribe/the-events-calendar/pull/462","diff_url":"https://github.com/moderntribe/the-events-calendar/pull/462.diff","patch_url":"https://github.com/moderntribe/the-events-calendar/pull/462.patch","issue_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/462","number":462,"state":"open","locked":false,"title":"fixed issue and refactored admin bar code","user":{"login":"lucatume","id":2749650,"avatar_url":"https://avatars.githubusercontent.com/u/2749650?v=3","gravatar_id":"","url":"https://api.github.com/users/lucatume","html_url":"https://github.com/lucatume","followers_url":"https://api.github.com/users/lucatume/followers","following_url":"https://api.github.com/users/lucatume/following{/other_user}","gists_url":"https://api.github.com/users/lucatume/gists{/gist_id}","starred_url":"https://api.github.com/users/lucatume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucatume/subscriptions","organizations_url":"https://api.github.com/users/lucatume/orgs","repos_url":"https://api.github.com/users/lucatume/repos","events_url":"https://api.github.com/users/lucatume/events{/privacy}","received_events_url":"https://api.github.com/users/lucatume/received_events","type":"User","site_admin":false},"body":"Ticket https://central.tri.be/issues/41021\r\nI've fixed the issue and refactored (with tests) admin bar related code out of Main.","created_at":"2015-11-27T15:51:24Z","updated_at":"2015-11-30T14:31:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77f8024a69867062cd54eff3fe524939cbcf90ad","assignee":{"login":"lucatume","id":2749650,"avatar_url":"https://avatars.githubusercontent.com/u/2749650?v=3","gravatar_id":"","url":"https://api.github.com/users/lucatume","html_url":"https://github.com/lucatume","followers_url":"https://api.github.com/users/lucatume/followers","following_url":"https://api.github.com/users/lucatume/following{/other_user}","gists_url":"https://api.github.com/users/lucatume/gists{/gist_id}","starred_url":"https://api.github.com/users/lucatume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucatume/subscriptions","organizations_url":"https://api.github.com/users/lucatume/orgs","repos_url":"https://api.github.com/users/lucatume/repos","events_url":"https://api.github.com/users/lucatume/events{/privacy}","received_events_url":"https://api.github.com/users/lucatume/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/462/commits","review_comments_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/462/comments","review_comment_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/comments{/number}","comments_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/462/comments","statuses_url":"https://api.github.com/repos/moderntribe/the-events-calendar/statuses/7f0534e47825f0e8cfa11d5240e95cc06b6a56a3","head":{"label":"moderntribe:bugfix/41021-csv-importer-link","ref":"bugfix/41021-csv-importer-link","sha":"7f0534e47825f0e8cfa11d5240e95cc06b6a56a3","user":{"login":"moderntribe","id":2279551,"avatar_url":"https://avatars.githubusercontent.com/u/2279551?v=3","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"repo":{"id":16366134,"name":"the-events-calendar","full_name":"moderntribe/the-events-calendar","owner":{"login":"moderntribe","id":2279551,"avatar_url":"https://avatars.githubusercontent.com/u/2279551?v=3","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moderntribe/the-events-calendar","description":"The Events Calendar WordPress plugin by Modern Tribe","fork":false,"url":"https://api.github.com/repos/moderntribe/the-events-calendar","forks_url":"https://api.github.com/repos/moderntribe/the-events-calendar/forks","keys_url":"https://api.github.com/repos/moderntribe/the-events-calendar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moderntribe/the-events-calendar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moderntribe/the-events-calendar/teams","hooks_url":"https://api.github.com/repos/moderntribe/the-events-calendar/hooks","issue_events_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/events{/number}","events_url":"https://api.github.com/repos/moderntribe/the-events-calendar/events","assignees_url":"https://api.github.com/repos/moderntribe/the-events-calendar/assignees{/user}","branches_url":"https://api.github.com/repos/moderntribe/the-events-calendar/branches{/branch}","tags_url":"https://api.github.com/repos/moderntribe/the-events-calendar/tags","blobs_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/refs{/sha}","trees_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moderntribe/the-events-calendar/statuses/{sha}","languages_url":"https://api.github.com/repos/moderntribe/the-events-calendar/languages","stargazers_url":"https://api.github.com/repos/moderntribe/the-events-calendar/stargazers","contributors_url":"https://api.github.com/repos/moderntribe/the-events-calendar/contributors","subscribers_url":"https://api.github.com/repos/moderntribe/the-events-calendar/subscribers","subscription_url":"https://api.github.com/repos/moderntribe/the-events-calendar/subscription","commits_url":"https://api.github.com/repos/moderntribe/the-events-calendar/commits{/sha}","git_commits_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/commits{/sha}","comments_url":"https://api.github.com/repos/moderntribe/the-events-calendar/comments{/number}","issue_comment_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/comments{/number}","contents_url":"https://api.github.com/repos/moderntribe/the-events-calendar/contents/{+path}","compare_url":"https://api.github.com/repos/moderntribe/the-events-calendar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moderntribe/the-events-calendar/merges","archive_url":"https://api.github.com/repos/moderntribe/the-events-calendar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moderntribe/the-events-calendar/downloads","issues_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues{/number}","pulls_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls{/number}","milestones_url":"https://api.github.com/repos/moderntribe/the-events-calendar/milestones{/number}","notifications_url":"https://api.github.com/repos/moderntribe/the-events-calendar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moderntribe/the-events-calendar/labels{/name}","releases_url":"https://api.github.com/repos/moderntribe/the-events-calendar/releases{/id}","created_at":"2014-01-30T02:17:01Z","updated_at":"2015-11-25T07:26:31Z","pushed_at":"2015-11-30T14:04:53Z","git_url":"git://github.com/moderntribe/the-events-calendar.git","ssh_url":"git@github.com:moderntribe/the-events-calendar.git","clone_url":"https://github.com/moderntribe/the-events-calendar.git","svn_url":"https://github.com/moderntribe/the-events-calendar","homepage":null,"size":59566,"stargazers_count":73,"watchers_count":73,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":6,"forks":70,"open_issues":6,"watchers":73,"default_branch":"release/121.1"}},"base":{"label":"moderntribe:release/121.1","ref":"release/121.1","sha":"b1d055d53df7275d576f0f1ac6ff904556dfcd92","user":{"login":"moderntribe","id":2279551,"avatar_url":"https://avatars.githubusercontent.com/u/2279551?v=3","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"repo":{"id":16366134,"name":"the-events-calendar","full_name":"moderntribe/the-events-calendar","owner":{"login":"moderntribe","id":2279551,"avatar_url":"https://avatars.githubusercontent.com/u/2279551?v=3","gravatar_id":"","url":"https://api.github.com/users/moderntribe","html_url":"https://github.com/moderntribe","followers_url":"https://api.github.com/users/moderntribe/followers","following_url":"https://api.github.com/users/moderntribe/following{/other_user}","gists_url":"https://api.github.com/users/moderntribe/gists{/gist_id}","starred_url":"https://api.github.com/users/moderntribe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moderntribe/subscriptions","organizations_url":"https://api.github.com/users/moderntribe/orgs","repos_url":"https://api.github.com/users/moderntribe/repos","events_url":"https://api.github.com/users/moderntribe/events{/privacy}","received_events_url":"https://api.github.com/users/moderntribe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/moderntribe/the-events-calendar","description":"The Events Calendar WordPress plugin by Modern Tribe","fork":false,"url":"https://api.github.com/repos/moderntribe/the-events-calendar","forks_url":"https://api.github.com/repos/moderntribe/the-events-calendar/forks","keys_url":"https://api.github.com/repos/moderntribe/the-events-calendar/keys{/key_id}","collaborators_url":"https://api.github.com/repos/moderntribe/the-events-calendar/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/moderntribe/the-events-calendar/teams","hooks_url":"https://api.github.com/repos/moderntribe/the-events-calendar/hooks","issue_events_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/events{/number}","events_url":"https://api.github.com/repos/moderntribe/the-events-calendar/events","assignees_url":"https://api.github.com/repos/moderntribe/the-events-calendar/assignees{/user}","branches_url":"https://api.github.com/repos/moderntribe/the-events-calendar/branches{/branch}","tags_url":"https://api.github.com/repos/moderntribe/the-events-calendar/tags","blobs_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/refs{/sha}","trees_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/trees{/sha}","statuses_url":"https://api.github.com/repos/moderntribe/the-events-calendar/statuses/{sha}","languages_url":"https://api.github.com/repos/moderntribe/the-events-calendar/languages","stargazers_url":"https://api.github.com/repos/moderntribe/the-events-calendar/stargazers","contributors_url":"https://api.github.com/repos/moderntribe/the-events-calendar/contributors","subscribers_url":"https://api.github.com/repos/moderntribe/the-events-calendar/subscribers","subscription_url":"https://api.github.com/repos/moderntribe/the-events-calendar/subscription","commits_url":"https://api.github.com/repos/moderntribe/the-events-calendar/commits{/sha}","git_commits_url":"https://api.github.com/repos/moderntribe/the-events-calendar/git/commits{/sha}","comments_url":"https://api.github.com/repos/moderntribe/the-events-calendar/comments{/number}","issue_comment_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/comments{/number}","contents_url":"https://api.github.com/repos/moderntribe/the-events-calendar/contents/{+path}","compare_url":"https://api.github.com/repos/moderntribe/the-events-calendar/compare/{base}...{head}","merges_url":"https://api.github.com/repos/moderntribe/the-events-calendar/merges","archive_url":"https://api.github.com/repos/moderntribe/the-events-calendar/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/moderntribe/the-events-calendar/downloads","issues_url":"https://api.github.com/repos/moderntribe/the-events-calendar/issues{/number}","pulls_url":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls{/number}","milestones_url":"https://api.github.com/repos/moderntribe/the-events-calendar/milestones{/number}","notifications_url":"https://api.github.com/repos/moderntribe/the-events-calendar/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/moderntribe/the-events-calendar/labels{/name}","releases_url":"https://api.github.com/repos/moderntribe/the-events-calendar/releases{/id}","created_at":"2014-01-30T02:17:01Z","updated_at":"2015-11-25T07:26:31Z","pushed_at":"2015-11-30T14:04:53Z","git_url":"git://github.com/moderntribe/the-events-calendar.git","ssh_url":"git@github.com:moderntribe/the-events-calendar.git","clone_url":"https://github.com/moderntribe/the-events-calendar.git","svn_url":"https://github.com/moderntribe/the-events-calendar","homepage":null,"size":59566,"stargazers_count":73,"watchers_count":73,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":6,"forks":70,"open_issues":6,"watchers":73,"default_branch":"release/121.1"}},"_links":{"self":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/462"},"html":{"href":"https://github.com/moderntribe/the-events-calendar/pull/462"},"issue":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/462"},"comments":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/issues/462/comments"},"review_comments":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/462/comments"},"review_comment":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/pulls/462/commits"},"statuses":{"href":"https://api.github.com/repos/moderntribe/the-events-calendar/statuses/7f0534e47825f0e8cfa11d5240e95cc06b6a56a3"}}}}