diff options
author | Jennifer Hodgdon <yahgrp@poplarware.com> | 2013-04-26 08:57:14 -0700 |
---|---|---|
committer | Jennifer Hodgdon <yahgrp@poplarware.com> | 2013-04-26 08:57:14 -0700 |
commit | 25150e7b60f6bf6d4d8fb8027e3199172b3f0e60 (patch) | |
tree | c00dd7aea70ae67a2fb7455f81f1f5c69b7b8d95 /modules/simpletest | |
parent | 8ee9e5ab409021fbd250c7a093691c5a10f36ae2 (diff) | |
download | brdo-25150e7b60f6bf6d4d8fb8027e3199172b3f0e60.tar.gz brdo-25150e7b60f6bf6d4d8fb8027e3199172b3f0e60.tar.bz2 |
Issue #1797920 by dcam, izus, Lars Toomre: Remove t() from test asserts in misc system tests
Diffstat (limited to 'modules/simpletest')
17 files changed, 129 insertions, 129 deletions
diff --git a/modules/simpletest/tests/theme.test b/modules/simpletest/tests/theme.test index 0ee473e3f..d377ef063 100644 --- a/modules/simpletest/tests/theme.test +++ b/modules/simpletest/tests/theme.test @@ -33,22 +33,22 @@ class ThemeTestCase extends DrupalWebTestCase { variable_set('site_frontpage', 'nobody-home'); $args = array('node', '1', 'edit'); $suggestions = theme_get_suggestions($args, 'page'); - $this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1', 'page__node__edit'), t('Found expected node edit page suggestions')); + $this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1', 'page__node__edit'), 'Found expected node edit page suggestions'); // Check attack vectors. $args = array('node', '\\1'); $suggestions = theme_get_suggestions($args, 'page'); - $this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), t('Removed invalid \\ from suggestions')); + $this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), 'Removed invalid \\ from suggestions'); $args = array('node', '1/'); $suggestions = theme_get_suggestions($args, 'page'); - $this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), t('Removed invalid / from suggestions')); + $this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), 'Removed invalid / from suggestions'); $args = array('node', "1\0"); $suggestions = theme_get_suggestions($args, 'page'); - $this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), t('Removed invalid \\0 from suggestions')); + $this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1'), 'Removed invalid \\0 from suggestions'); // Define path with hyphens to be used to generate suggestions. $args = array('node', '1', 'hyphen-path'); $result = array('page__node', 'page__node__%', 'page__node__1', 'page__node__hyphen_path'); $suggestions = theme_get_suggestions($args, 'page'); - $this->assertEqual($suggestions, $result, t('Found expected page suggestions for paths containing hyphens.')); + $this->assertEqual($suggestions, $result, 'Found expected page suggestions for paths containing hyphens.'); } /** @@ -78,7 +78,7 @@ class ThemeTestCase extends DrupalWebTestCase { $suggestions = theme_get_suggestions(explode('/', $_GET['q']), 'page'); // Set it back to not annoy the batch runner. $_GET['q'] = $q; - $this->assertTrue(in_array('page__front', $suggestions), t('Front page template was suggested.')); + $this->assertTrue(in_array('page__front', $suggestions), 'Front page template was suggested.'); } /** @@ -86,7 +86,7 @@ class ThemeTestCase extends DrupalWebTestCase { */ function testAlter() { $this->drupalGet('theme-test/alter'); - $this->assertText('The altered data is test_theme_theme_test_alter_alter was invoked.', t('The theme was able to implement an alter hook during page building before anything was rendered.')); + $this->assertText('The altered data is test_theme_theme_test_alter_alter was invoked.', 'The theme was able to implement an alter hook during page building before anything was rendered.'); } /** @@ -101,7 +101,7 @@ class ThemeTestCase extends DrupalWebTestCase { // test theme. First we test with CSS aggregation disabled. variable_set('preprocess_css', 0); $this->drupalGet('theme-test/suggestion'); - $this->assertNoText('system.base.css', t('The theme\'s .info file is able to override a module CSS file from being added to the page.')); + $this->assertNoText('system.base.css', 'The theme\'s .info file is able to override a module CSS file from being added to the page.'); // Also test with aggregation enabled, simply ensuring no PHP errors are // triggered during drupal_build_css_cache() when a source file doesn't @@ -131,19 +131,19 @@ class ThemeTestCase extends DrupalWebTestCase { function testListThemes() { $themes = list_themes(); // Check if drupal_theme_access() retrieves enabled themes properly from list_themes(). - $this->assertTrue(drupal_theme_access('test_theme'), t('Enabled theme detected')); + $this->assertTrue(drupal_theme_access('test_theme'), 'Enabled theme detected'); // Check if list_themes() returns disabled themes. - $this->assertTrue(array_key_exists('test_basetheme', $themes), t('Disabled theme detected')); + $this->assertTrue(array_key_exists('test_basetheme', $themes), 'Disabled theme detected'); // Check for base theme and subtheme lists. $base_theme_list = array('test_basetheme' => 'Theme test base theme'); $sub_theme_list = array('test_subtheme' => 'Theme test subtheme'); - $this->assertIdentical($themes['test_basetheme']->sub_themes, $sub_theme_list, t('Base theme\'s object includes list of subthemes.')); - $this->assertIdentical($themes['test_subtheme']->base_themes, $base_theme_list, t('Subtheme\'s object includes list of base themes.')); + $this->assertIdentical($themes['test_basetheme']->sub_themes, $sub_theme_list, 'Base theme\'s object includes list of subthemes.'); + $this->assertIdentical($themes['test_subtheme']->base_themes, $base_theme_list, 'Subtheme\'s object includes list of base themes.'); // Check for theme engine in subtheme. - $this->assertIdentical($themes['test_subtheme']->engine, 'phptemplate', t('Subtheme\'s object includes the theme engine.')); + $this->assertIdentical($themes['test_subtheme']->engine, 'phptemplate', 'Subtheme\'s object includes the theme engine.'); // Check for theme engine prefix. - $this->assertIdentical($themes['test_basetheme']->prefix, 'phptemplate', t('Base theme\'s object includes the theme engine prefix.')); - $this->assertIdentical($themes['test_subtheme']->prefix, 'phptemplate', t('Subtheme\'s object includes the theme engine prefix.')); + $this->assertIdentical($themes['test_basetheme']->prefix, 'phptemplate', 'Base theme\'s object includes the theme engine prefix.'); + $this->assertIdentical($themes['test_subtheme']->prefix, 'phptemplate', 'Subtheme\'s object includes the theme engine prefix.'); } /** @@ -151,9 +151,9 @@ class ThemeTestCase extends DrupalWebTestCase { */ function testThemeGetSetting() { $GLOBALS['theme_key'] = 'test_theme'; - $this->assertIdentical(theme_get_setting('theme_test_setting'), 'default value', t('theme_get_setting() uses the default theme automatically.')); - $this->assertNotEqual(theme_get_setting('subtheme_override', 'test_basetheme'), theme_get_setting('subtheme_override', 'test_subtheme'), t('Base theme\'s default settings values can be overridden by subtheme.')); - $this->assertIdentical(theme_get_setting('basetheme_only', 'test_subtheme'), 'base theme value', t('Base theme\'s default settings values are inherited by subtheme.')); + $this->assertIdentical(theme_get_setting('theme_test_setting'), 'default value', 'theme_get_setting() uses the default theme automatically.'); + $this->assertNotEqual(theme_get_setting('subtheme_override', 'test_basetheme'), theme_get_setting('subtheme_override', 'test_subtheme'), 'Base theme\'s default settings values can be overridden by subtheme.'); + $this->assertIdentical(theme_get_setting('basetheme_only', 'test_subtheme'), 'base theme value', 'Base theme\'s default settings values are inherited by subtheme.'); } } @@ -177,8 +177,8 @@ class ThemeTableTestCase extends DrupalWebTestCase { $rows = array(array(1,2,3), array(4,5,6), array(7,8,9)); $this->content = theme('table', array('header' => $header, 'rows' => $rows)); $js = drupal_add_js(); - $this->assertTrue(isset($js['misc/tableheader.js']), t('tableheader.js was included when $sticky = TRUE.')); - $this->assertRaw('sticky-enabled', t('Table has a class of sticky-enabled when $sticky = TRUE.')); + $this->assertTrue(isset($js['misc/tableheader.js']), 'tableheader.js was included when $sticky = TRUE.'); + $this->assertRaw('sticky-enabled', 'Table has a class of sticky-enabled when $sticky = TRUE.'); drupal_static_reset('drupal_add_js'); } @@ -193,8 +193,8 @@ class ThemeTableTestCase extends DrupalWebTestCase { $colgroups = array(); $this->content = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => $attributes, 'caption' => $caption, 'colgroups' => $colgroups, 'sticky' => FALSE)); $js = drupal_add_js(); - $this->assertFalse(isset($js['misc/tableheader.js']), t('tableheader.js was not included because $sticky = FALSE.')); - $this->assertNoRaw('sticky-enabled', t('Table does not have a class of sticky-enabled because $sticky = FALSE.')); + $this->assertFalse(isset($js['misc/tableheader.js']), 'tableheader.js was not included because $sticky = FALSE.'); + $this->assertNoRaw('sticky-enabled', 'Table does not have a class of sticky-enabled because $sticky = FALSE.'); drupal_static_reset('drupal_add_js'); } @@ -211,8 +211,8 @@ class ThemeTableTestCase extends DrupalWebTestCase { ), ); $this->content = theme('table', array('header' => $header, 'rows' => array(), 'empty' => t('No strings available.'))); - $this->assertRaw('<tr class="odd"><td colspan="3" class="empty message">No strings available.</td>', t('Correct colspan was set on empty message.')); - $this->assertRaw('<thead><tr><th>Header 1</th>', t('Table header was printed.')); + $this->assertRaw('<tr class="odd"><td colspan="3" class="empty message">No strings available.</td>', 'Correct colspan was set on empty message.'); + $this->assertRaw('<thead><tr><th>Header 1</th>', 'Table header was printed.'); } } @@ -321,14 +321,14 @@ class ThemeLinksTest extends DrupalWebTestCase { $html = drupal_render($render_array); $dom = new DOMDocument(); $dom->loadHTML($html); - $this->assertEqual($dom->getElementsByTagName('ul')->length, 1, t('One "ul" tag found in the rendered HTML.')); + $this->assertEqual($dom->getElementsByTagName('ul')->length, 1, 'One "ul" tag found in the rendered HTML.'); $list_elements = $dom->getElementsByTagName('li'); - $this->assertEqual($list_elements->length, 3, t('Three "li" tags found in the rendered HTML.')); - $this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link original', t('First expected link found.')); - $this->assertEqual($list_elements->item(1)->nodeValue, 'First child link', t('Second expected link found.')); - $this->assertEqual($list_elements->item(2)->nodeValue, 'Second child link', t('Third expected link found.')); - $this->assertIdentical(strpos($html, 'Parent link copy'), FALSE, t('"Parent link copy" link not found.')); - $this->assertIdentical(strpos($html, 'Third child link'), FALSE, t('"Third child link" link not found.')); + $this->assertEqual($list_elements->length, 3, 'Three "li" tags found in the rendered HTML.'); + $this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link original', 'First expected link found.'); + $this->assertEqual($list_elements->item(1)->nodeValue, 'First child link', 'Second expected link found.'); + $this->assertEqual($list_elements->item(2)->nodeValue, 'Second child link', 'Third expected link found.'); + $this->assertIdentical(strpos($html, 'Parent link copy'), FALSE, '"Parent link copy" link not found.'); + $this->assertIdentical(strpos($html, 'Third child link'), FALSE, '"Third child link" link not found.'); // Now render 'first_child', followed by the rest of the links, and make // sure we get two separate <ul>'s with the appropriate links contained @@ -339,21 +339,21 @@ class ThemeLinksTest extends DrupalWebTestCase { // First check the child HTML. $dom = new DOMDocument(); $dom->loadHTML($child_html); - $this->assertEqual($dom->getElementsByTagName('ul')->length, 1, t('One "ul" tag found in the rendered child HTML.')); + $this->assertEqual($dom->getElementsByTagName('ul')->length, 1, 'One "ul" tag found in the rendered child HTML.'); $list_elements = $dom->getElementsByTagName('li'); - $this->assertEqual($list_elements->length, 2, t('Two "li" tags found in the rendered child HTML.')); - $this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link copy', t('First expected link found.')); - $this->assertEqual($list_elements->item(1)->nodeValue, 'First child link', t('Second expected link found.')); + $this->assertEqual($list_elements->length, 2, 'Two "li" tags found in the rendered child HTML.'); + $this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link copy', 'First expected link found.'); + $this->assertEqual($list_elements->item(1)->nodeValue, 'First child link', 'Second expected link found.'); // Then check the parent HTML. $dom = new DOMDocument(); $dom->loadHTML($parent_html); - $this->assertEqual($dom->getElementsByTagName('ul')->length, 1, t('One "ul" tag found in the rendered parent HTML.')); + $this->assertEqual($dom->getElementsByTagName('ul')->length, 1, 'One "ul" tag found in the rendered parent HTML.'); $list_elements = $dom->getElementsByTagName('li'); - $this->assertEqual($list_elements->length, 2, t('Two "li" tags found in the rendered parent HTML.')); - $this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link original', t('First expected link found.')); - $this->assertEqual($list_elements->item(1)->nodeValue, 'Second child link', t('Second expected link found.')); - $this->assertIdentical(strpos($parent_html, 'First child link'), FALSE, t('"First child link" link not found.')); - $this->assertIdentical(strpos($parent_html, 'Third child link'), FALSE, t('"Third child link" link not found.')); + $this->assertEqual($list_elements->length, 2, 'Two "li" tags found in the rendered parent HTML.'); + $this->assertEqual($list_elements->item(0)->nodeValue, 'Parent link original', 'First expected link found.'); + $this->assertEqual($list_elements->item(1)->nodeValue, 'Second child link', 'Second expected link found.'); + $this->assertIdentical(strpos($parent_html, 'First child link'), FALSE, '"First child link" link not found.'); + $this->assertIdentical(strpos($parent_html, 'Third child link'), FALSE, '"Third child link" link not found.'); } } @@ -378,8 +378,8 @@ class ThemeHookInitTestCase extends DrupalWebTestCase { */ function testThemeInitializationHookInit() { $this->drupalGet('theme-test/hook-init'); - $this->assertRaw('Themed output generated in hook_init()', t('Themed output generated in hook_init() correctly appears on the page.')); - $this->assertRaw('bartik/css/style.css', t("The default theme's CSS appears on the page when the theme system is initialized in hook_init().")); + $this->assertRaw('Themed output generated in hook_init()', 'Themed output generated in hook_init() correctly appears on the page.'); + $this->assertRaw('bartik/css/style.css', "The default theme's CSS appears on the page when the theme system is initialized in hook_init()."); } } @@ -406,7 +406,7 @@ class ThemeFastTestCase extends DrupalWebTestCase { function testUserAutocomplete() { $this->drupalLogin($this->account); $this->drupalGet('user/autocomplete/' . $this->account->name); - $this->assertText('registry not initialized', t('The registry was not initialized')); + $this->assertText('registry not initialized', 'The registry was not initialized'); } } @@ -428,11 +428,11 @@ class ThemeHtmlTag extends DrupalUnitTestCase { function testThemeHtmlTag() { // Test auto-closure meta tag generation $tag['element'] = array('#tag' => 'meta', '#attributes' => array('name' => 'description', 'content' => 'Drupal test')); - $this->assertEqual('<meta name="description" content="Drupal test" />'."\n", theme_html_tag($tag), t('Test auto-closure meta tag generation.')); + $this->assertEqual('<meta name="description" content="Drupal test" />'."\n", theme_html_tag($tag), 'Test auto-closure meta tag generation.'); // Test title tag generation $tag['element'] = array('#tag' => 'title', '#value' => 'title test'); - $this->assertEqual('<title>title test</title>'."\n", theme_html_tag($tag), t('Test title tag generation.')); + $this->assertEqual('<title>title test</title>'."\n", theme_html_tag($tag), 'Test title tag generation.'); } } diff --git a/modules/simpletest/tests/update.test b/modules/simpletest/tests/update.test index 966efff22..160608579 100644 --- a/modules/simpletest/tests/update.test +++ b/modules/simpletest/tests/update.test @@ -35,7 +35,7 @@ class UpdateDependencyOrderingTestCase extends DrupalWebTestCase { 'update_test_1_update_7002', ); $actual_updates = array_keys(update_resolve_dependencies($starting_updates)); - $this->assertEqual($expected_updates, $actual_updates, t('Updates within a single module run in the correct order.')); + $this->assertEqual($expected_updates, $actual_updates, 'Updates within a single module run in the correct order.'); } /** @@ -49,9 +49,9 @@ class UpdateDependencyOrderingTestCase extends DrupalWebTestCase { $update_order = array_keys(update_resolve_dependencies($starting_updates)); // Make sure that each dependency is satisfied. $first_dependency_satisfied = array_search('update_test_2_update_7000', $update_order) < array_search('update_test_3_update_7000', $update_order); - $this->assertTrue($first_dependency_satisfied, t('The dependency of the second module on the first module is respected by the update function order.')); + $this->assertTrue($first_dependency_satisfied, 'The dependency of the second module on the first module is respected by the update function order.'); $second_dependency_satisfied = array_search('update_test_3_update_7000', $update_order) < array_search('update_test_2_update_7001', $update_order); - $this->assertTrue($second_dependency_satisfied, t('The dependency of the first module on the second module is respected by the update function order.')); + $this->assertTrue($second_dependency_satisfied, 'The dependency of the first module on the second module is respected by the update function order.'); } } @@ -79,9 +79,9 @@ class UpdateDependencyMissingTestCase extends DrupalWebTestCase { 'update_test_2' => 7000, ); $update_graph = update_resolve_dependencies($starting_updates); - $this->assertTrue($update_graph['update_test_2_update_7000']['allowed'], t("The module's first update function is allowed to run, since it does not have any missing dependencies.")); - $this->assertFalse($update_graph['update_test_2_update_7001']['allowed'], t("The module's second update function is not allowed to run, since it has a direct dependency on a missing update.")); - $this->assertFalse($update_graph['update_test_2_update_7002']['allowed'], t("The module's third update function is not allowed to run, since it has an indirect dependency on a missing update.")); + $this->assertTrue($update_graph['update_test_2_update_7000']['allowed'], "The module's first update function is allowed to run, since it does not have any missing dependencies."); + $this->assertFalse($update_graph['update_test_2_update_7001']['allowed'], "The module's second update function is not allowed to run, since it has a direct dependency on a missing update."); + $this->assertFalse($update_graph['update_test_2_update_7002']['allowed'], "The module's third update function is not allowed to run, since it has an indirect dependency on a missing update."); } } @@ -107,9 +107,9 @@ class UpdateDependencyHookInvocationTestCase extends DrupalWebTestCase { */ function testHookUpdateDependencies() { $update_dependencies = update_retrieve_dependencies(); - $this->assertTrue($update_dependencies['system'][7000]['update_test_1'] == 7000, t('An update function that has a dependency on two separate modules has the first dependency recorded correctly.')); - $this->assertTrue($update_dependencies['system'][7000]['update_test_2'] == 7001, t('An update function that has a dependency on two separate modules has the second dependency recorded correctly.')); - $this->assertTrue($update_dependencies['system'][7001]['update_test_1'] == 7002, t('An update function that depends on more than one update from the same module only has the dependency on the higher-numbered update function recorded.')); + $this->assertTrue($update_dependencies['system'][7000]['update_test_1'] == 7000, 'An update function that has a dependency on two separate modules has the first dependency recorded correctly.'); + $this->assertTrue($update_dependencies['system'][7000]['update_test_2'] == 7001, 'An update function that has a dependency on two separate modules has the second dependency recorded correctly.'); + $this->assertTrue($update_dependencies['system'][7001]['update_test_1'] == 7002, 'An update function that depends on more than one update from the same module only has the dependency on the higher-numbered update function recorded.'); } } diff --git a/modules/simpletest/tests/upgrade/update.field.test b/modules/simpletest/tests/upgrade/update.field.test index 60d6ae8d9..a4b11c3a1 100644 --- a/modules/simpletest/tests/upgrade/update.field.test +++ b/modules/simpletest/tests/upgrade/update.field.test @@ -34,7 +34,7 @@ class FieldUpdatePathTestCase extends UpdatePathTestCase { * Tests that the update is successful. */ public function testFilledUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The update was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The update was completed successfully.'); $expected_settings = array( 'extra_fields' => array( 'display' => array( diff --git a/modules/simpletest/tests/upgrade/update.trigger.test b/modules/simpletest/tests/upgrade/update.trigger.test index a91f7b9d8..24ac87ca1 100644 --- a/modules/simpletest/tests/upgrade/update.trigger.test +++ b/modules/simpletest/tests/upgrade/update.trigger.test @@ -32,6 +32,6 @@ class TriggerUpdatePathTestCase extends UpdatePathTestCase { * Tests that the upgrade is successful. */ public function testFilledUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); } } diff --git a/modules/simpletest/tests/upgrade/update.user.test b/modules/simpletest/tests/upgrade/update.user.test index 4993139a4..dd0fc1b82 100644 --- a/modules/simpletest/tests/upgrade/update.user.test +++ b/modules/simpletest/tests/upgrade/update.user.test @@ -29,7 +29,7 @@ class UserUpdatePathTestCase extends UpdatePathTestCase { * Tests that the update is successful. */ public function testFilledUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The update was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The update was completed successfully.'); $this->assertTrue(db_index_exists('users', 'picture'), 'The {users}.picture column has an index.'); } } diff --git a/modules/simpletest/tests/upgrade/upgrade.comment.test b/modules/simpletest/tests/upgrade/upgrade.comment.test index 5fcf0b4b2..40d893a84 100644 --- a/modules/simpletest/tests/upgrade/upgrade.comment.test +++ b/modules/simpletest/tests/upgrade/upgrade.comment.test @@ -27,6 +27,6 @@ class CommentUpgradePathTestCase extends UpgradePathTestCase { * Test a successful upgrade. */ public function testCommentUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); } } diff --git a/modules/simpletest/tests/upgrade/upgrade.filter.test b/modules/simpletest/tests/upgrade/upgrade.filter.test index 86248b74c..584f4d946 100644 --- a/modules/simpletest/tests/upgrade/upgrade.filter.test +++ b/modules/simpletest/tests/upgrade/upgrade.filter.test @@ -28,20 +28,20 @@ class FilterFormatUpgradePathTestCase extends UpgradePathTestCase { * Test a successful upgrade. */ function testFilterFormatUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); $format = filter_format_load('1'); - $this->assertTrue($format->format == '1', t('Filter format found.')); + $this->assertTrue($format->format == '1', 'Filter format found.'); $format->format = 'test_filter'; $format->name = 'Test filter'; filter_format_save($format); $format = filter_format_load('test_filter'); - $this->assertTrue($format->format == 'test_filter', t('Saved a filter format with machine name.')); + $this->assertTrue($format->format == 'test_filter', 'Saved a filter format with machine name.'); $account = user_load(4); user_save($account, array('signature_format' => 'test_filter')); $account = user_load(4); - $this->assertTrue($account->signature_format == 'test_filter', t('Signature format changed successfully to a filter format with machine name.')); + $this->assertTrue($account->signature_format == 'test_filter', 'Signature format changed successfully to a filter format with machine name.'); $delta = db_insert('block_custom') ->fields(array( @@ -50,6 +50,6 @@ class FilterFormatUpgradePathTestCase extends UpgradePathTestCase { 'format' => 'test_filter', )) ->execute(); - $this->assertTrue($delta > 0, t('Created a custom block using a filter format with machine name.')); + $this->assertTrue($delta > 0, 'Created a custom block using a filter format with machine name.'); } } diff --git a/modules/simpletest/tests/upgrade/upgrade.forum.test b/modules/simpletest/tests/upgrade/upgrade.forum.test index ebac85415..b0bbd4ed7 100644 --- a/modules/simpletest/tests/upgrade/upgrade.forum.test +++ b/modules/simpletest/tests/upgrade/upgrade.forum.test @@ -27,7 +27,7 @@ class ForumUpgradePathTestCase extends UpgradePathTestCase { * Test a successful upgrade (no negotiation). */ public function testForumUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Work around http://drupal.org/node/931512 $this->drupalPost('admin/structure/types/manage/forum/fields', array(), t('Save')); @@ -47,11 +47,11 @@ class ForumUpgradePathTestCase extends UpgradePathTestCase { ); $this->drupalPost("node/add/forum/$tid", $edit, t('Save')); $type = t('Forum topic'); - $this->assertRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), t('Forum topic was created')); + $this->assertRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), 'Forum topic was created'); // Retrieve node object, ensure that the topic was created and in the proper forum. $node = $this->drupalGetNodeByTitle($title); - $this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title))); + $this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title))); $this->assertEqual($node->taxonomy_forums[LANGUAGE_NONE][0]['tid'], $tid, 'Saved forum topic was in the expected forum'); $this->drupalGet("forum/$tid"); @@ -59,6 +59,6 @@ class ForumUpgradePathTestCase extends UpgradePathTestCase { $this->drupalLogout(); $this->drupalGet("node/add/forum/$tid"); - $this->assertResponse(200, t('User can access forum creation page.')); + $this->assertResponse(200, 'User can access forum creation page.'); } } diff --git a/modules/simpletest/tests/upgrade/upgrade.locale.test b/modules/simpletest/tests/upgrade/upgrade.locale.test index aec559de6..2a3056b06 100644 --- a/modules/simpletest/tests/upgrade/upgrade.locale.test +++ b/modules/simpletest/tests/upgrade/upgrade.locale.test @@ -27,7 +27,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase { * Test a successful upgrade (no negotiation). */ public function testLocaleUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // The home page should be in French. $this->assertPageInLanguage('', 'fr'); @@ -46,13 +46,13 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase { // LANGUAGE_NEGOTIATION_PATH_DEFAULT. $this->variable_set('language_negotiation', 1); - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // The home page should be in French. $this->assertPageInLanguage('', 'fr'); // The language switcher block should be displayed. - $this->assertRaw('block-locale-language', t('The language switcher block is displayed.')); + $this->assertRaw('block-locale-language', 'The language switcher block is displayed.'); // The French prefix should not be active because French is the default language. $this->drupalGet('fr'); @@ -75,7 +75,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase { ->condition('uid', 1) ->execute(); - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Both prefixes should be active. $this->assertPageInLanguage('fr', 'fr'); @@ -85,7 +85,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase { $this->assertPageInLanguage('', 'en'); // The language switcher block should be displayed. - $this->assertRaw('block-locale-language', t('The language switcher block is displayed.')); + $this->assertRaw('block-locale-language', 'The language switcher block is displayed.'); } /** @@ -95,13 +95,13 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase { // LANGUAGE_NEGOTIATION_DOMAIN. $this->variable_set('language_negotiation', 3); - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // The home page should be in French. $this->assertPageInLanguage('', 'fr'); // The language switcher block should be displayed. - $this->assertRaw('block-locale-language', t('The language switcher block is displayed.')); + $this->assertRaw('block-locale-language', 'The language switcher block is displayed.'); // The language switcher block should point to http://en.example.com. $language_links = $this->xpath('//ul[contains(@class, :class)]/li/a', array(':class' => 'language-switcher-locale-url')); @@ -111,7 +111,7 @@ class LocaleUpgradePathTestCase extends UpgradePathTestCase { $found_english_link = TRUE; } } - $this->assertTrue($found_english_link, t('The English link points to the correct domain.')); + $this->assertTrue($found_english_link, 'The English link points to the correct domain.'); // Both prefixes should be inactive. $this->drupalGet('en'); diff --git a/modules/simpletest/tests/upgrade/upgrade.menu.test b/modules/simpletest/tests/upgrade/upgrade.menu.test index bf28a5ffb..d9ae6c1b7 100644 --- a/modules/simpletest/tests/upgrade/upgrade.menu.test +++ b/modules/simpletest/tests/upgrade/upgrade.menu.test @@ -27,7 +27,7 @@ class MenuUpgradePathTestCase extends UpgradePathTestCase { * Test a successful upgrade. */ public function testMenuUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Test the migration of "Default menu for content" setting to individual // node types. diff --git a/modules/simpletest/tests/upgrade/upgrade.node.test b/modules/simpletest/tests/upgrade/upgrade.node.test index b49a40b0d..4ac14c574 100644 --- a/modules/simpletest/tests/upgrade/upgrade.node.test +++ b/modules/simpletest/tests/upgrade/upgrade.node.test @@ -26,7 +26,7 @@ class NodeBodyUpgradePathTestCase extends UpgradePathTestCase { * Test a successful upgrade. */ public function testNodeBodyUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); $instance = field_info_instance('node', 'body', 'story'); $this->assertIdentical($instance['required'], 0, 'The required setting was preserved during the upgrade path.'); @@ -77,7 +77,7 @@ class DisabledNodeTypeTestCase extends UpgradePathTestCase { * Tests a successful upgrade. */ public function testDisabledNodeTypeUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); $this->assertTrue(field_info_instance('comment', 'comment_body', 'comment_node_broken'), 'Comment body field instance was created for comments attached to the disabled broken node type'); } } @@ -114,7 +114,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase { * Test a successful upgrade. */ public function testPollUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Check modules page for poll $this->drupalGet('admin/modules'); @@ -126,14 +126,14 @@ class PollUpgradePathTestCase extends UpgradePathTestCase { $nbchoices = ($i % 4) + 2; for ($c = 0; $c < $nbchoices; $c++) { - $this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on poll view')); + $this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on poll view'); } // Now check that the votes are correct $this->clickLink(t('Results')); for ($c = 0; $c < $nbchoices; $c++) { - $this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on result view')); + $this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on result view'); } $nbvotes = floor (($i % 4) + 5); @@ -141,7 +141,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase { for ($c = 0; $c < $nbchoices; $c++) { $votes = floor($nbvotes / $nbchoices); if (($nbvotes % $nbchoices) > $c) $votes++; - $this->assertTrue(preg_match("/$votes vote/", $elements[$c]), t('The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c])); + $this->assertTrue(preg_match("/$votes vote/", $elements[$c]), 'The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c]); } } } diff --git a/modules/simpletest/tests/upgrade/upgrade.poll.test b/modules/simpletest/tests/upgrade/upgrade.poll.test index 9bbbf90a4..ac4ea4365 100644 --- a/modules/simpletest/tests/upgrade/upgrade.poll.test +++ b/modules/simpletest/tests/upgrade/upgrade.poll.test @@ -32,7 +32,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase { * Test a successful upgrade. */ public function testPollUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Check modules page for poll $this->drupalGet('admin/modules'); @@ -44,14 +44,14 @@ class PollUpgradePathTestCase extends UpgradePathTestCase { $nbchoices = ($i % 4) + 2; for ($c = 0; $c < $nbchoices; $c++) { - $this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on poll view')); + $this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on poll view'); } // Now check that the votes are correct $this->clickLink(t('Results')); for ($c = 0; $c < $nbchoices; $c++) { - $this->assertText("Choice $c for poll $i", t('Choice text is displayed correctly on result view')); + $this->assertText("Choice $c for poll $i", 'Choice text is displayed correctly on result view'); } $nbvotes = floor (($i % 4) + 5); @@ -59,7 +59,7 @@ class PollUpgradePathTestCase extends UpgradePathTestCase { for ($c = 0; $c < $nbchoices; $c++) { $votes = floor($nbvotes / $nbchoices); if (($nbvotes % $nbchoices) > $c) $votes++; - $this->assertTrue(preg_match("/$votes vote/", $elements[$c]), t('The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c])); + $this->assertTrue(preg_match("/$votes vote/", $elements[$c]), 'The number of votes is displayed correctly: expected ' . $votes . ', got ' . $elements[$c]); } } } diff --git a/modules/simpletest/tests/upgrade/upgrade.taxonomy.test b/modules/simpletest/tests/upgrade/upgrade.taxonomy.test index 37de08775..e0142f4b9 100644 --- a/modules/simpletest/tests/upgrade/upgrade.taxonomy.test +++ b/modules/simpletest/tests/upgrade/upgrade.taxonomy.test @@ -46,15 +46,15 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase { * Basic tests for the taxonomy upgrade. */ public function testTaxonomyUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Visit the front page to assert for PHP warning and errors. $this->drupalGet(''); // Check that taxonomy_vocabulary_node_type and taxonomy_term_node have been // removed. - $this->assertFalse(db_table_exists('taxonomy_vocabulary_node_type'), t('taxonomy_vocabulary_node_type has been removed.')); - $this->assertFalse(db_table_exists('taxonomy_term_node'), t('taxonomy_term_node has been removed.')); + $this->assertFalse(db_table_exists('taxonomy_vocabulary_node_type'), 'taxonomy_vocabulary_node_type has been removed.'); + $this->assertFalse(db_table_exists('taxonomy_term_node'), 'taxonomy_term_node has been removed.'); // Check that the node type 'page' has been associated to a taxonomy // reference field for each vocabulary. @@ -66,7 +66,7 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase { $inst_keys = array_keys($instances); sort($voc_keys); sort($inst_keys); - $this->assertEqual($voc_keys, $inst_keys, t('Node type page has instances for every vocabulary.')); + $this->assertEqual($voc_keys, $inst_keys, 'Node type page has instances for every vocabulary.'); // Ensure instance variables are getting through. foreach ($instances as $instance) { @@ -80,13 +80,13 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase { // the taxonomyextra field. $instances = $this->instanceVocabularies('node', 'story'); $field_names = array_flip($instances); - $this->assertEqual(count($field_names), 1, t('Only one taxonomy term field instance exists for story nodes')); - $this->assertEqual(key($field_names), 'taxonomyextra', t('Only the excess taxonomy term field is used on story nodes')); + $this->assertEqual(count($field_names), 1, 'Only one taxonomy term field instance exists for story nodes'); + $this->assertEqual(key($field_names), 'taxonomyextra', 'Only the excess taxonomy term field is used on story nodes'); // Check that the node type 'poll' has been associated to no taxonomy // reference field. $instances = $this->instanceVocabularies('node', 'poll'); - $this->assertTrue(empty($instances), t('Node type poll has no taxonomy term reference field instances.')); + $this->assertTrue(empty($instances), 'Node type poll has no taxonomy term reference field instances.'); // Check that each node of type 'page' and 'story' is associated to all the // terms except terms whose ID is equal to the node ID or is equal to the @@ -147,14 +147,14 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase { if (!$should_be_displayed) { // Look for any link with the term path. $links = $this->xpath('//a[@href=:term_path]', array(':term_path' => $term_path)); - $this->assertFalse($links, t('Term %name (@field) is not displayed on node %nid', $args)); + $this->assertFalse($links, format_string('Term %name (@field) is not displayed on node %nid', $args)); } else { // Look for a link with the term path inside the correct field. // We search for "SPACE + class + SPACE" to avoid matching a substring // of the class. $links = $this->xpath('//div[contains(concat(" ", normalize-space(@class), " "), :field_class)]//a[@href=:term_path]', array(':field_class' => ' ' . $field_class . ' ', ':term_path' => $term_path)); - $this->assertTrue($links, t('Term %name (@field) is displayed on node %nid', $args)); + $this->assertTrue($links, format_string('Term %name (@field) is displayed on node %nid', $args)); } } @@ -162,7 +162,7 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase { // ID 0. Make sure we ignored this instead of generating a bogus term. if ($node->nid == 1) { $link = l($term->name, 'taxonomy/term/0'); - $this->assertNoRaw($link, t('Bogus term (tid 0) is not displayed on node 1 vid %old_vid.', $args)); + $this->assertNoRaw($link, format_string('Bogus term (tid 0) is not displayed on node 1 vid %old_vid.', $args)); } // The first 12 nodes have two revisions. For nodes with @@ -170,7 +170,7 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase { // to terms whose ID is equal to the node ID or 49 less the node ID. $revisions = node_revision_list($node); if ($node->nid < 13) { - $this->assertEqual(count($revisions), 2, t('Node %nid has two revisions.', $args)); + $this->assertEqual(count($revisions), 2, format_string('Node %nid has two revisions.', $args)); $last_rev = end($revisions); $args['%old_vid'] = $last_rev->vid; @@ -183,13 +183,13 @@ class UpgradePathTaxonomyTestCase extends UpgradePathTestCase { $term = $terms[$node->nid]; $link = l($term->name, 'taxonomy/term/' . $term->tid); - $this->assertRaw($link, t('Term %name (@field) is displayed on node %nid vid %old_vid.', $args)); + $this->assertRaw($link, format_string('Term %name (@field) is displayed on node %nid vid %old_vid.', $args)); $term = $terms[49-$node->nid]; $link = l($term->name, 'taxonomy/term/' . $term->tid); - $this->assertRaw($link, t('Term %name (@field) is displayed on node %nid %old_vid.', $args)); + $this->assertRaw($link, format_string('Term %name (@field) is displayed on node %nid %old_vid.', $args)); } else { - $this->assertEqual(count($revisions), 1, t('Node %nid has one revision.', $args)); + $this->assertEqual(count($revisions), 1, format_string('Node %nid has one revision.', $args)); } } } diff --git a/modules/simpletest/tests/upgrade/upgrade.test b/modules/simpletest/tests/upgrade/upgrade.test index cc849aa79..784a09178 100644 --- a/modules/simpletest/tests/upgrade/upgrade.test +++ b/modules/simpletest/tests/upgrade/upgrade.test @@ -256,7 +256,7 @@ abstract class UpgradePathTestCase extends DrupalWebTestCase { // Check if there still are pending updates. $this->drupalGet($update_url, array('external' => TRUE)); $this->drupalPost(NULL, array(), t('Continue')); - if (!$this->assertText(t('No pending updates.'), t('No pending updates at the end of the update process.'))) { + if (!$this->assertText(t('No pending updates.'), 'No pending updates at the end of the update process.')) { return FALSE; } @@ -358,14 +358,14 @@ class BasicUpgradePath extends UpgradePathTestCase { // Destroy a table that the upgrade process needs. db_drop_table('access'); // Assert that the upgrade fails. - $this->assertFalse($this->performUpgrade(FALSE) && $this->pendingUpdates, t('A failed upgrade should return messages.')); + $this->assertFalse($this->performUpgrade(FALSE) && $this->pendingUpdates, 'A failed upgrade should return messages.'); } /** * Test a successful upgrade. */ public function testBasicUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Hit the frontpage. $this->drupalGet(''); @@ -374,7 +374,7 @@ class BasicUpgradePath extends UpgradePathTestCase { // Verify that we are still logged in. $this->drupalGet('user'); $this->clickLink(t('Edit')); - $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.')); + $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.'); // Logout and verify that we can login back in with our initial password. $this->drupalLogout(); @@ -394,7 +394,7 @@ class BasicUpgradePath extends UpgradePathTestCase { )); // Test that the site name is correctly displayed. - $this->assertText('Drupal 6', t('The site name is correctly displayed.')); + $this->assertText('Drupal 6', 'The site name is correctly displayed.'); // Verify that the main admin sections are available. $this->drupalGet('admin'); @@ -408,11 +408,11 @@ class BasicUpgradePath extends UpgradePathTestCase { // Confirm that no {menu_links} entry exists for user/autocomplete. $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField(); - $this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete')); + $this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete'); // Test that the environment after the upgrade is in a consistent status. $update_d6 = variable_get('update_d6', FALSE); - $this->assertFalse($update_d6, t('The D6 upgrade flag variable has been correctly disabled.')); + $this->assertFalse($update_d6, 'The D6 upgrade flag variable has been correctly disabled.'); } } @@ -446,7 +446,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase { * Tests a successful point release update. */ public function testBasicStandardUpdate() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Hit the frontpage. $this->drupalGet(''); @@ -455,7 +455,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase { // Verify that we are still logged in. $this->drupalGet('user'); $this->clickLink(t('Edit')); - $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.')); + $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.'); // Logout and verify that we can login back in with our initial password. $this->drupalLogout(); @@ -475,7 +475,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase { )); // Test that the site name is correctly displayed. - $this->assertText('Drupal', t('The site name is correctly displayed.')); + $this->assertText('Drupal', 'The site name is correctly displayed.'); // Verify that the main admin sections are available. $this->drupalGet('admin'); @@ -489,7 +489,7 @@ class BasicStandardUpdatePath extends UpdatePathTestCase { // Confirm that no {menu_links} entry exists for user/autocomplete. $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField(); - $this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete')); + $this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete'); } } @@ -522,7 +522,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase { * Tests a successful point release update. */ public function testBasicMinimalUpdate() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Hit the frontpage. $this->drupalGet(''); @@ -531,7 +531,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase { // Verify that we are still logged in. $this->drupalGet('user'); $this->clickLink(t('Edit')); - $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.')); + $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.'); // Logout and verify that we can login back in with our initial password. $this->drupalLogout(); @@ -551,7 +551,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase { )); // Test that the site name is correctly displayed. - $this->assertText('Drupal', t('The site name is correctly displayed.')); + $this->assertText('Drupal', 'The site name is correctly displayed.'); // Verify that the main admin sections are available. $this->drupalGet('admin'); @@ -565,7 +565,7 @@ class BasicMinimalUpdatePath extends UpdatePathTestCase { // Confirm that no {menu_links} entry exists for user/autocomplete. $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField(); - $this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete')); + $this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete'); // Confirm that a date format that just differs in the case can be added. $admin_date_format = 'j M y'; @@ -613,7 +613,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase { * Tests a successful point release update. */ public function testFilledStandardUpdate() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Hit the frontpage. $this->drupalGet(''); @@ -622,7 +622,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase { // Verify that we are still logged in. $this->drupalGet('user'); $this->clickLink(t('Edit')); - $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.')); + $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.'); // Logout and verify that we can login back in with our initial password. $this->drupalLogout(); @@ -642,7 +642,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase { )); // Test that the site name is correctly displayed. - $this->assertText('Drupal', t('The site name is correctly displayed.')); + $this->assertText('Drupal', 'The site name is correctly displayed.'); // Verify that the main admin sections are available. $this->drupalGet('admin'); @@ -656,7 +656,7 @@ class FilledStandardUpdatePath extends UpdatePathTestCase { // Confirm that no {menu_links} entry exists for user/autocomplete. $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField(); - $this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete')); + $this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete'); } } @@ -689,7 +689,7 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase { * Tests a successful point release update. */ public function testFilledStandardUpdate() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // Hit the frontpage. $this->drupalGet(''); @@ -698,7 +698,7 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase { // Verify that we are still logged in. $this->drupalGet('user'); $this->clickLink(t('Edit')); - $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), t('We are still logged in as admin at the end of the upgrade.')); + $this->assertEqual($this->getUrl(), url('user/1/edit', array('absolute' => TRUE)), 'We are still logged in as admin at the end of the upgrade.'); // Logout and verify that we can login back in with our initial password. $this->drupalLogout(); @@ -718,7 +718,7 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase { )); // Test that the site name is correctly displayed. - $this->assertText('Drupal', t('The site name is correctly displayed.')); + $this->assertText('Drupal', 'The site name is correctly displayed.'); // Verify that the main admin sections are available. $this->drupalGet('admin'); @@ -732,6 +732,6 @@ class FilledMinimalUpdatePath extends UpdatePathTestCase { // Confirm that no {menu_links} entry exists for user/autocomplete. $result = db_query('SELECT COUNT(*) FROM {menu_links} WHERE link_path = :user_autocomplete', array(':user_autocomplete' => 'user/autocomplete'))->fetchField(); - $this->assertFalse($result, t('No {menu_links} entry exists for user/autocomplete')); + $this->assertFalse($result, 'No {menu_links} entry exists for user/autocomplete'); } } diff --git a/modules/simpletest/tests/upgrade/upgrade.translatable.test b/modules/simpletest/tests/upgrade/upgrade.translatable.test index c9360f3b3..6fefb0ff0 100644 --- a/modules/simpletest/tests/upgrade/upgrade.translatable.test +++ b/modules/simpletest/tests/upgrade/upgrade.translatable.test @@ -28,7 +28,7 @@ class TranslatableUpgradePathTestCase extends UpgradePathTestCase { * Test a successful upgrade (no negotiation). */ public function testTranslatableUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); // The D6 database contains the english node "First translatable page" with // nid 53. @@ -39,12 +39,12 @@ class TranslatableUpgradePathTestCase extends UpgradePathTestCase { // Check whether the node displays properly. $this->drupalGet("node/$nid"); - $this->assertText($body, t('Translatable node body displays properly')); + $this->assertText($body, 'Translatable node body displays properly'); // Retrieve node object, ensure that both the body and the teaser has // survived upgrade properly. $node = $this->drupalGetNodeByTitle($title); - $this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title))); + $this->assertTrue($node != NULL, format_string('Node @title was loaded', array('@title' => $title))); $this->assertEqual($node->body[LANGUAGE_NONE][0]['value'], $body, 'Body of the node survived upgrade properly'); $this->assertEqual($node->body[LANGUAGE_NONE][0]['summary'], $teaser, 'Teaser of the node survived upgrade properly'); } diff --git a/modules/simpletest/tests/upgrade/upgrade.trigger.test b/modules/simpletest/tests/upgrade/upgrade.trigger.test index 7413bed52..ef2394142 100644 --- a/modules/simpletest/tests/upgrade/upgrade.trigger.test +++ b/modules/simpletest/tests/upgrade/upgrade.trigger.test @@ -29,7 +29,7 @@ class UpgradePathTriggerTestCase extends UpgradePathTestCase { * Basic tests for the trigger upgrade. */ public function testTaxonomyUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); $this->drupalGet('admin/structure/trigger/node'); $this->assertRaw('<td>'. t('Make post sticky') .'</td>'); $this->assertRaw('<td>'. t('Publish post') .'</td>'); diff --git a/modules/simpletest/tests/upgrade/upgrade.upload.test b/modules/simpletest/tests/upgrade/upgrade.upload.test index 276fae4e1..be352bd42 100644 --- a/modules/simpletest/tests/upgrade/upgrade.upload.test +++ b/modules/simpletest/tests/upgrade/upgrade.upload.test @@ -29,7 +29,7 @@ class UploadUpgradePathTestCase extends UpgradePathTestCase { * Test a successful upgrade. */ public function testUploadUpgrade() { - $this->assertTrue($this->performUpgrade(), t('The upgrade was completed successfully.')); + $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.'); $query = new EntityFieldQuery(); $query->entityCondition('entity_type', 'node'); $query->entityCondition('bundle', 'page'); |