diff --git a/core/modules/link/src/Tests/LinkFieldTest.php b/core/modules/link/src/Tests/LinkFieldTest.php index 97058f045a893cd8bec7e0978515f6b959ab34e2..945a1cdce8af05290b0f010b1be8420ad411bec5 100644 --- a/core/modules/link/src/Tests/LinkFieldTest.php +++ b/core/modules/link/src/Tests/LinkFieldTest.php @@ -25,7 +25,7 @@ class LinkFieldTest extends WebTestBase { * * @var array */ - public static $modules = array('entity_test', 'link'); + public static $modules = ['entity_test', 'link']; /** * A field to use in this test class. @@ -41,22 +41,14 @@ class LinkFieldTest extends WebTestBase { */ protected $field; - /** - * A user with permission to view and manage test entities. - * - * @var object - */ - protected $web_user; - protected function setUp() { parent::setUp(); - $this->web_user = $this->drupalCreateUser(array( + $this->drupalLogin($this->drupalCreateUser([ 'view test entity', 'administer entity_test content', 'link to any page', - )); - $this->drupalLogin($this->web_user); + ])); } /** diff --git a/core/modules/link/src/Tests/LinkFieldUITest.php b/core/modules/link/src/Tests/LinkFieldUITest.php index 1f7c3c16d271399ac788531f39714e7fade7369f..fd56518fd889fbe4ff864fa99223eab919b8961d 100644 --- a/core/modules/link/src/Tests/LinkFieldUITest.php +++ b/core/modules/link/src/Tests/LinkFieldUITest.php @@ -25,13 +25,12 @@ class LinkFieldUITest extends WebTestBase { * * @var array */ - public static $modules = array('node', 'link', 'field_ui'); + public static $modules = ['node', 'link', 'field_ui']; protected function setUp() { parent::setUp(); - $this->web_user = $this->drupalCreateUser(array('administer content types', 'administer node fields', 'administer node display')); - $this->drupalLogin($this->web_user); + $this->drupalLogin($this->drupalCreateUser(['administer content types', 'administer node fields', 'administer node display'])); } /**