summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-12-04 11:33:34 (GMT)
committerAlex Pott2014-12-04 11:33:34 (GMT)
commit86ced511f9413ba91c5846a5c121dbda36ff82e8 (patch)
treef5a969e7203eef5b788e0aa9376b6ca5857b5eb4
parent5e83b6c6e340c7d858896c72214a25ed5e68f30e (diff)
Issue #2380411 by areke, hussainweb, GPrince17: Clean-up Text module test members - ensure property definition and use of camelCase naming convention
-rw-r--r--core/modules/field/src/Tests/String/StringFieldTest.php11
-rw-r--r--core/modules/text/src/Tests/TextFieldTest.php19
2 files changed, 20 insertions, 10 deletions
diff --git a/core/modules/field/src/Tests/String/StringFieldTest.php b/core/modules/field/src/Tests/String/StringFieldTest.php
index f9a6df2..625d22c 100644
--- a/core/modules/field/src/Tests/String/StringFieldTest.php
+++ b/core/modules/field/src/Tests/String/StringFieldTest.php
@@ -33,13 +33,18 @@ class StringFieldTest extends WebTestBase {
*/
public static $modules = array('entity_test');
- protected $web_user;
+ /**
+ * A user without any special permissions.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ 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..f47fdd7 100644
--- a/core/modules/text/src/Tests/TextFieldTest.php
+++ b/core/modules/text/src/Tests/TextFieldTest.php
@@ -18,12 +18,17 @@ use Drupal\field\Tests\String\StringFieldTest;
*/
class TextFieldTest extends StringFieldTest {
- protected $admin_user;
+ /**
+ * A user with relevant administrative privileges.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ 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 +111,13 @@ class TextFieldTest extends StringFieldTest {
->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 +145,7 @@ class TextFieldTest extends StringFieldTest {
// 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 +155,10 @@ class TextFieldTest extends StringFieldTest {
$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.