protected function CustomFilterTest::createFilter in Custom filter 2.0.x
Create a new filter.
1 call to CustomFilterTest::createFilter()
- CustomFilterTest::testModule in tests/
src/ Functional/ CustomFilterTest.php - Run all the tests.
File
- tests/
src/ Functional/ CustomFilterTest.php, line 62
Class
- CustomFilterTest
- Test the Custom Filter administration and use.
Namespace
Drupal\Tests\customfilter\FunctionalCode
protected function createFilter() {
$edit = [];
$edit['id'] = 'test_filter';
$edit['name'] = 'filter_name';
$edit['disable_cache'] = FALSE;
$edit['description'] = 'filter description';
$edit['shorttip'] = 'short tip';
$edit['longtip'] = 'long tip';
$this
->drupalGet('admin/config/content/customfilter/add');
$this
->submitForm($edit, 'Save');
$this
->drupalGet('admin/config/content/customfilter');
$this
->assertSession()
->pageTextContains('filter_name');
$this
->assertTrue(CustomFilter::load('test_filter')
->getCache());
}