'Filter example functionality', 'description' => 'Verify that content is processed by example filter.', 'group' => 'Examples', ); } /** * Enable modules and create user with specific permissions. */ 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(); // Create user. $this->webUser = $this->drupalCreateUser(array( 'administer filters', filter_permission_name($this->filteredHtml), filter_permission_name($this->fullHtml), 'bypass node access', )); } /** * Functional test of the foo filter. * * Login user, create an example node, and test blog functionality through * the admin and user interfaces. */ public function testFilterExampleBasic() { // Login the admin user. $this->drupalLogin($this->webUser); // Enable both filters in format id 1 (default format). $edit = array( 'filters[filter_time][status]' => TRUE, 'filters[filter_foo][status]' => TRUE, ); $this->drupalPost('admin/config/content/formats/' . $this->filteredHtml->format, $edit, t('Save configuration')); // Create a content type to test the filters (with default format). $content_type = $this->drupalCreateContentType(); // Create a test node. $langcode = LANGUAGE_NONE; $edit = array( "title" => $this->randomName(), "body[$langcode][0][value]" => 'What foo is it? it is