I have a class the consumes the Request
facade.
...
$context = [
'ip_address' => Request::ip(),
'user' => Auth::check() ? Auth::id() : 'system',
'uri' => Request::getRequestUri() ?: '',
];
...
When writing the test for it, it complains about the setUserResolver even though it isn’t being called.
MockeryExceptionBadMethodCallException: Received Mockery_3_Illuminate_Http_Request::setUserResolver(), but no expectations were specified
Test case;
...
IlluminateSupportFacadesRequest::shouldReceive('ip')->once()->andReturn('127.0.0.1');
IlluminateSupportFacadesRequest::shouldReceive('getRequestUri')->once()->andReturn('http://localhost/testing');
...
I have tried making it a partial, IlluminateSupportFacadesRequest::partialMock();
but that doesn’t work to work either.