Bumped into a problem while trying to authorize user against laravel basic auth middleware when testing a REST API through phpunit. I used phpunit call method to send a POST request to API's endpoint which needed users basic HTTP authentication.
Every time, laravels basic auth middleware rejected it and I had no idea why, since I've sent proper HTTP Authorization header with phpunit call. Here is the solution !
Or watch it in a video https://www.youtube.com/watch?v=LCrt7jqDsgU
Read more on http://laravel.io/forum/03-20-2014-authbasic-fails