summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJennifer Hodgdon <yahgrp@poplarware.com>2013-04-26 08:53:13 -0700
committerJennifer Hodgdon <yahgrp@poplarware.com>2013-04-26 08:53:13 -0700
commit8ee9e5ab409021fbd250c7a093691c5a10f36ae2 (patch)
tree7db56cae21674a4edfe7dd5bd5a39484803580a7 /modules
parentb61b0d72791f4e4f78acced2efd04a5dbe0f2723 (diff)
downloadbrdo-8ee9e5ab409021fbd250c7a093691c5a10f36ae2.tar.gz
brdo-8ee9e5ab409021fbd250c7a093691c5a10f36ae2.tar.bz2
Issue #1797926 by dcam, izus, Lars Toomre: Remove t() from test asserts in misc system tests
Diffstat (limited to 'modules')
-rw-r--r--modules/locale/locale.test4
-rw-r--r--modules/simpletest/tests/error.test22
-rw-r--r--modules/simpletest/tests/password.test20
-rw-r--r--modules/simpletest/tests/unicode.test14
-rw-r--r--modules/system/system.test200
5 files changed, 130 insertions, 130 deletions
diff --git a/modules/locale/locale.test b/modules/locale/locale.test
index e4821d13c..d9caa9e02 100644
--- a/modules/locale/locale.test
+++ b/modules/locale/locale.test
@@ -2934,10 +2934,10 @@ class LocaleDateFormatsFunctionalTest extends DrupalWebTestCase {
// Configure format for the node posted date changes with the language.
$this->drupalGet('node/' . $node->nid);
$english_date = format_date($node->created, 'custom', 'j M Y');
- $this->assertText($english_date, t('English date format appears'));
+ $this->assertText($english_date, 'English date format appears');
$this->drupalGet('fr/node/' . $node->nid);
$french_date = format_date($node->created, 'custom', 'd.m.Y');
- $this->assertText($french_date, t('French date format appears'));
+ $this->assertText($french_date, 'French date format appears');
}
}
diff --git a/modules/simpletest/tests/error.test b/modules/simpletest/tests/error.test
index 5b6b04b9e..f946e82f1 100644
--- a/modules/simpletest/tests/error.test
+++ b/modules/simpletest/tests/error.test
@@ -42,7 +42,7 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
// Set error reporting to collect notices.
variable_set('error_level', ERROR_REPORTING_DISPLAY_ALL);
$this->drupalGet('error-test/generate-warnings');
- $this->assertResponse(200, t('Received expected HTTP status code.'));
+ $this->assertResponse(200, 'Received expected HTTP status code.');
$this->assertErrorMessage($error_notice);
$this->assertErrorMessage($error_warning);
$this->assertErrorMessage($error_user_notice);
@@ -50,7 +50,7 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
// Set error reporting to not collect notices.
variable_set('error_level', ERROR_REPORTING_DISPLAY_SOME);
$this->drupalGet('error-test/generate-warnings');
- $this->assertResponse(200, t('Received expected HTTP status code.'));
+ $this->assertResponse(200, 'Received expected HTTP status code.');
$this->assertNoErrorMessage($error_notice);
$this->assertErrorMessage($error_warning);
$this->assertErrorMessage($error_user_notice);
@@ -58,7 +58,7 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
// Set error reporting to not show any errors.
variable_set('error_level', ERROR_REPORTING_HIDE);
$this->drupalGet('error-test/generate-warnings');
- $this->assertResponse(200, t('Received expected HTTP status code.'));
+ $this->assertResponse(200, 'Received expected HTTP status code.');
$this->assertNoErrorMessage($error_notice);
$this->assertNoErrorMessage($error_warning);
$this->assertNoErrorMessage($error_user_notice);
@@ -84,17 +84,17 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
);
$this->drupalGet('error-test/trigger-exception');
- $this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), t('Received expected HTTP status line.'));
+ $this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), 'Received expected HTTP status line.');
$this->assertErrorMessage($error_exception);
$this->drupalGet('error-test/trigger-pdo-exception');
- $this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), t('Received expected HTTP status line.'));
+ $this->assertTrue(strpos($this->drupalGetHeader(':status'), '500 Service unavailable (with message)'), 'Received expected HTTP status line.');
// We cannot use assertErrorMessage() since the extact error reported
// varies from database to database. Check that the SQL string is displayed.
- $this->assertText($error_pdo_exception['%type'], t('Found %type in error page.', $error_pdo_exception));
- $this->assertText($error_pdo_exception['!message'], t('Found !message in error page.', $error_pdo_exception));
- $error_details = t('in %function (line ', $error_pdo_exception);
- $this->assertRaw($error_details, t("Found '!message' in error page.", array('!message' => $error_details)));
+ $this->assertText($error_pdo_exception['%type'], format_string('Found %type in error page.', $error_pdo_exception));
+ $this->assertText($error_pdo_exception['!message'], format_string('Found !message in error page.', $error_pdo_exception));
+ $error_details = format_string('in %function (line ', $error_pdo_exception);
+ $this->assertRaw($error_details, format_string("Found '!message' in error page.", array('!message' => $error_details)));
}
/**
@@ -102,7 +102,7 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
*/
function assertErrorMessage(array $error) {
$message = t('%type: !message in %function (line ', $error);
- $this->assertRaw($message, t('Found error message: !message.', array('!message' => $message)));
+ $this->assertRaw($message, format_string('Found error message: !message.', array('!message' => $message)));
}
/**
@@ -110,7 +110,7 @@ class DrupalErrorHandlerTestCase extends DrupalWebTestCase {
*/
function assertNoErrorMessage(array $error) {
$message = t('%type: !message in %function (line ', $error);
- $this->assertNoRaw($message, t('Did not find error message: !message.', array('!message' => $message)));
+ $this->assertNoRaw($message, format_string('Did not find error message: !message.', array('!message' => $message)));
}
}
diff --git a/modules/simpletest/tests/password.test b/modules/simpletest/tests/password.test
index e100c2ef6..5259d19e8 100644
--- a/modules/simpletest/tests/password.test
+++ b/modules/simpletest/tests/password.test
@@ -35,26 +35,26 @@ class PasswordHashingTest extends DrupalWebTestCase {
$password = 'baz';
$account = (object) array('name' => 'foo', 'pass' => md5($password));
// The md5 password should be flagged as needing an update.
- $this->assertTrue(user_needs_new_hash($account), t('User with md5 password needs a new hash.'));
+ $this->assertTrue(user_needs_new_hash($account), 'User with md5 password needs a new hash.');
// Re-hash the password.
$old_hash = $account->pass;
$account->pass = user_hash_password($password);
- $this->assertIdentical(_password_get_count_log2($account->pass), DRUPAL_MIN_HASH_COUNT, t('Re-hashed password has the minimum number of log2 iterations.'));
- $this->assertTrue($account->pass != $old_hash, t('Password hash changed.'));
- $this->assertTrue(user_check_password($password, $account), t('Password check succeeds.'));
+ $this->assertIdentical(_password_get_count_log2($account->pass), DRUPAL_MIN_HASH_COUNT, 'Re-hashed password has the minimum number of log2 iterations.');
+ $this->assertTrue($account->pass != $old_hash, 'Password hash changed.');
+ $this->assertTrue(user_check_password($password, $account), 'Password check succeeds.');
// Since the log2 setting hasn't changed and the user has a valid password,
// user_needs_new_hash() should return FALSE.
- $this->assertFalse(user_needs_new_hash($account), t('User does not need a new hash.'));
+ $this->assertFalse(user_needs_new_hash($account), 'User does not need a new hash.');
// Increment the log2 iteration to MIN + 1.
variable_set('password_count_log2', DRUPAL_MIN_HASH_COUNT + 1);
- $this->assertTrue(user_needs_new_hash($account), t('User needs a new hash after incrementing the log2 count.'));
+ $this->assertTrue(user_needs_new_hash($account), 'User needs a new hash after incrementing the log2 count.');
// Re-hash the password.
$old_hash = $account->pass;
$account->pass = user_hash_password($password);
- $this->assertIdentical(_password_get_count_log2($account->pass), DRUPAL_MIN_HASH_COUNT + 1, t('Re-hashed password has the correct number of log2 iterations.'));
- $this->assertTrue($account->pass != $old_hash, t('Password hash changed again.'));
+ $this->assertIdentical(_password_get_count_log2($account->pass), DRUPAL_MIN_HASH_COUNT + 1, 'Re-hashed password has the correct number of log2 iterations.');
+ $this->assertTrue($account->pass != $old_hash, 'Password hash changed again.');
// Now the hash should be OK.
- $this->assertFalse(user_needs_new_hash($account), t('Re-hashed password does not need a new hash.'));
- $this->assertTrue(user_check_password($password, $account), t('Password check succeeds with re-hashed password.'));
+ $this->assertFalse(user_needs_new_hash($account), 'Re-hashed password does not need a new hash.');
+ $this->assertTrue(user_check_password($password, $account), 'Password check succeeds with re-hashed password.');
}
}
diff --git a/modules/simpletest/tests/unicode.test b/modules/simpletest/tests/unicode.test
index cf7991b6c..4aaf26db7 100644
--- a/modules/simpletest/tests/unicode.test
+++ b/modules/simpletest/tests/unicode.test
@@ -80,7 +80,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
}
foreach ($testcase as $input => $output) {
- $this->assertEqual(drupal_strtolower($input), $output, t('%input is lowercased as %output', array('%input' => $input, '%output' => $output)));
+ $this->assertEqual(drupal_strtolower($input), $output, format_string('%input is lowercased as %output', array('%input' => $input, '%output' => $output)));
}
}
@@ -94,7 +94,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
}
foreach ($testcase as $input => $output) {
- $this->assertEqual(drupal_strtoupper($input), $output, t('%input is uppercased as %output', array('%input' => $input, '%output' => $output)));
+ $this->assertEqual(drupal_strtoupper($input), $output, format_string('%input is uppercased as %output', array('%input' => $input, '%output' => $output)));
}
}
@@ -110,7 +110,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
}
foreach ($testcase as $input => $output) {
- $this->assertEqual(drupal_ucfirst($input), $output, t('%input is ucfirst-ed as %output', array('%input' => $input, '%output' => $output)));
+ $this->assertEqual(drupal_ucfirst($input), $output, format_string('%input is ucfirst-ed as %output', array('%input' => $input, '%output' => $output)));
}
}
@@ -121,7 +121,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
);
foreach ($testcase as $input => $output) {
- $this->assertEqual(drupal_strlen($input), $output, t('%input length is %output', array('%input' => $input, '%output' => $output)));
+ $this->assertEqual(drupal_strlen($input), $output, format_string('%input length is %output', array('%input' => $input, '%output' => $output)));
}
}
@@ -181,7 +181,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
foreach ($testcase as $test) {
list($input, $start, $length, $output) = $test;
$result = drupal_substr($input, $start, $length);
- $this->assertEqual($result, $output, t('%input substring at offset %offset for %length characters is %output (got %result)', array('%input' => $input, '%offset' => $start, '%length' => $length, '%output' => $output, '%result' => $result)));
+ $this->assertEqual($result, $output, format_string('%input substring at offset %offset for %length characters is %output (got %result)', array('%input' => $input, '%offset' => $start, '%length' => $length, '%output' => $output, '%result' => $result)));
}
}
@@ -213,7 +213,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
'&euro;' => '€',
);
foreach ($testcase as $input => $output) {
- $this->assertEqual(decode_entities($input), $output, t('Make sure the decoded entity of @input is @output', array('@input' => $input, '@output' => $output)));
+ $this->assertEqual(decode_entities($input), $output, format_string('Make sure the decoded entity of @input is @output', array('@input' => $input, '@output' => $output)));
}
}
@@ -299,7 +299,7 @@ class UnicodeUnitTest extends DrupalUnitTestCase {
foreach ($cases as $case) {
list($input, $max_length, $expected) = $case;
$output = truncate_utf8($input, $max_length, $wordsafe, $ellipsis);
- $this->assertEqual($output, $expected, t('%input truncate to %length characters with %wordsafe, %ellipsis is %expected (got %output)', array('%input' => $input, '%length' => $max_length, '%output' => $output, '%expected' => $expected, '%wordsafe' => ($wordsafe ? 'word-safe' : 'not word-safe'), '%ellipsis' => ($ellipsis ? 'ellipsis' : 'not ellipsis'))));
+ $this->assertEqual($output, $expected, format_string('%input truncate to %length characters with %wordsafe, %ellipsis is %expected (got %output)', array('%input' => $input, '%length' => $max_length, '%output' => $output, '%expected' => $expected, '%wordsafe' => ($wordsafe ? 'word-safe' : 'not word-safe'), '%ellipsis' => ($ellipsis ? 'ellipsis' : 'not ellipsis'))));
}
}
}
diff --git a/modules/system/system.test b/modules/system/system.test
index 84ed269bc..e7f38d5c5 100644
--- a/modules/system/system.test
+++ b/modules/system/system.test
@@ -783,14 +783,14 @@ class CronRunTestCase extends DrupalWebTestCase {
variable_set('cron_last', $cron_last);
variable_set('cron_safe_threshold', $cron_safe_threshold);
$this->drupalGet('');
- $this->assertTrue($cron_last == variable_get('cron_last', NULL), t('Cron does not run when the cron threshold is not passed.'));
+ $this->assertTrue($cron_last == variable_get('cron_last', NULL), 'Cron does not run when the cron threshold is not passed.');
// Test if cron runs when the cron threshold was passed.
$cron_last = time() - 200;
variable_set('cron_last', $cron_last);
$this->drupalGet('');
sleep(1);
- $this->assertTrue($cron_last < variable_get('cron_last', NULL), t('Cron runs when the cron threshold is passed.'));
+ $this->assertTrue($cron_last < variable_get('cron_last', NULL), 'Cron runs when the cron threshold is passed.');
// Disable the cron threshold through the interface.
$admin_user = $this->drupalCreateUser(array('administer site configuration'));
@@ -803,7 +803,7 @@ class CronRunTestCase extends DrupalWebTestCase {
$cron_last = time() - 200;
variable_set('cron_last', $cron_last);
$this->drupalGet('');
- $this->assertTrue($cron_last == variable_get('cron_last', NULL), t('Cron does not run when the cron threshold is disabled.'));
+ $this->assertTrue($cron_last == variable_get('cron_last', NULL), 'Cron does not run when the cron threshold is disabled.');
}
/**
@@ -863,7 +863,7 @@ class CronRunTestCase extends DrupalWebTestCase {
// The common_test_cron_helper module sets the 'common_test_cron' variable.
$this->cronRun();
$result = variable_get('common_test_cron');
- $this->assertEqual($result, 'success', t('Cron correctly handles exceptions thrown during hook_cron() invocations.'));
+ $this->assertEqual($result, 'success', 'Cron correctly handles exceptions thrown during hook_cron() invocations.');
}
}
@@ -886,7 +886,7 @@ class AdminMetaTagTestCase extends DrupalWebTestCase {
list($version, ) = explode('.', VERSION);
$string = '<meta name="Generator" content="Drupal ' . $version . ' (http://drupal.org)" />';
$this->drupalGet('node');
- $this->assertRaw($string, t('Fingerprinting meta tag generated correctly.'), t('System'));
+ $this->assertRaw($string, 'Fingerprinting meta tag generated correctly.', 'System');
}
}
@@ -913,7 +913,7 @@ class AccessDeniedTestCase extends DrupalWebTestCase {
function testAccessDenied() {
$this->drupalGet('admin');
- $this->assertText(t('Access denied'), t('Found the default 403 page'));
+ $this->assertText(t('Access denied'), 'Found the default 403 page');
$this->assertResponse(403);
$this->drupalLogin($this->admin_user);
@@ -928,14 +928,14 @@ class AccessDeniedTestCase extends DrupalWebTestCase {
$this->drupalLogout();
$this->drupalGet('admin');
- $this->assertText($node->title, t('Found the custom 403 page'));
+ $this->assertText($node->title, 'Found the custom 403 page');
// Logout and check that the user login block is shown on custom 403 pages.
$this->drupalLogout();
$this->drupalGet('admin');
- $this->assertText($node->title, t('Found the custom 403 page'));
- $this->assertText(t('User login'), t('Blocks are shown on the custom 403 page'));
+ $this->assertText($node->title, 'Found the custom 403 page');
+ $this->assertText(t('User login'), 'Blocks are shown on the custom 403 page');
// Log back in and remove the custom 403 page.
$this->drupalLogin($this->admin_user);
@@ -945,9 +945,9 @@ class AccessDeniedTestCase extends DrupalWebTestCase {
$this->drupalLogout();
$this->drupalGet('admin');
- $this->assertText(t('Access denied'), t('Found the default 403 page'));
+ $this->assertText(t('Access denied'), 'Found the default 403 page');
$this->assertResponse(403);
- $this->assertText(t('User login'), t('Blocks are shown on the default 403 page'));
+ $this->assertText(t('User login'), 'Blocks are shown on the default 403 page');
// Log back in, set the custom 403 page to /user and remove the block
$this->drupalLogin($this->admin_user);
@@ -994,7 +994,7 @@ class PageNotFoundTestCase extends DrupalWebTestCase {
function testPageNotFound() {
$this->drupalGet($this->randomName(10));
- $this->assertText(t('Page not found'), t('Found the default 404 page'));
+ $this->assertText(t('Page not found'), 'Found the default 404 page');
$edit = array(
'title' => $this->randomName(10),
@@ -1006,7 +1006,7 @@ class PageNotFoundTestCase extends DrupalWebTestCase {
$this->drupalPost('admin/config/system/site-information', array('site_404' => 'node/' . $node->nid), t('Save configuration'));
$this->drupalGet($this->randomName(10));
- $this->assertText($node->title, t('Found the custom 404 page'));
+ $this->assertText($node->title, 'Found the custom 404 page');
}
}
@@ -1049,7 +1049,7 @@ class SiteMaintenanceTestCase extends DrupalWebTestCase {
$offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => variable_get('site_name', 'Drupal')));
$this->drupalGet('');
- $this->assertRaw($admin_message, t('Found the site maintenance mode message.'));
+ $this->assertRaw($admin_message, 'Found the site maintenance mode message.');
// Logout and verify that offline message is displayed.
$this->drupalLogout();
@@ -1079,7 +1079,7 @@ class SiteMaintenanceTestCase extends DrupalWebTestCase {
$this->drupalLogout();
$this->drupalLogin($this->admin_user);
$this->drupalGet('admin/config/development/maintenance');
- $this->assertNoRaw($admin_message, t('Site maintenance mode message not displayed.'));
+ $this->assertNoRaw($admin_message, 'Site maintenance mode message not displayed.');
$offline_message = 'Sorry, not online.';
$edit = array(
@@ -1090,11 +1090,11 @@ class SiteMaintenanceTestCase extends DrupalWebTestCase {
// Logout and verify that custom site offline message is displayed.
$this->drupalLogout();
$this->drupalGet('');
- $this->assertRaw($offline_message, t('Found the site offline message.'));
+ $this->assertRaw($offline_message, 'Found the site offline message.');
// Verify that custom site offline message is not displayed on user/password.
$this->drupalGet('user/password');
- $this->assertText(t('Username or e-mail address'), t('Anonymous users can access user/password'));
+ $this->assertText(t('Username or e-mail address'), 'Anonymous users can access user/password');
// Submit password reset form.
$edit = array(
@@ -1149,18 +1149,18 @@ class DateTimeFunctionalTest extends DrupalWebTestCase {
// Confirm date format and time zone.
$this->drupalGet("node/$node1->nid");
- $this->assertText('2007-01-31 21:00:00 -1000', t('Date should be identical, with GMT offset of -10 hours.'));
+ $this->assertText('2007-01-31 21:00:00 -1000', 'Date should be identical, with GMT offset of -10 hours.');
$this->drupalGet("node/$node2->nid");
- $this->assertText('2007-07-31 21:00:00 -1000', t('Date should be identical, with GMT offset of -10 hours.'));
+ $this->assertText('2007-07-31 21:00:00 -1000', 'Date should be identical, with GMT offset of -10 hours.');
// Set time zone to Los Angeles time.
variable_set('date_default_timezone', 'America/Los_Angeles');
// Confirm date format and time zone.
$this->drupalGet("node/$node1->nid");
- $this->assertText('2007-01-31 23:00:00 -0800', t('Date should be two hours ahead, with GMT offset of -8 hours.'));
+ $this->assertText('2007-01-31 23:00:00 -0800', 'Date should be two hours ahead, with GMT offset of -8 hours.');
$this->drupalGet("node/$node2->nid");
- $this->assertText('2007-08-01 00:00:00 -0700', t('Date should be three hours ahead, with GMT offset of -7 hours.'));
+ $this->assertText('2007-08-01 00:00:00 -0700', 'Date should be three hours ahead, with GMT offset of -7 hours.');
}
/**
@@ -1183,7 +1183,7 @@ class DateTimeFunctionalTest extends DrupalWebTestCase {
'date_format' => $date_format,
);
$this->drupalPost('admin/config/regional/date-time/types/add', $edit, t('Add date type'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time', array('absolute' => TRUE)), 'Correct page redirection.');
$this->assertText(t('New date type added successfully.'), 'Date type added confirmation message appears.');
$this->assertText($date_type, 'Custom date type appears in the date type list.');
$this->assertText(t('delete'), 'Delete link for custom date type appears.');
@@ -1191,7 +1191,7 @@ class DateTimeFunctionalTest extends DrupalWebTestCase {
// Delete custom date type.
$this->clickLink(t('delete'));
$this->drupalPost('admin/config/regional/date-time/types/' . $machine_name . '/delete', array(), t('Remove'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time', array('absolute' => TRUE)), 'Correct page redirection.');
$this->assertText(t('Removed date type ' . $date_type), 'Custom date type removed.');
}
@@ -1209,7 +1209,7 @@ class DateTimeFunctionalTest extends DrupalWebTestCase {
'date_format' => 'Y',
);
$this->drupalPost('admin/config/regional/date-time/formats/add', $edit, t('Add format'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), 'Correct page redirection.');
$this->assertNoText(t('No custom date formats available.'), 'No custom date formats message does not appear.');
$this->assertText(t('Custom date format added.'), 'Custom date format added.');
@@ -1224,13 +1224,13 @@ class DateTimeFunctionalTest extends DrupalWebTestCase {
'date_format' => 'Y m',
);
$this->drupalPost($this->getUrl(), $edit, t('Save format'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), 'Correct page redirection.');
$this->assertText(t('Custom date format updated.'), 'Custom date format successfully updated.');
// Delete custom date format.
$this->clickLink(t('delete'));
$this->drupalPost($this->getUrl(), array(), t('Remove'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/date-time/formats', array('absolute' => TRUE)), 'Correct page redirection.');
$this->assertText(t('Removed date format'), 'Custom date format removed successfully.');
}
@@ -1347,11 +1347,11 @@ class PageTitleFiltering extends DrupalWebTestCase {
// drupal_set_title's $filter is CHECK_PLAIN by default, so the title should be
// returned with check_plain().
drupal_set_title($title, CHECK_PLAIN);
- $this->assertTrue(strpos(drupal_get_title(), '<em>') === FALSE, t('Tags in title converted to entities when $output is CHECK_PLAIN.'));
+ $this->assertTrue(strpos(drupal_get_title(), '<em>') === FALSE, 'Tags in title converted to entities when $output is CHECK_PLAIN.');
// drupal_set_title's $filter is passed as PASS_THROUGH, so the title should be
// returned with HTML.
drupal_set_title($title, PASS_THROUGH);
- $this->assertTrue(strpos(drupal_get_title(), '<em>') !== FALSE, t('Tags in title are not converted to entities when $output is PASS_THROUGH.'));
+ $this->assertTrue(strpos(drupal_get_title(), '<em>') !== FALSE, 'Tags in title are not converted to entities when $output is PASS_THROUGH.');
// Generate node content.
$langcode = LANGUAGE_NONE;
$edit = array(
@@ -1437,11 +1437,11 @@ class FrontPageTestCase extends DrupalWebTestCase {
*/
function testDrupalIsFrontPage() {
$this->drupalGet('');
- $this->assertText(t('On front page.'), t('Path is the front page.'));
+ $this->assertText(t('On front page.'), 'Path is the front page.');
$this->drupalGet('node');
- $this->assertText(t('On front page.'), t('Path is the front page.'));
+ $this->assertText(t('On front page.'), 'Path is the front page.');
$this->drupalGet($this->node_path);
- $this->assertNoText(t('On front page.'), t('Path is not the front page.'));
+ $this->assertNoText(t('On front page.'), 'Path is not the front page.');
// Change the front page to an invalid path.
$edit = array('site_frontpage' => 'kittens');
@@ -1451,14 +1451,14 @@ class FrontPageTestCase extends DrupalWebTestCase {
// Change the front page to a valid path.
$edit['site_frontpage'] = $this->node_path;
$this->drupalPost('admin/config/system/site-information', $edit, t('Save configuration'));
- $this->assertText(t('The configuration options have been saved.'), t('The front page path has been saved.'));
+ $this->assertText(t('The configuration options have been saved.'), 'The front page path has been saved.');
$this->drupalGet('');
- $this->assertText(t('On front page.'), t('Path is the front page.'));
+ $this->assertText(t('On front page.'), 'Path is the front page.');
$this->drupalGet('node');
- $this->assertNoText(t('On front page.'), t('Path is not the front page.'));
+ $this->assertNoText(t('On front page.'), 'Path is not the front page.');
$this->drupalGet($this->node_path);
- $this->assertText(t('On front page.'), t('Path is the front page.'));
+ $this->assertText(t('On front page.'), 'Path is the front page.');
}
}
@@ -1568,47 +1568,47 @@ class SystemMainContentFallback extends DrupalWebTestCase {
// Disable the dashboard module, which depends on the block module.
$edit['modules[Core][dashboard][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.');
// Disable the block module.
$edit['modules[Core][block][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.');
module_list(TRUE);
- $this->assertFalse(module_exists('block'), t('Block module disabled.'));
+ $this->assertFalse(module_exists('block'), 'Block module disabled.');
// At this point, no region is filled and fallback should be triggered.
$this->drupalGet('admin/config/system/site-information');
- $this->assertField('site_name', t('Admin interface still available.'));
+ $this->assertField('site_name', 'Admin interface still available.');
// Fallback should not trigger when another module is handling content.
$this->drupalGet('system-test/main-content-handling');
- $this->assertRaw('id="system-test-content"', t('Content handled by another module'));
- $this->assertText(t('Content to test main content fallback'), t('Main content still displayed.'));
+ $this->assertRaw('id="system-test-content"', 'Content handled by another module');
+ $this->assertText(t('Content to test main content fallback'), 'Main content still displayed.');
// Fallback should trigger when another module
// indicates that it is not handling the content.
$this->drupalGet('system-test/main-content-fallback');
- $this->assertText(t('Content to test main content fallback'), t('Main content fallback properly triggers.'));
+ $this->assertText(t('Content to test main content fallback'), 'Main content fallback properly triggers.');
// Fallback should not trigger when another module is handling content.
// Note that this test ensures that no duplicate
// content gets created by the fallback.
$this->drupalGet('system-test/main-content-duplication');
- $this->assertNoText(t('Content to test main content fallback'), t('Main content not duplicated.'));
+ $this->assertNoText(t('Content to test main content fallback'), 'Main content not duplicated.');
// Request a user* page and see if it is displayed.
$this->drupalLogin($this->web_user);
$this->drupalGet('user/' . $this->web_user->uid . '/edit');
- $this->assertField('mail', t('User interface still available.'));
+ $this->assertField('mail', 'User interface still available.');
// Enable the block module again.
$this->drupalLogin($this->admin_user);
$edit = array();
$edit['modules[Core][block][enable]'] = 'block';
$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.');
module_list(TRUE);
- $this->assertTrue(module_exists('block'), t('Block module re-enabled.'));
+ $this->assertTrue(module_exists('block'), 'Block module re-enabled.');
}
}
@@ -1746,16 +1746,16 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase {
$this->drupalPost('admin/appearance', $edit, t('Save configuration'));
$this->drupalGet('admin/config');
- $this->assertRaw('themes/seven', t('Administration theme used on an administration page.'));
+ $this->assertRaw('themes/seven', 'Administration theme used on an administration page.');
$this->drupalGet('node/' . $this->node->nid);
- $this->assertRaw('themes/stark', t('Site default theme used on node page.'));
+ $this->assertRaw('themes/stark', 'Site default theme used on node page.');
$this->drupalGet('node/add');
- $this->assertRaw('themes/seven', t('Administration theme used on the add content page.'));
+ $this->assertRaw('themes/seven', 'Administration theme used on the add content page.');
$this->drupalGet('node/' . $this->node->nid . '/edit');
- $this->assertRaw('themes/seven', t('Administration theme used on the edit content page.'));
+ $this->assertRaw('themes/seven', 'Administration theme used on the edit content page.');
// Disable the admin theme on the node admin pages.
$edit = array(
@@ -1764,10 +1764,10 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase {
$this->drupalPost('admin/appearance', $edit, t('Save configuration'));
$this->drupalGet('admin/config');
- $this->assertRaw('themes/seven', t('Administration theme used on an administration page.'));
+ $this->assertRaw('themes/seven', 'Administration theme used on an administration page.');
$this->drupalGet('node/add');
- $this->assertRaw('themes/stark', t('Site default theme used on the add content page.'));
+ $this->assertRaw('themes/stark', 'Site default theme used on the add content page.');
// Reset to the default theme settings.
variable_set('theme_default', 'bartik');
@@ -1778,10 +1778,10 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase {
$this->drupalPost('admin/appearance', $edit, t('Save configuration'));
$this->drupalGet('admin');
- $this->assertRaw('themes/bartik', t('Site default theme used on administration page.'));
+ $this->assertRaw('themes/bartik', 'Site default theme used on administration page.');
$this->drupalGet('node/add');
- $this->assertRaw('themes/bartik', t('Site default theme used on the add content page.'));
+ $this->assertRaw('themes/bartik', 'Site default theme used on the add content page.');
}
/**
@@ -1792,16 +1792,16 @@ class SystemThemeFunctionalTest extends DrupalWebTestCase {
theme_enable(array('stark'));
$this->drupalGet('admin/appearance');
$this->clickLink(t('Set default'), 1);
- $this->assertTrue(variable_get('theme_default', '') == 'stark', t('Site default theme switched successfully.'));
+ $this->assertTrue(variable_get('theme_default', '') == 'stark', 'Site default theme switched successfully.');
// Test the default theme on the secondary links (blocks admin page).
$this->drupalGet('admin/structure/block');
- $this->assertText('Stark(' . t('active tab') . ')', t('Default local task on blocks admin page is the default theme.'));
+ $this->assertText('Stark(' . t('active tab') . ')', 'Default local task on blocks admin page is the default theme.');
// Switch back to Bartik and test again to test that the menu cache is cleared.
$this->drupalGet('admin/appearance');
$this->clickLink(t('Set default'), 0);
$this->drupalGet('admin/structure/block');
- $this->assertText('Bartik(' . t('active tab') . ')', t('Default local task on blocks admin page has changed.'));
+ $this->assertText('Bartik(' . t('active tab') . ')', 'Default local task on blocks admin page has changed.');
}
}
@@ -1949,10 +1949,10 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
// token, [node:title].
$raw_tokens = array('title' => '[node:title]');
$generated = token_generate('node', $raw_tokens, array('node' => $node));
- $this->assertEqual($generated['[node:title]'], check_plain($node->title), t('Token sanitized.'));
+ $this->assertEqual($generated['[node:title]'], check_plain($node->title), 'Token sanitized.');
$generated = token_generate('node', $raw_tokens, array('node' => $node), array('sanitize' => FALSE));
- $this->assertEqual($generated['[node:title]'], $node->title, t('Unsanitized token generated properly.'));
+ $this->assertEqual($generated['[node:title]'], $node->title, 'Unsanitized token generated properly.');
// Test token replacement when the string contains no tokens.
$this->assertEqual(token_replace('No tokens here.'), 'No tokens here.');
@@ -1983,7 +1983,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
$input = $test['prefix'] . '[site:name]' . $test['suffix'];
$expected = $test['prefix'] . 'Drupal' . $test['suffix'];
$output = token_replace($input, array(), array('language' => $language));
- $this->assertTrue($output == $expected, t('Token recognized in string %string', array('%string' => $input)));
+ $this->assertTrue($output == $expected, format_string('Token recognized in string %string', array('%string' => $input)));
}
}
@@ -2011,11 +2011,11 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
$tests['[site:login-url]'] = url('user', $url_options);
// Test to make sure that we generated something for each token.
- $this->assertFalse(in_array(0, array_map('strlen', $tests)), t('No empty tokens generated.'));
+ $this->assertFalse(in_array(0, array_map('strlen', $tests)), 'No empty tokens generated.');
foreach ($tests as $input => $expected) {
$output = token_replace($input, array(), array('language' => $language));
- $this->assertEqual($output, $expected, t('Sanitized system site information token %token replaced.', array('%token' => $input)));
+ $this->assertEqual($output, $expected, format_string('Sanitized system site information token %token replaced.', array('%token' => $input)));
}
// Generate and test unsanitized tokens.
@@ -2024,7 +2024,7 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
foreach ($tests as $input => $expected) {
$output = token_replace($input, array(), array('language' => $language, 'sanitize' => FALSE));
- $this->assertEqual($output, $expected, t('Unsanitized system site information token %token replaced.', array('%token' => $input)));
+ $this->assertEqual($output, $expected, format_string('Unsanitized system site information token %token replaced.', array('%token' => $input)));
}
}
@@ -2047,11 +2047,11 @@ class TokenReplaceTestCase extends DrupalWebTestCase {
$tests['[date:raw]'] = filter_xss($date);
// Test to make sure that we generated something for each token.
- $this->assertFalse(in_array(0, array_map('strlen', $tests)), t('No empty tokens generated.'));
+ $this->assertFalse(in_array(0, array_map('strlen', $tests)), 'No empty tokens generated.');
foreach ($tests as $input => $expected) {
$output = token_replace($input, array('date' => $date), array('language' => $language));
- $this->assertEqual($output, $expected, t('Date token %token replaced.', array('%token' => $input)));
+ $this->assertEqual($output, $expected, format_string('Date token %token replaced.', array('%token' => $input)));
}
}
}
@@ -2115,15 +2115,15 @@ array_space[a b] = Value';
$parsed = drupal_parse_info_format($config);
- $this->assertEqual($parsed['simple'], $expected['simple'], t('Set a simple value.'));
- $this->assertEqual($parsed['quoted'], $expected['quoted'], t('Set a simple value in quotes.'));
- $this->assertEqual($parsed['multiline'], $expected['multiline'], t('Set a multiline value.'));
- $this->assertEqual($parsed['array'], $expected['array'], t('Set a simple array.'));
- $this->assertEqual($parsed['array_assoc'], $expected['array_assoc'], t('Set an associative array.'));
- $this->assertEqual($parsed['array_deep'], $expected['array_deep'], t('Set a nested array.'));
- $this->assertEqual($parsed['array_deep_assoc'], $expected['array_deep_assoc'], t('Set a nested associative array.'));
- $this->assertEqual($parsed['array_space'], $expected['array_space'], t('Set an array with a whitespace in the key.'));
- $this->assertEqual($parsed, $expected, t('Entire parsed .info string and expected array are identical.'));
+ $this->assertEqual($parsed['simple'], $expected['simple'], 'Set a simple value.');
+ $this->assertEqual($parsed['quoted'], $expected['quoted'], 'Set a simple value in quotes.');
+ $this->assertEqual($parsed['multiline'], $expected['multiline'], 'Set a multiline value.');
+ $this->assertEqual($parsed['array'], $expected['array'], 'Set a simple array.');
+ $this->assertEqual($parsed['array_assoc'], $expected['array_assoc'], 'Set an associative array.');
+ $this->assertEqual($parsed['array_deep'], $expected['array_deep'], 'Set a nested array.');
+ $this->assertEqual($parsed['array_deep_assoc'], $expected['array_deep_assoc'], 'Set a nested associative array.');
+ $this->assertEqual($parsed['array_space'], $expected['array_space'], 'Set an array with a whitespace in the key.');
+ $this->assertEqual($parsed, $expected, 'Entire parsed .info string and expected array are identical.');
}
}
@@ -2149,32 +2149,32 @@ class SystemInfoAlterTestCase extends DrupalWebTestCase {
// thing necessary to use the rebuilt {system}.info.
module_enable(array('module_test'), FALSE);
drupal_flush_all_caches();
- $this->assertTrue(module_exists('module_test'), t('Test module is enabled.'));
+ $this->assertTrue(module_exists('module_test'), 'Test module is enabled.');
$info = $this->getSystemInfo('seven', 'theme');
- $this->assertTrue(isset($info['regions']['test_region']), t('Altered theme info was added to {system}.info.'));
+ $this->assertTrue(isset($info['regions']['test_region']), 'Altered theme info was added to {system}.info.');
$seven_regions = system_region_list('seven');
- $this->assertTrue(isset($seven_regions['test_region']), t('Altered theme info was returned by system_region_list().'));
+ $this->assertTrue(isset($seven_regions['test_region']), 'Altered theme info was returned by system_region_list().');
$system_list_themes = system_list('theme');
$info = $system_list_themes['seven']->info;
- $this->assertTrue(isset($info['regions']['test_region']), t('Altered theme info was returned by system_list().'));
+ $this->assertTrue(isset($info['regions']['test_region']), 'Altered theme info was returned by system_list().');
$list_themes = list_themes();
- $this->assertTrue(isset($list_themes['seven']->info['regions']['test_region']), t('Altered theme info was returned by list_themes().'));
+ $this->assertTrue(isset($list_themes['seven']->info['regions']['test_region']), 'Altered theme info was returned by list_themes().');
// Disable the module and verify that {system}.info is rebuilt without it.
module_disable(array('module_test'), FALSE);
drupal_flush_all_caches();
- $this->assertFalse(module_exists('module_test'), t('Test module is disabled.'));
+ $this->assertFalse(module_exists('module_test'), 'Test module is disabled.');
$info = $this->getSystemInfo('seven', 'theme');
- $this->assertFalse(isset($info['regions']['test_region']), t('Altered theme info was removed from {system}.info.'));
+ $this->assertFalse(isset($info['regions']['test_region']), 'Altered theme info was removed from {system}.info.');
$seven_regions = system_region_list('seven');
- $this->assertFalse(isset($seven_regions['test_region']), t('Altered theme info was not returned by system_region_list().'));
+ $this->assertFalse(isset($seven_regions['test_region']), 'Altered theme info was not returned by system_region_list().');
$system_list_themes = system_list('theme');
$info = $system_list_themes['seven']->info;
- $this->assertFalse(isset($info['regions']['test_region']), t('Altered theme info was not returned by system_list().'));
+ $this->assertFalse(isset($info['regions']['test_region']), 'Altered theme info was not returned by system_list().');
$list_themes = list_themes();
- $this->assertFalse(isset($list_themes['seven']->info['regions']['test_region']), t('Altered theme info was not returned by list_themes().'));
+ $this->assertFalse(isset($list_themes['seven']->info['regions']['test_region']), 'Altered theme info was not returned by list_themes().');
}
/**
@@ -2422,7 +2422,7 @@ class RetrieveFileTestCase extends DrupalWebTestCase {
$filename = 'Файл для тестирования ' . $this->randomName();
$url = file_create_url($sourcedir . '/' . $filename);
$retrieved_file = system_retrieve_file($url);
- $this->assertFalse($retrieved_file, t('Non-existent file not fetched.'));
+ $this->assertFalse($retrieved_file, 'Non-existent file not fetched.');
// Actually create that file, download it via HTTP and test the returned path.
file_put_contents($sourcedir . '/' . $filename, 'testing');
@@ -2432,17 +2432,17 @@ class RetrieveFileTestCase extends DrupalWebTestCase {
// has to be encoded.
$encoded_filename = rawurlencode($filename);
- $this->assertEqual($retrieved_file, 'public://' . $encoded_filename, t('Sane path for downloaded file returned (public:// scheme).'));
- $this->assertTrue(is_file($retrieved_file), t('Downloaded file does exist (public:// scheme).'));
- $this->assertEqual(filesize($retrieved_file), 7, t('File size of downloaded file is correct (public:// scheme).'));
+ $this->assertEqual($retrieved_file, 'public://' . $encoded_filename, 'Sane path for downloaded file returned (public:// scheme).');
+ $this->assertTrue(is_file($retrieved_file), 'Downloaded file does exist (public:// scheme).');
+ $this->assertEqual(filesize($retrieved_file), 7, 'File size of downloaded file is correct (public:// scheme).');
file_unmanaged_delete($retrieved_file);
// Test downloading file to a different location.
drupal_mkdir($targetdir = 'temporary://' . $this->randomName());
$retrieved_file = system_retrieve_file($url, $targetdir);
- $this->assertEqual($retrieved_file, "$targetdir/$encoded_filename", t('Sane path for downloaded file returned (temporary:// scheme).'));
- $this->assertTrue(is_file($retrieved_file), t('Downloaded file does exist (temporary:// scheme).'));
- $this->assertEqual(filesize($retrieved_file), 7, t('File size of downloaded file is correct (temporary:// scheme).'));
+ $this->assertEqual($retrieved_file, "$targetdir/$encoded_filename", 'Sane path for downloaded file returned (temporary:// scheme).');
+ $this->assertTrue(is_file($retrieved_file), 'Downloaded file does exist (temporary:// scheme).');
+ $this->assertEqual(filesize($retrieved_file), 7, 'File size of downloaded file is correct (temporary:// scheme).');
file_unmanaged_delete($retrieved_file);
file_unmanaged_delete_recursive($sourcedir);
@@ -2580,18 +2580,18 @@ class SystemAdminTestCase extends DrupalWebTestCase {
*/
function testCompactMode() {
$this->drupalGet('admin/compact/on');
- $this->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], t('Compact mode turns on.'));
+ $this->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'Compact mode turns on.');
$this->drupalGet('admin/compact/on');
- $this->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], t('Compact mode remains on after a repeat call.'));
+ $this->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'Compact mode remains on after a repeat call.');
$this->drupalGet('');
- $this->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], t('Compact mode persists on new requests.'));
+ $this->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'Compact mode persists on new requests.');
$this->drupalGet('admin/compact/off');
- $this->assertEqual($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'deleted', t('Compact mode turns off.'));
+ $this->assertEqual($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'deleted', 'Compact mode turns off.');
$this->drupalGet('admin/compact/off');
- $this->assertEqual($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'deleted', t('Compact mode remains off after a repeat call.'));
+ $this->assertEqual($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'deleted', 'Compact mode remains off after a repeat call.');
$this->drupalGet('');
- $this->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], t('Compact mode persists on new requests.'));
+ $this->assertTrue($this->cookies['Drupal.visitor.admin_compact_mode']['value'], 'Compact mode persists on new requests.');
}
}
@@ -2671,13 +2671,13 @@ class SystemIndexPhpTest extends DrupalWebTestCase {
$index_php = $GLOBALS['base_url'] . '/index.php';
$this->drupalGet($index_php, array('external' => TRUE));
- $this->assertResponse(200, t('Make sure index.php returns a valid page.'));
+ $this->assertResponse(200, 'Make sure index.php returns a valid page.');
$this->drupalGet($index_php, array('external' => TRUE, 'query' => array('q' => 'user')));
- $this->assertResponse(200, t('Make sure index.php?q=user returns a valid page.'));
+ $this->assertResponse(200, 'Make sure index.php?q=user returns a valid page.');
$this->drupalGet($index_php .'/user', array('external' => TRUE));
- $this->assertResponse(404, t("Make sure index.php/user returns a 'page not found'."));
+ $this->assertResponse(404, "Make sure index.php/user returns a 'page not found'.");
}
}