{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/18121","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/18121/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/18121/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/18121/events","html_url":"https://github.com/laravel/framework/issues/18121","id":210272391,"number":18121,"title":"Running Unit Tests with PHPDBG","user":{"login":"REBELinBLUE","id":2143908,"avatar_url":"https://avatars1.githubusercontent.com/u/2143908?v=4","gravatar_id":"","url":"https://api.github.com/users/REBELinBLUE","html_url":"https://github.com/REBELinBLUE","followers_url":"https://api.github.com/users/REBELinBLUE/followers","following_url":"https://api.github.com/users/REBELinBLUE/following{/other_user}","gists_url":"https://api.github.com/users/REBELinBLUE/gists{/gist_id}","starred_url":"https://api.github.com/users/REBELinBLUE/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/REBELinBLUE/subscriptions","organizations_url":"https://api.github.com/users/REBELinBLUE/orgs","repos_url":"https://api.github.com/users/REBELinBLUE/repos","events_url":"https://api.github.com/users/REBELinBLUE/events{/privacy}","received_events_url":"https://api.github.com/users/REBELinBLUE/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-02-26T00:13:12Z","updated_at":"2018-03-05T23:16:16Z","closed_at":"2017-03-03T10:57:33Z","author_association":"CONTRIBUTOR","body":"- Laravel Version:  5.4.13\r\n- PHP Version: 7.0.15\r\n- Database Driver & Version: N/A\r\n\r\n### Description:\r\n\r\nIf you use phpdbg to generate code coverage instead of xdebug you can't test code which triggers the VerifyCsrfToken code.\r\n\r\nIt will fail with\r\n\r\n```json\r\n{\"error\":{\"type\":\"Illuminate\\\\Session\\\\TokenMismatchException\",\"message\":\"\",\"file\":\"\\/path\\/to\\/project\\/vendor\\/laravel\\/framework\\/src\\/Illuminate\\/Foundation\\/Http\\/Middleware\\/VerifyCsrfToken.php\",\"line\":68}}\r\n```\r\n\r\nThis is because in the `runningUnitTests` method it uses the `runningInConsole` method of the Application, which checks that the php_sapi_name is `cli` but when using phpdbg it is `phpdbg`\r\n\r\n### Steps To Reproduce:\r\n\r\nTest a controller which uses the CSRF middleware\r\n\r\n`$ phpdbg -qrr vendor/bin/phpunit --no-coverage tests/Features/MyControllerTest.php`"},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/370602242","html_url":"https://github.com/laravel/framework/issues/18121#issuecomment-370602242","issue_url":"https://api.github.com/repos/laravel/framework/issues/18121","id":370602242,"user":{"login":"courtney-miles","id":2454544,"avatar_url":"https://avatars0.githubusercontent.com/u/2454544?v=4","gravatar_id":"","url":"https://api.github.com/users/courtney-miles","html_url":"https://github.com/courtney-miles","followers_url":"https://api.github.com/users/courtney-miles/followers","following_url":"https://api.github.com/users/courtney-miles/following{/other_user}","gists_url":"https://api.github.com/users/courtney-miles/gists{/gist_id}","starred_url":"https://api.github.com/users/courtney-miles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/courtney-miles/subscriptions","organizations_url":"https://api.github.com/users/courtney-miles/orgs","repos_url":"https://api.github.com/users/courtney-miles/repos","events_url":"https://api.github.com/users/courtney-miles/events{/privacy}","received_events_url":"https://api.github.com/users/courtney-miles/received_events","type":"User","site_admin":false},"created_at":"2018-03-05T23:16:16Z","updated_at":"2018-03-05T23:16:16Z","author_association":"NONE","body":"> See the second comment, if you do that code coverage is then not collected\r\n\r\nAh, I had misunderstood what was being pointed out in the second comment.\r\n\r\nThanks for taking the time to clarify."}}
{"actor":{"display_login":"courtney-miles"}}