-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
LoggedIn logic is not robust #398
Comments
I think this whole logic should be greatly simplified and should only cover the login functionality of the base themes that are shipped with Drupal core. Themes can override this completely so there is no way for us to cover all possibilities. With the The way this works now is causing every test to slow down by doing unneeded visits to the homepage. |
makes sense.
…On 2 August 2017 at 10:23, Pieter Frenssen ***@***.***> wrote:
I think this whole logic should be greatly simplified and should only
cover the login functionality of the base themes that are shipped with
Drupal core. Themes can override this completely so there is no way for us
to cover all possibilities. With the AuthenticationManager service this
will be trivial to override.
The way this works now is causing every test to slow down by doing
unneeded visits to the homepage.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#398 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADWYQXSyBSInrPOdaUe48kwGi6Mr2Gtoks5sUEAkgaJpZM4OocGE>
.
|
When do you want to do that? For 5.0? |
See also #62, which I created a long time ago and never got around to actually create specific merge requests. |
Currently we do this:
Unknown to me my theme doesn't use the default ID for the login form, so
if (!$page->has('css', $this->getDrupalSelector('login_form_selector')))
returns true and therefore this LoggedIn() function has always found me to be logged in on every page. I only discovered this after I dug into some really weird fails - now I find that the logic of all my existing tests may have been flawed.Let's harden this. How about:
Instead of returning TRUE if the form ID is not found, return FALSE if it is found. This way if the form Id is not properly configured, we don't return a false positive, we just pass on to the next approach.
Before returning FALSE anywhere in this function, call $this->logout(). This increases the chance that the function is telling the truth, even if not for the right reason.
The text was updated successfully, but these errors were encountered: