You are here

protected function CustomFilterTest::createSubRule in Custom filter 8

Create a new subrule.

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

File

src/Tests/CustomFilterTest.php, line 81

Class

CustomFilterTest
Test the Custom Filter administration and use.

Namespace

Drupal\customfilter\Tests

Code

protected function createSubRule() {
  $edit = array();
  $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
    ->drupalPostForm('admin/config/content/customfilter/test_filter/test_rule/add', $edit, t('Save'));
  $this
    ->assertText("Subrule Name", 'Subrule created with sucess');
}