diff --git a/core/modules/ckeditor/src/Tests/CKEditorLanguageDirectionTest.php b/core/modules/ckeditor/src/Tests/CKEditorLanguageDirectionTest.php new file mode 100644 index 0000000..2a190d6 --- /dev/null +++ b/core/modules/ckeditor/src/Tests/CKEditorLanguageDirectionTest.php @@ -0,0 +1,79 @@ + 'full_html', + 'name' => 'Full HTML', + 'weight' => 1, + 'filters' => array(), + )); + $full_html_format->save(); + + $editor = entity_create('editor', array( + 'format' => 'full_html', + 'editor' => 'ckeditor', + )); + $editor->save(); + + // Create a new user with admin rights. + $this->admin_user = $this->drupalCreateUser(array( + 'administer languages', + 'access administration pages', + 'administer site configuration', + 'administer filters', + )); + + } + + /** + * Tests loading of CKEditor CSS, JS and JS settings. + */ + public function testLanguageDirectionChange() { + // Login with admin user. + $this->drupalLogin($this->admin_user); + + // Install the Arabic language (which is RTL) and configure as the default. + $edit = array(); + $edit['predefined_langcode'] = 'ar'; + $this->drupalPostForm('admin/config/regional/language/add', $edit, t('Add language')); + + $edit = array('site_default_language' => 'ar'); + $this->drupalPostForm('admin/config/regional/settings', $edit, t('Save configuration')); + + // Once the language is changed then goto CKEditor Full HTML configuration. + $this->drupalGet('admin/config/content/formats/manage/full_html'); + // Check the RTL images are loaded in the page. Since the images are loaded + // via the Javascript Settings then only way to check is for the image names + // exists or not. + $this->assertPattern('/_rtl.png/', 'RTL images found in the page'); + } +}