Commit 52b84492 authored by catch's avatar catch

Issue #2185315 by justafish, InternetDevels: Remove deprecated drupal_anonymous_user() function.

parent 5dc22c73
......@@ -1242,20 +1242,6 @@ function drupal_get_messages($type = NULL, $clear_queue = TRUE) {
return array();
}
/**
* Generates a default anonymous $user object.
*
* @return \Drupal\Core\Session\AccountInterface
* The user session object.
*
* @deprecated in Drupal 8.x-dev. Will be removed before Drupal 8.0 by
* https://drupal.org/node/2185315. Use
* \Drupal\Core\Session\AnonymousUserSession.
*/
function drupal_anonymous_user() {
return new AnonymousUserSession();
}
/**
* Ensures Drupal is bootstrapped to the specified phase.
*
......
......@@ -286,7 +286,7 @@ protected function drupalCreateNode(array $settings = array()) {
$settings['uid'] = $this->loggedInUser->id();
}
else {
$user = \Drupal::currentUser() ?: drupal_anonymous_user();
$user = \Drupal::currentUser() ?: new AnonymousUserSession();
$settings['uid'] = $user->id();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment