New issue

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

[5.7] causes problem when we write unit-test in `cache('foo')` #25492

merged 1 commit into from Sep 7, 2018


None yet
2 participants

klack710 commented Sep 6, 2018

There is absolutely no practical difference between facades and helper functions. When using helper functions, you may still test them exactly as you would the corresponding facade.

The above statement is incorrect in regards to cache('foo')

public function testBasicExample()


This sample code can’t work because cache method changes parameters.

When we call cache('foo'), this method call Cache::get('foo', null). So it causes problem when we write unit-test.

@GrahamCampbell GrahamCampbell changed the title from causes problem when we write unit-test in `cache('foo')` to [5.7] causes problem when we write unit-test in `cache('foo')` Sep 6, 2018

@taylorotwell taylorotwell merged commit 757d3c7 into laravel:5.7 Sep 7, 2018

2 checks passed

continuous-integration/styleci/pr The analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment