diff options
author | Jennifer Hodgdon <yahgrp@poplarware.com> | 2013-05-21 12:09:39 -0700 |
---|---|---|
committer | Jennifer Hodgdon <yahgrp@poplarware.com> | 2013-05-21 12:09:39 -0700 |
commit | 89f66ab5131d32a5d15099764ab0f79789297db8 (patch) | |
tree | f81b3b79d3894416c923cfd7587b1418ba4350d4 /modules/system | |
parent | 967cfe402bf4b6de8d5bc5ac09b36b9eb0317b56 (diff) | |
download | brdo-89f66ab5131d32a5d15099764ab0f79789297db8.tar.gz brdo-89f66ab5131d32a5d15099764ab0f79789297db8.tar.bz2 |
Issue #1797452 by dcam, izus, xjm, Lars Toomre: Remove t() from test asserts in various system tests
Diffstat (limited to 'modules/system')
-rw-r--r-- | modules/system/system.test | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/modules/system/system.test b/modules/system/system.test index 7b47a40e5..c19dc0cb4 100644 --- a/modules/system/system.test +++ b/modules/system/system.test @@ -31,9 +31,9 @@ class ModuleTestCase extends DrupalWebTestCase { $tables = db_find_tables(Database::getConnection()->prefixTables('{' . $base_table . '}') . '%'); if ($count) { - return $this->assertTrue($tables, t('Tables matching "@base_table" found.', array('@base_table' => $base_table))); + return $this->assertTrue($tables, format_string('Tables matching "@base_table" found.', array('@base_table' => $base_table))); } - return $this->assertFalse($tables, t('Tables matching "@base_table" not found.', array('@base_table' => $base_table))); + return $this->assertFalse($tables, format_string('Tables matching "@base_table" not found.', array('@base_table' => $base_table))); } /** @@ -50,7 +50,7 @@ class ModuleTestCase extends DrupalWebTestCase { $tables_exist = FALSE; } } - return $this->assertTrue($tables_exist, t('All database tables defined by the @module module exist.', array('@module' => $module))); + return $this->assertTrue($tables_exist, format_string('All database tables defined by the @module module exist.', array('@module' => $module))); } /** @@ -67,7 +67,7 @@ class ModuleTestCase extends DrupalWebTestCase { $tables_exist = TRUE; } } - return $this->assertFalse($tables_exist, t('None of the database tables defined by the @module module exist.', array('@module' => $module))); + return $this->assertFalse($tables_exist, format_string('None of the database tables defined by the @module module exist.', array('@module' => $module))); } /** @@ -87,7 +87,7 @@ class ModuleTestCase extends DrupalWebTestCase { else { $message = 'Module "@module" is not enabled.'; } - $this->assertEqual(module_exists($module), $enabled, t($message, array('@module' => $module))); + $this->assertEqual(module_exists($module), $enabled, format_string($message, array('@module' => $module))); } } @@ -122,7 +122,7 @@ class ModuleTestCase extends DrupalWebTestCase { ->countQuery() ->execute() ->fetchField(); - $this->assertTrue($count > 0, t('watchdog table contains @count rows for @message', array('@count' => $count, '@message' => $message))); + $this->assertTrue($count > 0, format_string('watchdog table contains @count rows for @message', array('@count' => $count, '@message' => $message))); } } @@ -152,7 +152,7 @@ class EnableDisableTestCase extends ModuleTestCase { unset($modules[$name]); } } - $this->assertTrue(count($modules), t('Found @count core modules that we can try to enable in this test.', array('@count' => count($modules)))); + $this->assertTrue(count($modules), format_string('Found @count core modules that we can try to enable in this test.', array('@count' => count($modules)))); // Enable the dblog module first, since we will be asserting the presence // of log messages throughout the test. @@ -202,7 +202,7 @@ class EnableDisableTestCase extends ModuleTestCase { if (count($modules_to_enable) > 1) { $this->drupalPost(NULL, array(), t('Continue')); } - $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.')); + $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.'); // Check that hook_modules_installed() and hook_modules_enabled() were // invoked with the expected list of modules, that each module's @@ -268,7 +268,7 @@ class EnableDisableTestCase extends ModuleTestCase { $edit['modules[Core][' . $name . '][enable]'] = $name; } $this->drupalPost('admin/modules', $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.')); + $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.'); } /** @@ -315,7 +315,7 @@ class EnableDisableTestCase extends ModuleTestCase { $edit = array(); $edit['modules[Core][' . $module . '][enable]'] = FALSE; $this->drupalPost('admin/modules', $edit, t('Save configuration')); - $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.')); + $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.'); $this->assertModules(array($module), FALSE); // Check that the appropriate hook was fired and the appropriate log @@ -331,7 +331,7 @@ class EnableDisableTestCase extends ModuleTestCase { $edit['uninstall[' . $module . ']'] = $module; $this->drupalPost('admin/modules/uninstall', $edit, t('Uninstall')); $this->drupalPost(NULL, NULL, t('Uninstall')); - $this->assertText(t('The selected modules have been uninstalled.'), t('Modules status has been updated.')); + $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); $this->assertModules(array($module), FALSE); // Check that the appropriate hook was fired and the appropriate log @@ -372,7 +372,7 @@ class HookRequirementsTestCase extends ModuleTestCase { $this->drupalPost('admin/modules', $edit, t('Save configuration')); // Makes sure the module was NOT installed. - $this->assertText(t('Requirements 1 Test failed requirements'), t('Modules status has been updated.')); + $this->assertText(t('Requirements 1 Test failed requirements'), 'Modules status has been updated.'); $this->assertModules(array('requirements1_test'), FALSE); } } @@ -397,7 +397,7 @@ class ModuleDependencyTestCase extends ModuleTestCase { $edit = array(); $edit['modules[Core][translation][enable]'] = 'translation'; $this->drupalPost('admin/modules', $edit, t('Save configuration')); - $this->assertText(t('Some required modules must be enabled'), t('Dependency required.')); + $this->assertText(t('Some required modules must be enabled'), 'Dependency required.'); $this->assertModules(array('translation', 'locale'), FALSE); @@ -406,7 +406,7 @@ class ModuleDependencyTestCase extends ModuleTestCase { $this->assertTableCount('locale', FALSE); $this->drupalPost(NULL, NULL, t('Continue')); - $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.')); + $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.'); $this->assertModules(array('translation', 'locale'), TRUE); @@ -422,9 +422,9 @@ class ModuleDependencyTestCase extends ModuleTestCase { // Test that the system_dependencies_test module is marked // as missing a dependency. $this->drupalGet('admin/modules'); - $this->assertRaw(t('@module (<span class="admin-missing">missing</span>)', array('@module' => drupal_ucfirst('_missing_dependency'))), t('A module with missing dependencies is marked as such.')); + $this->assertRaw(t('@module (<span class="admin-missing">missing</span>)', array('@module' => drupal_ucfirst('_missing_dependency'))), 'A module with missing dependencies is marked as such.'); $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[Testing][system_dependencies_test][enable]"]'); - $this->assert(count($checkbox) == 1, t('Checkbox for the module is disabled.')); + $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.'); // Force enable the system_dependencies_test module. module_enable(array('system_dependencies_test'), FALSE); @@ -432,7 +432,7 @@ class ModuleDependencyTestCase extends ModuleTestCase { // Verify that the module is forced to be disabled when submitting // the module page. $this->drupalPost('admin/modules', array(), t('Save configuration')); - $this->assertText(t('The @module module is missing, so the following module will be disabled: @depends.', array('@module' => '_missing_dependency', '@depends' => 'system_dependencies_test')), t('The module missing dependencies will be disabled.')); + $this->assertText(t('The @module module is missing, so the following module will be disabled: @depends.', array('@module' => '_missing_dependency', '@depends' => 'system_dependencies_test')), 'The module missing dependencies will be disabled.'); // Confirm. $this->drupalPost(NULL, NULL, t('Continue')); @@ -453,7 +453,7 @@ class ModuleDependencyTestCase extends ModuleTestCase { '@version' => '1.0', )), 'A module that depends on an incompatible version of a module is marked as such.'); $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[Testing][system_incompatible_module_version_dependencies_test][enable]"]'); - $this->assert(count($checkbox) == 1, t('Checkbox for the module is disabled.')); + $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.'); } /** @@ -467,7 +467,7 @@ class ModuleDependencyTestCase extends ModuleTestCase { '@module' => 'System incompatible core version test', )), 'A module that depends on a module with an incompatible core version is marked as such.'); $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="modules[Testing][system_incompatible_core_version_dependencies_test][enable]"]'); - $this->assert(count($checkbox) == 1, t('Checkbox for the module is disabled.')); + $this->assert(count($checkbox) == 1, 'Checkbox for the module is disabled.'); } /** @@ -484,7 +484,7 @@ class ModuleDependencyTestCase extends ModuleTestCase { $this->drupalPost('admin/modules', $edit, t('Save configuration')); // Makes sure the modules were NOT installed. - $this->assertText(t('Requirements 1 Test failed requirements'), t('Modules status has been updated.')); + $this->assertText(t('Requirements 1 Test failed requirements'), 'Modules status has been updated.'); $this->assertModules(array('requirements1_test'), FALSE); $this->assertModules(array('requirements2_test'), FALSE); @@ -543,18 +543,18 @@ class ModuleDependencyTestCase extends ModuleTestCase { // Check that the taxonomy module cannot be uninstalled. $this->drupalGet('admin/modules/uninstall'); $checkbox = $this->xpath('//input[@type="checkbox" and @disabled="disabled" and @name="uninstall[comment]"]'); - $this->assert(count($checkbox) == 1, t('Checkbox for uninstalling the comment module is disabled.')); + $this->assert(count($checkbox) == 1, 'Checkbox for uninstalling the comment module is disabled.'); // Uninstall the forum module, and check that taxonomy now can also be // uninstalled. $edit = array('uninstall[forum]' => 'forum'); $this->drupalPost('admin/modules/uninstall', $edit, t('Uninstall')); $this->drupalPost(NULL, NULL, t('Uninstall')); - $this->assertText(t('The selected modules have been uninstalled.'), t('Modules status has been updated.')); + $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); $edit = array('uninstall[comment]' => 'comment'); $this->drupalPost('admin/modules/uninstall', $edit, t('Uninstall')); $this->drupalPost(NULL, NULL, t('Uninstall')); - $this->assertText(t('The selected modules have been uninstalled.'), t('Modules status has been updated.')); + $this->assertText(t('The selected modules have been uninstalled.'), 'Modules status has been updated.'); } } @@ -643,7 +643,7 @@ class ModuleRequiredTestCase extends ModuleTestCase { if (!empty($info['required'])) { $field_name = "modules[{$info['package']}][$module][enable]"; if (empty($info['hidden'])) { - $this->assertFieldByXPath("//input[@name='$field_name' and @disabled='disabled' and @checked='checked']", '', t('Field @name was disabled and checked.', array('@name' => $field_name))); + $this->assertFieldByXPath("//input[@name='$field_name' and @disabled='disabled' and @checked='checked']", '', format_string('Field @name was disabled and checked.', array('@name' => $field_name))); } else { $this->assertNoFieldByName($field_name); |