You are here

public function MathjaxWebTest::testFilterOrder in MathJax: LaTeX for Drupal 3.0.x

Ensure the MathJax filter is at the bottom of the processing order.

File

tests/src/Functional/MathjaxWebTest.php, line 112

Class

MathjaxWebTest
Configuration test case for the module.

Namespace

Drupal\Tests\mathjax\Functional

Code

public function testFilterOrder() {
  $this
    ->drupalLogin($this->administrator);

  // Activate the MathJax filter on the plain_text format.
  $this
    ->drupalGet('admin/config/content/formats/manage/plain_text');
  $edit = [
    'filters[filter_mathjax][status]' => TRUE,
  ];
  $this
    ->drupalPostForm(NULL, $edit, t('Save configuration'));
  $this
    ->drupalGet('admin/config/content/formats/manage/plain_text');

  // Ensure that MathJax appears at the bottom of the active filter list.
  $count = count($this
    ->xpath("//div[@id='edit-filters-status']/div/input[@class='form-checkbox' and @checked='checked']"));
  $result = $this
    ->xpath("//table[@id='filter-order']/tbody/tr[{$count}]/td[1]");
  $this
    ->assertEqual($result[0]
    ->getText(), 'MathJax');
}