1 filter_example.test public FilterExampleTestCase::setUp()

Enable modules and create user with specific permissions.

Overrides BackdropWebTestCase::setUp

File

modules/examples/filter_example/filter_example.test, line 25
Test case for Testing the filter example module.

Class

FilterExampleTestCase

Code

public function setUp() {
  parent::setUp('filter_example');

  // Load the used input formats.
  // $this->filteredHtml = db_query_range('SELECT * FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'Filtered HTML'))->fetchObject();
  // $this->fullHtml = db_query_range('SELECT * FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'Full HTML'))->fetchObject();
  $this->filteredHtml = (object) config_get('filter.format.filtered_html');
  $this->fullHtml = (object) config_get('filter.format.full_html');

  // Create user.
  $this->webUser = $this->backdropCreateUser(array(
    'administer filters',
    filter_permission_name($this->filteredHtml),
    filter_permission_name($this->fullHtml),
    'bypass node access',
  ));
}