You are here

protected function CustomFilterTest::createSubRule in Custom filter 2.0.x

Create a new subrule.

1 call to CustomFilterTest::createSubRule()
CustomFilterTest::testModule in tests/src/Functional/CustomFilterTest.php
Run all the tests.

File

tests/src/Functional/CustomFilterTest.php, line 114

Class

CustomFilterTest
Test the Custom Filter administration and use.

Namespace

Drupal\Tests\customfilter\Functional

Code

protected function createSubRule() {
  $edit = [];
  $edit['rid'] = 'test_subrule';
  $edit['name'] = 'Subrule Name';
  $edit['description'] = 'subrule description';
  $edit['enabled'] = TRUE;
  $edit['matches'] = '1';
  $edit['pattern'] = '/drupal/i';
  $edit['code'] = FALSE;
  $edit['replacement'] = '<font color="red">Drupal</font>';
  $this
    ->drupalGet('admin/config/content/customfilter/filter/test_filter/rule/test_rule/add');
  $this
    ->submitForm($edit, 'Save');
  $this
    ->assertSession()
    ->pageTextContains("Subrule Name");
}