{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/25601","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/25601/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/25601/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/25601/events","html_url":"https://github.com/laravel/framework/issues/25601","id":359724373,"node_id":"MDU6SXNzdWUzNTk3MjQzNzM=","number":25601,"title":"Illuminate\\Foundation\\Testing\\TestCase has limitation in testing request headers ","user":{"login":"scil","id":2786775,"node_id":"MDQ6VXNlcjI3ODY3NzU=","avatar_url":"https://avatars2.githubusercontent.com/u/2786775?v=4","gravatar_id":"","url":"https://api.github.com/users/scil","html_url":"https://github.com/scil","followers_url":"https://api.github.com/users/scil/followers","following_url":"https://api.github.com/users/scil/following{/other_user}","gists_url":"https://api.github.com/users/scil/gists{/gist_id}","starred_url":"https://api.github.com/users/scil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scil/subscriptions","organizations_url":"https://api.github.com/users/scil/orgs","repos_url":"https://api.github.com/users/scil/repos","events_url":"https://api.github.com/users/scil/events{/privacy}","received_events_url":"https://api.github.com/users/scil/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-13T03:00:54Z","updated_at":"2018-09-14T19:18:37Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"- Laravel Version: 5.6.28\r\n- PHP Version: 7.2\r\n\r\n### Description:\r\n\r\nIlluminate\\Foundation\\Testing\\TestCase would make an application and then  include web.php (by \\App\\Providers\\RouteServiceProvider), and at last phpunit call `MakesHttpRequests::call()` where request headers can not come from test functions.\r\n\r\n\r\n### Steps To Reproduce:\r\n\r\n1. ` artisan make:test HeaderTest`\r\n\r\n2. make this test function\r\n```\r\n    public function testNoLocale()\r\n    {\r\n        $lang = 'zh';\r\n\r\n        $response = $this->withHeaders(\r\n           ['Accept-Language' => $lang,]\r\n        )->get('/loc');\r\n       \r\n       $response->assertSeeText($lang);\r\n     }\r\n\r\n```\r\n\r\n3. edit `routes/web.php`\r\n```\r\n    $locale = $_SERVER['HTTP_ACCEPT_LANGUAGE'];\r\n    Route::group(['prefix' => $locale,], function() use ($locale) {\r\n               Route::get('/loc', function() use ($locale){\r\n                   return return $locale;\r\n                });\r\n    });\r\n\r\n```\r\n\r\n4. `vendor/bin/phpunit  --stop-on-failure    --filter  HeaderTest `\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/421458621","html_url":"https://github.com/laravel/framework/issues/25601#issuecomment-421458621","issue_url":"https://api.github.com/repos/laravel/framework/issues/25601","id":421458621,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTQ1ODYyMQ==","user":{"login":"X-Coder264","id":12602463,"node_id":"MDQ6VXNlcjEyNjAyNDYz","avatar_url":"https://avatars2.githubusercontent.com/u/12602463?v=4","gravatar_id":"","url":"https://api.github.com/users/X-Coder264","html_url":"https://github.com/X-Coder264","followers_url":"https://api.github.com/users/X-Coder264/followers","following_url":"https://api.github.com/users/X-Coder264/following{/other_user}","gists_url":"https://api.github.com/users/X-Coder264/gists{/gist_id}","starred_url":"https://api.github.com/users/X-Coder264/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/X-Coder264/subscriptions","organizations_url":"https://api.github.com/users/X-Coder264/orgs","repos_url":"https://api.github.com/users/X-Coder264/repos","events_url":"https://api.github.com/users/X-Coder264/events{/privacy}","received_events_url":"https://api.github.com/users/X-Coder264/received_events","type":"User","site_admin":false},"created_at":"2018-09-14T19:18:37Z","updated_at":"2018-09-14T19:18:37Z","author_association":"CONTRIBUTOR","body":"Yeah, that package is also using the request object (just like my example above) and not the PHP superglobal so I don't understand what are you trying to say."}}
{"actor":{"display_login":"X-Coder264"}}