diff --git a/lightning.profile b/lightning.profile index b58c3e81d..ce90d7ce7 100644 --- a/lightning.profile +++ b/lightning.profile @@ -8,6 +8,7 @@ use Drupal\lightning_core\ConfigHelper as Config; use Drupal\node\Entity\NodeType; use Drupal\user\RoleInterface; +use Drupal\user\Entity\User; /** * Implements hook_install_tasks(). @@ -31,7 +32,7 @@ function lightning_install_tasks() { */ function lightning_prepare_administrator() { /** @var \Drupal\user\UserInterface $account */ - $account = entity_load('user', 1); + $account = User::load(1); if ($account) { $account->addRole('administrator'); $account->save(); diff --git a/tests/src/Functional/ConfigIntegrityTest.php b/tests/src/Functional/ConfigIntegrityTest.php index e21dd8d01..cc05554ed 100644 --- a/tests/src/Functional/ConfigIntegrityTest.php +++ b/tests/src/Functional/ConfigIntegrityTest.php @@ -5,6 +5,7 @@ use Drupal\Core\Entity\Entity\EntityViewMode; use Drupal\Tests\BrowserTestBase; use Drupal\user\Entity\Role; +use Drupal\user\Entity\User; use Drupal\user\UserInterface; use Drupal\workflows\Entity\Workflow; @@ -36,7 +37,7 @@ public function testConfig() { // Assert that all install tasks have done what they should do. // @see lightning_install_tasks() - $account = entity_load('user', 1); + $account = User::load( 1); $this->assertInstanceOf(UserInterface::class, $account); /** @var UserInterface $account */ $this->assertTrue($account->hasRole('administrator'));