summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2014-12-05 14:05:01 +0000
committerAlex Pott2014-12-05 14:05:01 +0000
commitca3cc9b8be2a76c3cd82ab12bd6b47d91510678d (patch)
tree189a5a3d2b2f91527bb470d3055299dbf202a1bd
parentacd8af476df02aaec2aab28639f9971cc028c408 (diff)
Issue #2381303 by tibbsa, rpayanm, hussainweb, mglaman: Clean-up CKEditor module test members — ensure property definition and use of camelCase naming convention
-rw-r--r--core/modules/ckeditor/src/Tests/CKEditorAdminTest.php13
-rw-r--r--core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php25
2 files changed, 28 insertions, 10 deletions
diff --git a/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php
index c49cf78..d4c1372 100644
--- a/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php
+++ b/core/modules/ckeditor/src/Tests/CKEditorAdminTest.php
@@ -25,6 +25,13 @@ class CKEditorAdminTest extends WebTestBase {
*/
public static $modules = array('filter', 'editor', 'ckeditor');
+ /**
+ * A user with the 'administer filters' permission.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $adminUser;
+
protected function setUp() {
parent::setUp();
@@ -38,7 +45,7 @@ class CKEditorAdminTest extends WebTestBase {
$filtered_html_format->save();
// Create admin user.
- $this->admin_user = $this->drupalCreateUser(array('administer filters'));
+ $this->adminUser = $this->drupalCreateUser(array('administer filters'));
}
/**
@@ -47,7 +54,7 @@ class CKEditorAdminTest extends WebTestBase {
function testExistingFormat() {
$ckeditor = $this->container->get('plugin.manager.editor')->createInstance('ckeditor');
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
$this->drupalGet('admin/config/content/formats/manage/filtered_html');
// Ensure no Editor config entity exists yet.
@@ -192,7 +199,7 @@ class CKEditorAdminTest extends WebTestBase {
* configuration form work; details are tested in testExistingFormat().
*/
function testNewFormat() {
- $this->drupalLogin($this->admin_user);
+ $this->drupalLogin($this->adminUser);
$this->drupalGet('admin/config/content/formats/add');
// Verify the "Text Editor" <select> when a text editor is available.
diff --git a/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php b/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php
index ba2fa4b..37e047c 100644
--- a/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php
+++ b/core/modules/ckeditor/src/Tests/CKEditorLoadingTest.php
@@ -23,6 +23,20 @@ class CKEditorLoadingTest extends WebTestBase {
*/
public static $modules = array('filter', 'editor', 'ckeditor', 'node');
+ /**
+ * An untrusted user with access to only the 'plain_text' format.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $untrustedUser;
+
+ /**
+ * A normal user with access to the 'plain_text' and 'filtered_html' formats.
+ *
+ * @var \Drupal\user\UserInterface
+ */
+ protected $normalUser;
+
protected function setUp() {
parent::setUp();
@@ -56,11 +70,8 @@ class CKEditorLoadingTest extends WebTestBase {
'name' => 'Article',
));
- // Create 2 users, each with access to different text formats:
- // - "untrusted": plain_text
- // - "normal": plain_text, filtered_html
- $this->untrusted_user = $this->drupalCreateUser(array('create article content', 'edit any article content'));
- $this->normal_user = $this->drupalCreateUser(array('create article content', 'edit any article content', 'use text format filtered_html', 'use text format full_html'));
+ $this->untrustedUser = $this->drupalCreateUser(array('create article content', 'edit any article content'));
+ $this->normalUser = $this->drupalCreateUser(array('create article content', 'edit any article content', 'use text format filtered_html', 'use text format full_html'));
}
/**
@@ -70,7 +81,7 @@ class CKEditorLoadingTest extends WebTestBase {
// The untrusted user:
// - has access to 1 text format (plain_text);
// - doesn't have access to the filtered_html text format, so: no text editor.
- $this->drupalLogin($this->untrusted_user);
+ $this->drupalLogin($this->untrustedUser);
$this->drupalGet('node/add/article');
list($settings, $editor_settings_present, $editor_js_present, $body, $format_selector) = $this->getThingsToCheck();
$this->assertFalse($editor_settings_present, 'No Text Editor module settings.');
@@ -88,7 +99,7 @@ class CKEditorLoadingTest extends WebTestBase {
// The normal user:
// - has access to 2 text formats;
// - does have access to the filtered_html text format, so: CKEditor.
- $this->drupalLogin($this->normal_user);
+ $this->drupalLogin($this->normalUser);
$this->drupalGet('node/add/article');
list($settings, $editor_settings_present, $editor_js_present, $body, $format_selector) = $this->getThingsToCheck();
$ckeditor_plugin = $this->container->get('plugin.manager.editor')->createInstance('ckeditor');