Commit 74e72569 authored by jhodgdon's avatar jhodgdon

Issue #1797272 by Lars Toomre, xjm: Remove t() form test assertion messages in filter module

parent 93a03822
......@@ -76,9 +76,9 @@ function testTextFormatCrud() {
filter_format_disable($format);
$db_format = db_query("SELECT * FROM {filter_format} WHERE format = :format", array(':format' => $format->format))->fetchObject();
$this->assertFalse($db_format->status, t('Database: Disabled text format is marked as disabled.'));
$this->assertFalse($db_format->status, 'Database: Disabled text format is marked as disabled.');
$formats = filter_formats();
$this->assertTrue(!isset($formats[$format->format]), t('filter_formats: Disabled text format no longer exists.'));
$this->assertTrue(!isset($formats[$format->format]), 'filter_formats: Disabled text format no longer exists.');
}
/**
......@@ -92,17 +92,17 @@ function verifyTextFormat($format) {
->condition('format', $format->format)
->execute()
->fetchObject();
$this->assertEqual($db_format->format, $format->format, t('Database: Proper format id for text format %format.', $t_args));
$this->assertEqual($db_format->name, $format->name, t('Database: Proper title for text format %format.', $t_args));
$this->assertEqual($db_format->cache, $format->cache, t('Database: Proper cache indicator for text format %format.', $t_args));
$this->assertEqual($db_format->weight, $format->weight, t('Database: Proper weight for text format %format.', $t_args));
$this->assertEqual($db_format->format, $format->format, format_string('Database: Proper format id for text format %format.', $t_args));
$this->assertEqual($db_format->name, $format->name, format_string('Database: Proper title for text format %format.', $t_args));
$this->assertEqual($db_format->cache, $format->cache, format_string('Database: Proper cache indicator for text format %format.', $t_args));
$this->assertEqual($db_format->weight, $format->weight, format_string('Database: Proper weight for text format %format.', $t_args));
// Verify filter_format_load().
$filter_format = filter_format_load($format->format);
$this->assertEqual($filter_format->format, $format->format, t('filter_format_load: Proper format id for text format %format.', $t_args));
$this->assertEqual($filter_format->name, $format->name, t('filter_format_load: Proper title for text format %format.', $t_args));
$this->assertEqual($filter_format->cache, $format->cache, t('filter_format_load: Proper cache indicator for text format %format.', $t_args));
$this->assertEqual($filter_format->weight, $format->weight, t('filter_format_load: Proper weight for text format %format.', $t_args));
$this->assertEqual($filter_format->format, $format->format, format_string('filter_format_load: Proper format id for text format %format.', $t_args));
$this->assertEqual($filter_format->name, $format->name, format_string('filter_format_load: Proper title for text format %format.', $t_args));
$this->assertEqual($filter_format->cache, $format->cache, format_string('filter_format_load: Proper cache indicator for text format %format.', $t_args));
$this->assertEqual($filter_format->weight, $format->weight, format_string('filter_format_load: Proper weight for text format %format.', $t_args));
// Verify the 'cache' text format property according to enabled filters.
$filter_info = filter_get_filters();
......@@ -116,7 +116,7 @@ function verifyTextFormat($format) {
break;
}
}
$this->assertEqual($filter_format->cache, $cacheable, t('Text format contains proper cache property.'));
$this->assertEqual($filter_format->cache, $cacheable, 'Text format contains proper cache property.');
}
/**
......@@ -130,20 +130,20 @@ function verifyFilters($format) {
$t_args = array('%format' => $format->name, '%filter' => $name);
// Verify that filter status is properly stored.
$this->assertEqual($filter->status, $format_filters[$name]['status'], t('Database: Proper status for %filter in text format %format.', $t_args));
$this->assertEqual($filter->status, $format_filters[$name]['status'], format_string('Database: Proper status for %filter in text format %format.', $t_args));
// Verify that filter settings were properly stored.
$this->assertEqual(unserialize($filter->settings), isset($format_filters[$name]['settings']) ? $format_filters[$name]['settings'] : array(), t('Database: Proper filter settings for %filter in text format %format.', $t_args));
$this->assertEqual(unserialize($filter->settings), isset($format_filters[$name]['settings']) ? $format_filters[$name]['settings'] : array(), format_string('Database: Proper filter settings for %filter in text format %format.', $t_args));
// Verify that each filter has a module name assigned.
$this->assertTrue(!empty($filter->module), t('Database: Proper module name for %filter in text format %format.', $t_args));
$this->assertTrue(!empty($filter->module), format_string('Database: Proper module name for %filter in text format %format.', $t_args));
// Remove the filter from the copy of saved $format to check whether all
// filters have been processed later.
unset($format_filters[$name]);
}
// Verify that all filters have been processed.
$this->assertTrue(empty($format_filters), t('Database contains values for all filters in the saved format.'));
$this->assertTrue(empty($format_filters), 'Database contains values for all filters in the saved format.');
// Verify filter_list_format().
$filters = filter_list_format($format->format);
......@@ -152,19 +152,19 @@ function verifyFilters($format) {
$t_args = array('%format' => $format->name, '%filter' => $name);
// Verify that filter status is properly stored.
$this->assertEqual($filter->status, $format_filters[$name]['status'], t('filter_list_format: Proper status for %filter in text format %format.', $t_args));
$this->assertEqual($filter->status, $format_filters[$name]['status'], format_string('filter_list_format: Proper status for %filter in text format %format.', $t_args));
// Verify that filter settings were properly stored.
$this->assertEqual($filter->settings, isset($format_filters[$name]['settings']) ? $format_filters[$name]['settings'] : array(), t('filter_list_format: Proper filter settings for %filter in text format %format.', $t_args));
$this->assertEqual($filter->settings, isset($format_filters[$name]['settings']) ? $format_filters[$name]['settings'] : array(), format_string('filter_list_format: Proper filter settings for %filter in text format %format.', $t_args));
// Verify that each filter has a module name assigned.
$this->assertTrue(!empty($filter->module), t('filter_list_format: Proper module name for %filter in text format %format.', $t_args));
$this->assertTrue(!empty($filter->module), format_string('filter_list_format: Proper module name for %filter in text format %format.', $t_args));
// Remove the filter from the copy of saved $format to check whether all
// filters have been processed later.
unset($format_filters[$name]);
}
// Verify that all filters have been processed.
$this->assertTrue(empty($format_filters), t('filter_list_format: Loaded filters contain values for all filters in the saved format.'));
$this->assertTrue(empty($format_filters), 'filter_list_format: Loaded filters contain values for all filters in the saved format.');
}
}
......@@ -51,8 +51,8 @@ function testDefaultTextFormats() {
// Check that each user's default format is the lowest weighted format that
// the user has access to.
$this->assertEqual(filter_default_format($first_user), $first_format->format, t("The first user's default format is the lowest weighted format that the user has access to."));
$this->assertEqual(filter_default_format($second_user), $second_format->format, t("The second user's default format is the lowest weighted format that the user has access to, and is different than the first user's."));
$this->assertEqual(filter_default_format($first_user), $first_format->format, "The first user's default format is the lowest weighted format that the user has access to.");
$this->assertEqual(filter_default_format($second_user), $second_format->format, "The second user's default format is the lowest weighted format that the user has access to, and is different than the first user's.");
// Reorder the two formats, and check that both users now have the same
// default.
......@@ -60,7 +60,7 @@ function testDefaultTextFormats() {
$edit['formats[' . $second_format->format . '][weight]'] = $minimum_weight - 3;
$this->drupalPost('admin/config/content/formats', $edit, t('Save changes'));
$this->resetFilterCaches();
$this->assertEqual(filter_default_format($first_user), filter_default_format($second_user), t('After the formats are reordered, both users have the same default format.'));
$this->assertEqual(filter_default_format($first_user), filter_default_format($second_user), 'After the formats are reordered, both users have the same default format.');
}
/**
......
......@@ -49,8 +49,8 @@ function testFilterHooks() {
$edit['name'] = $name;
$edit['roles[' . DRUPAL_ANONYMOUS_RID . ']'] = 1;
$this->drupalPost('admin/config/content/formats/add', $edit, t('Save configuration'));
$this->assertRaw(t('Added text format %format.', array('%format' => $name)), t('New format created.'));
$this->assertText('hook_filter_format_insert invoked.', t('hook_filter_format_insert was invoked.'));
$this->assertRaw(t('Added text format %format.', array('%format' => $name)), 'New format created.');
$this->assertText('hook_filter_format_insert invoked.', 'hook_filter_format_insert was invoked.');
$format_id = $edit['format'];
......@@ -58,8 +58,8 @@ function testFilterHooks() {
$edit = array();
$edit['roles[' . DRUPAL_AUTHENTICATED_RID . ']'] = 1;
$this->drupalPost('admin/config/content/formats/' . $format_id, $edit, t('Save configuration'));
$this->assertRaw(t('The text format %format has been updated.', array('%format' => $name)), t('Format successfully updated.'));
$this->assertText('hook_filter_format_update invoked.', t('hook_filter_format_update() was invoked.'));
$this->assertRaw(t('The text format %format has been updated.', array('%format' => $name)), 'Format successfully updated.');
$this->assertText('hook_filter_format_update invoked.', 'hook_filter_format_update() was invoked.');
// Add a new custom block.
$custom_block = array();
......@@ -69,15 +69,15 @@ function testFilterHooks() {
// Use the format created.
$custom_block['body[format]'] = $format_id;
$this->drupalPost('admin/structure/block/add', $custom_block, t('Save block'));
$this->assertText(t('The block has been created.'), t('New block successfully created.'));
$this->assertText(t('The block has been created.'), 'New block successfully created.');
// Verify the new block is in the database.
$bid = db_query("SELECT bid FROM {block_custom} WHERE info = :info", array(':info' => $custom_block['info']))->fetchField();
$this->assertNotNull($bid, t('New block found in database'));
$this->assertNotNull($bid, 'New block found in database');
// Disable the text format.
$this->drupalPost('admin/config/content/formats/' . $format_id . '/disable', array(), t('Disable'));
$this->assertRaw(t('Disabled text format %format.', array('%format' => $name)), t('Format successfully disabled.'));
$this->assertText('hook_filter_format_disable invoked.', t('hook_filter_format_disable() was invoked.'));
$this->assertRaw(t('Disabled text format %format.', array('%format' => $name)), 'Format successfully disabled.');
$this->assertText('hook_filter_format_disable invoked.', 'hook_filter_format_disable() was invoked.');
}
}
......@@ -34,6 +34,6 @@ function testCheckMarkupNoFormat() {
// Make sure that when this text is run through check_markup() with no text
// format, it is filtered as though it is in the fallback format.
$this->assertEqual(check_markup($text), check_markup($text, filter_fallback_format()), t('Text with no format is filtered the same as text in the fallback format.'));
$this->assertEqual(check_markup($text), check_markup($text, filter_fallback_format()), 'Text with no format is filtered the same as text in the fallback format.');
}
}
......@@ -62,7 +62,7 @@ function testDisableFilterModule() {
$body_raw = $node->body[LANGUAGE_NOT_SPECIFIED][0]['value'];
$format_id = $node->body[LANGUAGE_NOT_SPECIFIED][0]['format'];
$this->drupalGet('node/' . $node->nid);
$this->assertText($body_raw, t('Node body found.'));
$this->assertText($body_raw, 'Node body found.');
// Enable the filter_test_replace filter.
$edit = array(
......@@ -72,14 +72,14 @@ function testDisableFilterModule() {
// Verify that filter_test_replace filter replaced the content.
$this->drupalGet('node/' . $node->nid);
$this->assertNoText($body_raw, t('Node body not found.'));
$this->assertText('Filter: Testing filter', t('Testing filter output found.'));
$this->assertNoText($body_raw, 'Node body not found.');
$this->assertText('Filter: Testing filter', 'Testing filter output found.');
// Disable the text format entirely.
$this->drupalPost('admin/config/content/formats/' . $format_id . '/disable', array(), t('Disable'));
// Verify that the content is empty, because the text format does not exist.
$this->drupalGet('node/' . $node->nid);
$this->assertNoText($body_raw, t('Node body not found.'));
$this->assertNoText($body_raw, 'Node body not found.');
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment