public function MathjaxWebTest::testFilterOrder in MathJax: LaTeX for Drupal 8.2
Ensure the MathJax filter is at the bottom of the processing order.
File
- src/
Tests/ MathjaxWebTest.php, line 104
Class
- MathjaxWebTest
- Configuration test case for the module.
Namespace
Drupal\mathjax\TestsCode
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 = array(
'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]
->__toString(), 'MathJax');
}