diff --git a/core/modules/field/src/Tests/String/StringFieldTest.php b/core/modules/field/src/Tests/String/StringFieldTest.php index f9a6df2..8b499f2 100644 --- a/core/modules/field/src/Tests/String/StringFieldTest.php +++ b/core/modules/field/src/Tests/String/StringFieldTest.php @@ -33,13 +33,16 @@ class StringFieldTest extends WebTestBase { */ public static $modules = array('entity_test'); - protected $web_user; + /** + * A user without any special permissions. + */ + protected $webUser; protected function setUp() { parent::setUp(); - $this->web_user = $this->drupalCreateUser(array('view test entity', 'administer entity_test content')); - $this->drupalLogin($this->web_user); + $this->webUser = $this->drupalCreateUser(array('view test entity', 'administer entity_test content')); + $this->drupalLogin($this->webUser); } // Test fields. diff --git a/core/modules/text/src/Tests/TextFieldTest.php b/core/modules/text/src/Tests/TextFieldTest.php index 515097a..abf861b 100644 --- a/core/modules/text/src/Tests/TextFieldTest.php +++ b/core/modules/text/src/Tests/TextFieldTest.php @@ -18,12 +18,15 @@ */ class TextFieldTest extends StringFieldTest { - protected $admin_user; + /** + * A user with relevant administrative privileges. + */ + protected $adminUser; protected function setUp() { parent::setUp(); - $this->admin_user = $this->drupalCreateUser(array('administer filters')); + $this->adminUser = $this->drupalCreateUser(array('administer filters')); } // Test fields. @@ -106,13 +109,13 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) { ->save(); // Disable all text formats besides the plain text fallback format. - $this->drupalLogin($this->admin_user); + $this->drupalLogin($this->adminUser); foreach (filter_formats() as $format) { if (!$format->isFallbackFormat()) { $this->drupalPostForm('admin/config/content/formats/manage/' . $format->format . '/disable', array(), t('Disable')); } } - $this->drupalLogin($this->web_user); + $this->drupalLogin($this->webUser); // Display the creation form. Since the user only has access to one format, // no format selector will be displayed. @@ -140,7 +143,7 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) { // Create a new text format that does not escape HTML, and grant the user // access to it. - $this->drupalLogin($this->admin_user); + $this->drupalLogin($this->adminUser); $edit = array( 'format' => Unicode::strtolower($this->randomMachineName()), 'name' => $this->randomMachineName(), @@ -150,10 +153,10 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) { $format = entity_load('filter_format', $edit['format']); $format_id = $format->format; $permission = $format->getPermissionName(); - $roles = $this->web_user->getRoles(); + $roles = $this->webUser->getRoles(); $rid = $roles[0]; user_role_grant_permissions($rid, array($permission)); - $this->drupalLogin($this->web_user); + $this->drupalLogin($this->webUser); // Display edition form. // We should now have a 'text format' selector.