Level 2
Figured out, here is the working version in case if someone needs.
<?php
use Illuminate\Http\Response;
class RequestTest extends TestCase {
public $response;
function __construct()
{
$this->response = new Response();
}
public function testHeader()
{
$this->call('POST', '/test',[],[],[], ['HTTP_Authorization' => 'content'],[]);
$foo = $this->response->getContent();
$this->assertEquals('yes',$foo);
}
}
Route::post('/test', function()
{
return \Request::header('Authorization') ? 'yes' : 'no';
});
2 likes

Giving following error:
