-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Closed
Description
- Laravel Version: 5.4.13
- PHP Version: 7.0.15
- Database Driver & Version: N/A
Description:
If you use phpdbg to generate code coverage instead of xdebug you can't test code which triggers the VerifyCsrfToken code.
It will fail with
{"error":{"type":"Illuminate\\Session\\TokenMismatchException","message":"","file":"\/path\/to\/project\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/Http\/Middleware\/VerifyCsrfToken.php","line":68}}This 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
Steps To Reproduce:
Test a controller which uses the CSRF middleware
$ phpdbg -qrr vendor/bin/phpunit --no-coverage tests/Features/MyControllerTest.php
Metadata
Metadata
Assignees
Labels
No labels