{"action":"created","issue":{"url":"https://api.github.com/repos/symfony/symfony-docs/issues/8097","repository_url":"https://api.github.com/repos/symfony/symfony-docs","labels_url":"https://api.github.com/repos/symfony/symfony-docs/issues/8097/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony-docs/issues/8097/comments","events_url":"https://api.github.com/repos/symfony/symfony-docs/issues/8097/events","html_url":"https://github.com/symfony/symfony-docs/issues/8097","id":239151368,"number":8097,"title":"Document how to \"integration\" test private services","user":{"login":"weaverryan","id":121003,"avatar_url":"https://avatars1.githubusercontent.com/u/121003?v=4","gravatar_id":"","url":"https://api.github.com/users/weaverryan","html_url":"https://github.com/weaverryan","followers_url":"https://api.github.com/users/weaverryan/followers","following_url":"https://api.github.com/users/weaverryan/following{/other_user}","gists_url":"https://api.github.com/users/weaverryan/gists{/gist_id}","starred_url":"https://api.github.com/users/weaverryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaverryan/subscriptions","organizations_url":"https://api.github.com/users/weaverryan/orgs","repos_url":"https://api.github.com/users/weaverryan/repos","events_url":"https://api.github.com/users/weaverryan/events{/privacy}","received_events_url":"https://api.github.com/users/weaverryan/received_events","type":"User","site_admin":false},"labels":[{"id":32958438,"url":"https://api.github.com/repos/symfony/symfony-docs/labels/DependencyInjection","name":"DependencyInjection","color":"DDDDDD","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/symfony/symfony-docs/milestones/15","html_url":"https://github.com/symfony/symfony-docs/milestone/15","labels_url":"https://api.github.com/repos/symfony/symfony-docs/milestones/15/labels","id":2458689,"number":15,"title":"4.0","description":"","creator":{"login":"javiereguiluz","id":73419,"avatar_url":"https://avatars3.githubusercontent.com/u/73419?v=4","gravatar_id":"","url":"https://api.github.com/users/javiereguiluz","html_url":"https://github.com/javiereguiluz","followers_url":"https://api.github.com/users/javiereguiluz/followers","following_url":"https://api.github.com/users/javiereguiluz/following{/other_user}","gists_url":"https://api.github.com/users/javiereguiluz/gists{/gist_id}","starred_url":"https://api.github.com/users/javiereguiluz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/javiereguiluz/subscriptions","organizations_url":"https://api.github.com/users/javiereguiluz/orgs","repos_url":"https://api.github.com/users/javiereguiluz/repos","events_url":"https://api.github.com/users/javiereguiluz/events{/privacy}","received_events_url":"https://api.github.com/users/javiereguiluz/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":55,"state":"open","created_at":"2017-04-15T17:43:42Z","updated_at":"2017-11-30T20:34:27Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2017-06-28T12:42:22Z","updated_at":"2017-11-30T20:34:49Z","closed_at":null,"author_association":"MEMBER","body":"Question:\r\n\r\n> What if you do container->get() some services in tests.\r\n\r\nAnswer:\r\n\r\n> The proper solution would be to create a public alias for the service you want to test in the test environment only:\r\n\r\n```yml\r\n# app/config/config_test.yml\r\nservices:\r\n    test_alias.AppBundle\\Service\\MyService:\r\n        alias: 'AppBundle\\Service\\MyService'\r\n        public: true # require on SF4, where everything is private by default\r\n```\r\n\r\nThen, you would actually fetch `test_alias.AppBundle\\Service\\MyService` out of the container in your unit test. It's a nice idea too: you only need to expose your service as public in the test environment.\r\n"},"comment":{"url":"https://api.github.com/repos/symfony/symfony-docs/issues/comments/348312921","html_url":"https://github.com/symfony/symfony-docs/issues/8097#issuecomment-348312921","issue_url":"https://api.github.com/repos/symfony/symfony-docs/issues/8097","id":348312921,"user":{"login":"weaverryan","id":121003,"avatar_url":"https://avatars1.githubusercontent.com/u/121003?v=4","gravatar_id":"","url":"https://api.github.com/users/weaverryan","html_url":"https://github.com/weaverryan","followers_url":"https://api.github.com/users/weaverryan/followers","following_url":"https://api.github.com/users/weaverryan/following{/other_user}","gists_url":"https://api.github.com/users/weaverryan/gists{/gist_id}","starred_url":"https://api.github.com/users/weaverryan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaverryan/subscriptions","organizations_url":"https://api.github.com/users/weaverryan/orgs","repos_url":"https://api.github.com/users/weaverryan/repos","events_url":"https://api.github.com/users/weaverryan/events{/privacy}","received_events_url":"https://api.github.com/users/weaverryan/received_events","type":"User","site_admin":false},"created_at":"2017-11-30T20:34:49Z","updated_at":"2017-11-30T20:34:49Z","author_association":"MEMBER","body":"I added this to the 4.0 milestone, so we will remember to do it. But a PR for this should go into 3.3 I believe."}}
{"actor":{"display_login":"weaverryan"}}