From 8172877a62e7df25b0febc4b46dfa148af73f7db Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Mon, 29 Nov 2010 06:38:52 +0000 Subject: #947844 by sun: Clean up filter-related tests that load text formats by their human-readable name. --- modules/search/search.test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/search') diff --git a/modules/search/search.test b/modules/search/search.test index a1ef61250..bf1f69419 100644 --- a/modules/search/search.test +++ b/modules/search/search.test @@ -700,7 +700,7 @@ class SearchCommentTestCase extends DrupalWebTestCase { // Create and log in an administrative user having access to the Full HTML // text format. - $full_html_format = db_query_range('SELECT * FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'Full HTML'))->fetchObject(); + $full_html_format = filter_format_load('full_html'); $permissions = array( 'administer filters', filter_permission_name($full_html_format), @@ -721,7 +721,7 @@ class SearchCommentTestCase extends DrupalWebTestCase { variable_set('comment_preview_article', DRUPAL_OPTIONAL); // Enable check_plain() for 'Filtered HTML' text format. - $filtered_html_format_id = db_query_range('SELECT format FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'Filtered HTML'))->fetchField(); + $filtered_html_format_id = 'filtered_html'; $edit = array( 'filters[filter_html_escape][status]' => TRUE, ); @@ -740,7 +740,7 @@ class SearchCommentTestCase extends DrupalWebTestCase { $edit_comment = array(); $edit_comment['subject'] = 'Test comment subject'; $edit_comment['comment_body[' . LANGUAGE_NONE . '][0][value]'] = '

' . $comment_body . '

'; - $full_html_format_id = db_query_range('SELECT format FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'Full HTML'))->fetchField(); + $full_html_format_id = 'full_html'; $edit_comment['comment_body[' . LANGUAGE_NONE . '][0][format]'] = $full_html_format_id; $this->drupalPost('comment/reply/' . $node->nid, $edit_comment, t('Save')); @@ -975,7 +975,7 @@ class SearchCommentCountToggleTestCase extends DrupalWebTestCase { $edit_comment = array(); $edit_comment['subject'] = $this->randomName(); $edit_comment['comment_body[' . LANGUAGE_NONE . '][0][value]'] = $this->randomName(); - $filtered_html_format_id = db_query_range('SELECT format FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'Filtered HTML'))->fetchField(); + $filtered_html_format_id = 'filtered_html'; $edit_comment['comment_body[' . LANGUAGE_NONE . '][0][format]'] = $filtered_html_format_id; // Post comment to the test node with comment -- cgit v1.2.3