Skip to content
Snippets Groups Projects
Commit bee3e48d authored by catch's avatar catch
Browse files

Issue #2368081 by Gábor Hojtsy | andypost: Fixed Remove outdated @todo in hook_user_install().

parent 00d9f691
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -8,6 +8,7 @@
namespace Drupal\system\Tests\Installer;
use Drupal\simpletest\InstallerTestBase;
use Drupal\user\Entity\User;
/**
* Selects German as the installation language and verifies the following page
......@@ -51,6 +52,11 @@ public function testInstaller() {
$this->assertUrl('user/1');
$this->assertResponse(200);
$account = User::load(0);
$this->assertEqual($account->language()->getId(), 'de', 'Anonymous user is German.');
$account = User::load(1);
$this->assertEqual($account->language()->getId(), 'de', 'Administrator user is German.');
// Ensure that we can enable basic_auth on a non-english site.
$this->drupalPostForm('admin/modules', array('modules[Web services][basic_auth][enable]' => TRUE), t('Save configuration'));
$this->assertResponse(200);
......
......@@ -65,15 +65,11 @@ function user_schema() {
*/
function user_install() {
$storage = \Drupal::entityManager()->getStorage('user');
// @todo Rely on the default value for langcode in
// https://drupal.org/node/1966436
$langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();
// Insert a row for the anonymous user.
$storage
->create(array(
'uid' => 0,
'status' => 0,
'langcode' => $langcode,
))
->save();
......@@ -85,7 +81,6 @@ function user_install() {
'name' => 'placeholder-for-uid-1',
'mail' => 'placeholder-for-uid-1',
'status' => TRUE,
'langcode' => $langcode,
))
->save();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment