We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The code from the 5.1 docs to mock the Cache facade doesn't work: http://laravel.com/docs/5.1/testing#mocking-facades
5.1
Cache
Cache::shouldReceive('get') ->once() ->with('key') ->andReturn('value');
Error:
InvalidArgumentException: get() cannot be mocked as it a protected method and mocking protected methods is not allowed for this mock
Should this be fixed, or removed from the docs?
The text was updated successfully, but these errors were encountered:
Does this work?
Cache::shouldReceive('driver->get') ->once() ->with('key') ->andReturn('value');
Sorry, something went wrong.
Throws:
BadMethodCallException: Method Mockery_0_Illuminate_Cache_CacheManager::tags() does not exist on this mock object
If I alter the code to:
Cache::shouldReceive('driver->get') ->once() ->tags('tag') ->with('key') ->andReturn('value');
It throws:
ErrorException: call_user_func_array() expects parameter 1 to be a valid callback, class 'Mockery\Expectation' does not have a method 'tags'
@GrahamCampbell So is this a bug, or should it be removed from the docs?
Cache::get()
No branches or pull requests
The code from the
5.1
docs to mock theCache
facade doesn't work: http://laravel.com/docs/5.1/testing#mocking-facadesError:
Should this be fixed, or removed from the docs?
The text was updated successfully, but these errors were encountered: