-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add a current user service #14
Conversation
drupal_save_session(FALSE); | ||
$GLOBALS['user'] = $admin_user; | ||
|
||
$this->assertEqual(array_keys($admin_user->roles), $account->getRoles()); |
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.
Need to re-get $account from the container before that.
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.
Or better yet check that old $account did not change.
These failures are a consequence of a drupal_ti bug fixed in the add-behat-integration branch. I will pull it tomorrow morning. |
drupal_ti is fixed. |
parent::setUp($modules); | ||
|
||
\ServiceContainer::init(); | ||
$this->container = \Drupal::getContainer(); |
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.
nit - Need to document the $this->container variable.
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.
Fixed, it almost seems to be that we collect a bunch of issues before we can merge them.
1 similar comment
// @see _drupal_session_write() | ||
$sid = session_id(); | ||
if ($this->variable->get('https', FALSE)) { | ||
$insecure_session_name = substr(session_name(), 1); |
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.
This is the wrong way round and gets the insecure session ID from the secure one.
I would prefer if we did throw a BadMethodCallException for now.
It might be that mixed mode SSL is even removed from core.
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.
This should not used by application code anyway. Agreed.
Last issue to fix, then RTBM. |
* {@inheritdoc} | ||
*/ | ||
public function getPreferredAdminLangcode($fallback_to_default = TRUE) { | ||
throw new \Exception(sprintf('%s is not implemented', __FUNCTION__)); |
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.
BadMethodCallException?
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.
Oh right
This needs a rebase, then RTBM. |
…ly test the right one
Beside the rebase I decided to use the new base class in the tests. |
A lot of code is getting the current user to get the uid or simple do some user_access().
Let's implement the 'current_user' service from D8