GitHub PullRequestReviewCommentEvent at 2014-05-08 15:25:21
Repository: silverstripe-framework
Actor: dhensby
Payload: {"comment":{"url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/comments/12434568","id":12434568,"diff_hunk":"@@ -0,0 +1,104 @@\n+<?php\n+\n+class CookieTest extends SapphireTest {\n+\n+\tprivate $cookieInst;\n+\n+\tpublic function setUpOnce() {\n+\t\tparent::setUpOnce();\n+\t\tInjector::nest();\n+\t}\n+\n+\tpublic function tearDownOnce() {\n+\t\tparent::tearDownOnce();\n+\t\t//restore the cookie_backend\n+\t\tInjector::unnest();\n+\t}\n+\n+\tpublic function setUp() {\n+\t\tparent::setUp();\n+\t\tInjector::inst()->registerService(new CookieJar($_COOKIE), 'CookieJar');\n+\t}\n+\n+\tpublic function tearDown() {\n+\t\tparent::tearDown();\n+\t\tInjector::inst()->unregisterNamedObject('CookieJar');\n+\t}\n+\n+\t/**\n+\t * Check a new cookie inst will be loaded with the superglobal by default\n+\t */\n+\tpublic function testCheckNewInstTakesSuperglobal() {\n+\t\t//store the superglobal state\n+\t\t$existingCookies = $_COOKIE;\n+\n+\t\t//set a mock state for the superglobal\n+\t\t$_COOKIE = array(\n+\t\t\t'cookie1' => 1,\n+\t\t\t'cookie2' => 'cookies',\n+\t\t\t'cookie3' => 'test',\n+\t\t);\n+\n+\t\tInjector::inst()->unregisterNamedObject('CookieJar');","path":"tests/control/CookieTest.php","position":42,"original_position":42,"commit_id":"d1a66dc798b62a7884e3f7705b7dc12930aa0312","original_commit_id":"d1a66dc798b62a7884e3f7705b7dc12930aa0312","user":{"login":"dhensby","id":563596,"avatar_url":"https://avatars.githubusercontent.com/u/563596?","gravatar_id":"722dc7e195342d79eb47c9a2628676b9","url":"https://api.github.com/users/dhensby","html_url":"https://github.com/dhensby","followers_url":"https://api.github.com/users/dhensby/followers","following_url":"https://api.github.com/users/dhensby/following{/other_user}","gists_url":"https://api.github.com/users/dhensby/gists{/gist_id}","starred_url":"https://api.github.com/users/dhensby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhensby/subscriptions","organizations_url":"https://api.github.com/users/dhensby/orgs","repos_url":"https://api.github.com/users/dhensby/repos","events_url":"https://api.github.com/users/dhensby/events{/privacy}","received_events_url":"https://api.github.com/users/dhensby/received_events","type":"User","site_admin":false},"body":"@ajshort this line doesn't unregister the service. What's the correct way of doing that?","created_at":"2014-05-08T15:25:21Z","updated_at":"2014-05-08T15:25:21Z","html_url":"https://github.com/silverstripe/silverstripe-framework/pull/3098#discussion_r12434568","pull_request_url":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/3098","_links":{"self":{"href":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/comments/12434568"},"html":{"href":"https://github.com/silverstripe/silverstripe-framework/pull/3098#discussion_r12434568"},"pull_request":{"href":"https://api.github.com/repos/silverstripe/silverstripe-framework/pulls/3098"}}}}