Commit ca3cc9b8 authored by alexpott's avatar alexpott

Issue #2381303 by tibbsa, rpayanm, hussainweb, mglaman: Clean-up CKEditor...

Issue #2381303 by tibbsa, rpayanm, hussainweb, mglaman: Clean-up CKEditor module test members — ensure property definition and use of camelCase naming convention
parent acd8af47
......@@ -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 @@ protected function setUp() {
$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 @@ protected function setUp() {
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 @@ function testExistingFormat() {
* 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.
......
......@@ -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 @@ protected function setUp() {
'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 @@ function testLoading() {
// 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 @@ function testLoading() {
// 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');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment