Issue #2368081 by Gábor Hojtsy | andypost: Fixed Remove outdated @todo in hook_user_install().
parent
00d9f69102
commit
bee3e48d87
|
@ -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 @@ class InstallerTranslationTest extends InstallerTestBase {
|
|||
$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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue