You are here

public function PathologicUITest::doTestFormatsOptions in Pathologic 8

Test text formats and editors options with pathologic.

1 call to PathologicUITest::doTestFormatsOptions()
PathologicUITest::testPathologicUi in tests/src/Functional/PathologicUITest.php
Tests for the Pathologic UI.

File

tests/src/Functional/PathologicUITest.php, line 67

Class

PathologicUITest
Tests for the Pathologic UI.

Namespace

Drupal\Tests\pathologic\Functional

Code

public function doTestFormatsOptions() {

  // Test plain text with pathologic configuration.
  $this
    ->drupalGet('/admin/config/content/formats/manage/plain_text');

  // Select pathologic option.
  $this
    ->assertText('Correct URLs with Pathologic');
  $this
    ->assertNoFieldChecked('edit-filters-filter-pathologic-status');
  $this
    ->drupalPostForm(NULL, [
    'filters[filter_html_escape][status]' => FALSE,
    'filters[filter_pathologic][status]' => '1',
  ], t('Save configuration'));
  $this
    ->drupalGet('/admin/config/content/formats/manage/plain_text');
  $this
    ->assertRaw('In most cases, Pathologic should be the <em>last</em> filter in the &ldquo;Filter processing order&rdquo; list.');
  $this
    ->assertText('Select whether Pathologic should use the global Pathologic settings');
  $this
    ->assertFieldChecked('edit-filters-filter-pathologic-status');
  $this
    ->drupalPostForm(NULL, [
    'filters[filter_pathologic][settings][settings_source]' => 'local',
    'filters[filter_pathologic][settings][local_settings][protocol_style]' => 'full',
  ], t('Save configuration'));
  $this
    ->drupalGet('/admin/config/content/formats/manage/plain_text');
  $this
    ->assertFieldChecked('edit-filters-filter-pathologic-settings-settings-source-local');
  $this
    ->assertFieldChecked('edit-filters-filter-pathologic-settings-local-settings-protocol-style-full');
  $this
    ->assertText('Custom settings for this text format');
}