You are here

protected function CustomFilterTest::createRule in Custom filter 8

Create a new rule.

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

File

src/Tests/CustomFilterTest.php, line 65

Class

CustomFilterTest
Test the Custom Filter administration and use.

Namespace

Drupal\customfilter\Tests

Code

protected function createRule() {
  $edit = array();
  $edit['rid'] = 'test_rule';
  $edit['name'] = 'Rule Name';
  $edit['description'] = 'rule description';
  $edit['enabled'] = TRUE;
  $edit['pattern'] = '/\\[test\\](.+)\\[\\/test\\]/iUs';
  $edit['code'] = FALSE;
  $edit['replacement'] = '<b>$1</b>';
  $this
    ->drupalPostForm('admin/config/content/customfilter/test_filter/add', $edit, t('Save'));
  $this
    ->assertText("Rule Name", 'Rule created with sucess');
}