Skip to content
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.8] Fix View contract violations #26754

Merged

Conversation

X-Coder264
Copy link
Contributor

@X-Coder264 X-Coder264 commented Dec 5, 2018

  1. There was no method on the contract to access the view data even though one was obviously needed - this also meant that all the code in the framework which was trying to access the view data was violating the contract (e.g. in TestResponse). The ensureResponseHasView literally checks if $this->original is an instance of the View contract and then after that the data is accessed like this: $this->original->$key (this would obviously break with any other implementation of the contract). Fixing this requires adding the getData method to the contract.

  2. The assertViewIs method in TestResponse was calling the getName method which is not on the contract, while name is and should be used instead as it gives the same result.

@taylorotwell taylorotwell merged commit 73e8807 into laravel:master Dec 6, 2018
@X-Coder264 X-Coder264 deleted the fix-view-contract-violations branch December 6, 2018 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants