-
Notifications
You must be signed in to change notification settings - Fork 287
Remove the dependency on the Session in expectation exceptions #663
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
Conversation
| @@ -204,6 +196,6 @@ public function getOuterHtml() | |||
| */ | |||
| protected function elementNotFound($type, $selector = null, $locator = null) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering whether we should throw exceptions in place now and deprecate this method (this was added in 1.6 just so that our own child classes can avoid using the deprecated Session getter)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this just an internal method that contained some logic before, but not now? If so, then we'd better show exception where needed instead of calling method, that throws them for us. This would also give us shorter stacktrace for that exception.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed. Precisely my point.
there was no logic before, but it allowed to access the session without using the deprecated getter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
c2729cd to
22adbb0
Compare
| { | ||
| $this->session = $session; | ||
| if ($driver instanceof Session) { | ||
| @trigger_error('Passing a Session object to the ExpectationException constructor is deprecated as of Mink 1.7. Pass the driver instead.', E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the point of using error hiding (via @) if we want to trigger an error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see #662
00fa3d9 to
c2ec8e6
Compare
Injecting the Session in exceptions is now deprecated in favor of injecting the driver.
c2ec8e6 to
dbde834
Compare
Remove the dependency on the Session in expectation exceptions
Injecting the Session in exceptions is now deprecated in favor of injecting the driver.
This is a backport of 761bb79 which was done as part of #542 to refactor the driver in 2.0.
Backporting it with a BC layer means we give people instantiating our exception themselves (me at work for instance) an easier upgrade path, because they can prepare things before Mink 2.0.