From 99d697cfaa8847cc73bf46eed1da5c227f410926 Mon Sep 17 00:00:00 2001 From: Lars Toomre Date: Fri, 28 Sep 2012 12:34:54 -0400 Subject: [PATCH] Issue 1797926 by Lars Toomre: Remove t() from asserts from System sub-system test. --- .../system/Tests/System/AccessDeniedTest.php | 10 +++++----- .../system/Tests/System/AdminMetaTagTest.php | 2 +- .../lib/Drupal/system/Tests/System/AdminTest.php | 12 ++++++------ .../lib/Drupal/system/Tests/System/CronRunTest.php | 8 ++++---- .../Tests/System/DateFormatsLanguageTest.php | 4 ++-- .../Drupal/system/Tests/System/DateTimeTest.php | 18 +++++++++--------- .../Tests/System/DefaultMobileMetaTagsTest.php | 4 ++-- .../system/Tests/System/ErrorHandlerTest.php | 20 ++++++++++---------- .../Drupal/system/Tests/System/FrontPageTest.php | 14 +++++++------- .../Drupal/system/Tests/System/IndexPhpTest.php | 4 ++-- .../Drupal/system/Tests/System/InfoAlterTest.php | 20 ++++++++++---------- .../system/Tests/System/InfoFileParserUnitTest.php | 18 +++++++++--------- .../Tests/System/MainContentFallbackTest.php | 20 ++++++++++---------- .../system/Tests/System/PageNotFoundTest.php | 4 ++-- .../system/Tests/System/PageTitleFilteringTest.php | 4 ++-- .../system/Tests/System/PasswordHashingTest.php | 20 ++++++++++---------- .../system/Tests/System/RetrieveFileTest.php | 14 +++++++------- .../system/Tests/System/SiteMaintenanceTest.php | 6 +++--- .../system/Tests/System/SystemConfigFormBase.php | 2 +- .../lib/Drupal/system/Tests/System/ThemeTest.php | 20 ++++++++++---------- .../system/Tests/System/TokenReplaceTest.php | 16 ++++++++-------- .../Drupal/system/Tests/System/UnicodeUnitTest.php | 14 +++++++------- 22 files changed, 127 insertions(+), 127 deletions(-) diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php index 135f69a..490acfe 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php @@ -43,7 +43,7 @@ class AccessDeniedTest extends WebTestBase { 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); // Use a custom 403 page. @@ -62,8 +62,8 @@ class AccessDeniedTest extends WebTestBase { // Logout and check that the user login block is shown on custom 403 pages. $this->drupalLogout(); $this->drupalGet('admin'); - $this->assertText($this->admin_user->name, t('Found the custom 403 page')); - $this->assertText(t('User login'), t('Blocks are shown on the custom 403 page')); + $this->assertText($this->admin_user->name, '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); @@ -75,9 +75,9 @@ class AccessDeniedTest extends WebTestBase { // Logout and check that the user login block is shown on default 403 pages. $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); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AdminMetaTagTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AdminMetaTagTest.php index ea07456..d566eb3 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/AdminMetaTagTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/AdminMetaTagTest.php @@ -28,6 +28,6 @@ class AdminMetaTagTest extends WebTestBase { list($version, ) = explode('.', VERSION); $string = ''; $this->drupalGet('node'); - $this->assertRaw($string, t('Fingerprinting meta tag generated correctly.'), t('System')); + $this->assertRaw($string, 'Fingerprinting meta tag generated correctly.', t('System')); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php index d87eb44..1c42936 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php @@ -115,17 +115,17 @@ class AdminTest extends WebTestBase { */ 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.'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php b/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php index ebdb103..1bdb269 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/CronRunTest.php @@ -63,14 +63,14 @@ class CronRunTest extends WebTestBase { ->set('threshold.autorun', $cron_safe_threshold) ->save(); $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')); @@ -83,7 +83,7 @@ class CronRunTest extends WebTestBase { $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.'); } /** @@ -96,6 +96,6 @@ class CronRunTest extends WebTestBase { // 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.'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php index 2054180..10f49b9 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/DateFormatsLanguageTest.php @@ -81,9 +81,9 @@ class DateFormatsLanguageTest extends WebTestBase { // 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/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php index 6494a4a..8483da2 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/DateTimeTest.php @@ -56,18 +56,18 @@ class DateTimeTest extends WebTestBase { // 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.'); } /** @@ -90,7 +90,7 @@ class DateTimeTest extends WebTestBase { '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.'); @@ -98,7 +98,7 @@ class DateTimeTest extends WebTestBase { // 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.'); } @@ -116,7 +116,7 @@ class DateTimeTest extends WebTestBase { '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.'); @@ -131,13 +131,13 @@ class DateTimeTest extends WebTestBase { '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.'); } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/DefaultMobileMetaTagsTest.php b/core/modules/system/lib/Drupal/system/Tests/System/DefaultMobileMetaTagsTest.php index 1fe8564..c17863d 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/DefaultMobileMetaTagsTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/DefaultMobileMetaTagsTest.php @@ -34,7 +34,7 @@ class DefaultMobileMetaTagsTest extends WebTestBase { public function testDefaultMetaTagsExist() { $this->drupalGet(''); foreach ($this->default_metatags as $name => $metatag) { - $this->assertRaw($metatag, 'Default Mobile meta tag "' . $name . '" displayed properly.', t('System')); + $this->assertRaw($metatag, format_string('Default Mobile meta tag "@name" displayed properly.', array('@name' => $name)), t('System')); } } @@ -45,7 +45,7 @@ class DefaultMobileMetaTagsTest extends WebTestBase { module_enable(array('system_module_test')); $this->drupalGet(''); foreach ($this->default_metatags as $name => $metatag) { - $this->assertNoRaw($metatag, 'Default Mobile meta tag "' . $name . '" removed properly.', t('System')); + $this->assertNoRaw($metatag, format_string('Default Mobile meta tag "@name" removed properly.', array('@name' => $name)), t('System')); } } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php index 44ad302..92c2bf6 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/ErrorHandlerTest.php @@ -56,7 +56,7 @@ class ErrorHandlerTest extends WebTestBase { // Set error reporting to collect notices. $config->set('error_level', ERROR_REPORTING_DISPLAY_ALL)->save(); $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); @@ -64,7 +64,7 @@ class ErrorHandlerTest extends WebTestBase { // Set error reporting to not collect notices. $config->set('error_level', ERROR_REPORTING_DISPLAY_SOME)->save(); $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); @@ -72,7 +72,7 @@ class ErrorHandlerTest extends WebTestBase { // Set error reporting to not show any errors. $config->set('error_level', ERROR_REPORTING_HIDE)->save(); $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); @@ -98,17 +98,17 @@ class ErrorHandlerTest extends WebTestBase { ); $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)); + $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 = t('in %function (line ', $error_pdo_exception); - $this->assertRaw($error_details, t("Found '!message' in error page.", array('!message' => $error_details))); + $this->assertRaw($error_details, format_string("Found '!message' in error page.", array('!message' => $error_details))); } /** @@ -116,7 +116,7 @@ class ErrorHandlerTest extends WebTestBase { */ 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))); } /** @@ -124,6 +124,6 @@ class ErrorHandlerTest extends WebTestBase { */ 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/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php b/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php index d620cce..bab510b 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/FrontPageTest.php @@ -48,11 +48,11 @@ class FrontPageTest extends WebTestBase { */ 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'); @@ -62,13 +62,13 @@ class FrontPageTest extends WebTestBase { // 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.'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/IndexPhpTest.php b/core/modules/system/lib/Drupal/system/Tests/System/IndexPhpTest.php index 0ab7ddf..c1768fb 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/IndexPhpTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/IndexPhpTest.php @@ -32,9 +32,9 @@ class IndexPhpTest extends WebTestBase { $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 .'/user', array('external' => TRUE)); - $this->assertResponse(200, t("Make sure index.php/user returns a valid page.")); + $this->assertResponse(200, 'Make sure index.php/user returns a valid page.'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/InfoAlterTest.php b/core/modules/system/lib/Drupal/system/Tests/System/InfoAlterTest.php index 9bdeac4..56515b1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/InfoAlterTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/InfoAlterTest.php @@ -31,32 +31,32 @@ class InfoAlterTest extends WebTestBase { // thing necessary to use the rebuilt {system}.info. module_enable(array('module_test'), FALSE); $this->resetAll(); - $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); $this->resetAll(); - $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().'); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/System/InfoFileParserUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/System/InfoFileParserUnitTest.php index 05f36da..4f7a1c9 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/InfoFileParserUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/InfoFileParserUnitTest.php @@ -68,14 +68,14 @@ 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.'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php b/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php index e1fd6f6..2de5ad3 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php @@ -55,42 +55,42 @@ class MainContentFallbackTest extends WebTestBase { // 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.'); system_list_reset(); - $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.'); system_list_reset(); - $this->assertTrue(module_exists('block'), t('Block module re-enabled.')); + $this->assertTrue(module_exists('block'), 'Block module re-enabled.'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/PageNotFoundTest.php b/core/modules/system/lib/Drupal/system/Tests/System/PageNotFoundTest.php index c8bee66..dde1822 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/PageNotFoundTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/PageNotFoundTest.php @@ -33,7 +33,7 @@ class PageNotFoundTest extends WebTestBase { function testPageNotFound() { $this->drupalLogin($this->admin_user); $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'); // Use a custom 404 page. $edit = array( @@ -42,6 +42,6 @@ class PageNotFoundTest extends WebTestBase { $this->drupalPost('admin/config/system/site-information', $edit, t('Save configuration')); $this->drupalGet($this->randomName(10)); - $this->assertText($this->admin_user->name, t('Found the custom 404 page')); + $this->assertText($this->admin_user->name, 'Found the custom 404 page'); } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php index c0d00c3..7e89cf7 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleFilteringTest.php @@ -63,11 +63,11 @@ class PageTitleFilteringTest extends WebTestBase { // 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(), '') === FALSE, t('Tags in title converted to entities when $output is CHECK_PLAIN.')); + $this->assertTrue(strpos(drupal_get_title(), '') === 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(), '') !== FALSE, t('Tags in title are not converted to entities when $output is PASS_THROUGH.')); + $this->assertTrue(strpos(drupal_get_title(), '') !== FALSE, 'Tags in title are not converted to entities when $output is PASS_THROUGH.'); // Generate node content. $langcode = LANGUAGE_NOT_SPECIFIED; $edit = array( diff --git a/core/modules/system/lib/Drupal/system/Tests/System/PasswordHashingTest.php b/core/modules/system/lib/Drupal/system/Tests/System/PasswordHashingTest.php index c48633e..eb9c634 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/PasswordHashingTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/PasswordHashingTest.php @@ -37,26 +37,26 @@ class PasswordHashingTest extends WebTestBase { $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/core/modules/system/lib/Drupal/system/Tests/System/RetrieveFileTest.php b/core/modules/system/lib/Drupal/system/Tests/System/RetrieveFileTest.php index 1c977ca..a7f7a50 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/RetrieveFileTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/RetrieveFileTest.php @@ -30,7 +30,7 @@ class RetrieveFileTest extends WebTestBase { $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'); @@ -40,17 +40,17 @@ class RetrieveFileTest extends WebTestBase { // 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); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php b/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php index 5925660..a5f4cd3 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php @@ -59,7 +59,7 @@ class SiteMaintenanceTest extends WebTestBase { $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => config('system.site')->get('name'))); $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(); @@ -89,7 +89,7 @@ class SiteMaintenanceTest extends WebTestBase { $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( @@ -104,7 +104,7 @@ class SiteMaintenanceTest extends WebTestBase { // 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( diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormBase.php b/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormBase.php index 867bb10..aeeb053 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/SystemConfigFormBase.php @@ -69,7 +69,7 @@ abstract class SystemConfigFormBase extends WebTestBase { '%values' => print_r($values, TRUE), '%errors' => $valid_form ? t('None') : implode(' ', $errors), ); - $this->assertTrue($valid_form, t('Input values: %values
Validation handler errors: %errors', $args)); + $this->assertTrue($valid_form, format_string('Input values: %values
Validation handler errors: %errors', $args)); foreach ($this->values as $form_key => $data) { $this->assertEqual($data['#value'], config($data['#config_name'])->get($data['#config_key'])); diff --git a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php index 3d0188d..5c191a9 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/ThemeTest.php @@ -182,16 +182,16 @@ class ThemeTest extends WebTestBase { $this->drupalPost('admin/appearance', $edit, t('Save configuration')); $this->drupalGet('admin/config'); - $this->assertRaw('core/themes/seven', t('Administration theme used on an administration page.')); + $this->assertRaw('core/themes/seven', 'Administration theme used on an administration page.'); $this->drupalGet('node/' . $this->node->nid); - $this->assertRaw('core/themes/stark', t('Site default theme used on node page.')); + $this->assertRaw('core/themes/stark', 'Site default theme used on node page.'); $this->drupalGet('node/add'); - $this->assertRaw('core/themes/seven', t('Administration theme used on the add content page.')); + $this->assertRaw('core/themes/seven', 'Administration theme used on the add content page.'); $this->drupalGet('node/' . $this->node->nid . '/edit'); - $this->assertRaw('core/themes/seven', t('Administration theme used on the edit content page.')); + $this->assertRaw('core/themes/seven', 'Administration theme used on the edit content page.'); // Disable the admin theme on the node admin pages. $edit = array( @@ -200,10 +200,10 @@ class ThemeTest extends WebTestBase { $this->drupalPost('admin/appearance', $edit, t('Save configuration')); $this->drupalGet('admin/config'); - $this->assertRaw('core/themes/seven', t('Administration theme used on an administration page.')); + $this->assertRaw('core/themes/seven', 'Administration theme used on an administration page.'); $this->drupalGet('node/add'); - $this->assertRaw('core/themes/stark', t('Site default theme used on the add content page.')); + $this->assertRaw('core/themes/stark', 'Site default theme used on the add content page.'); // Reset to the default theme settings. variable_set('theme_default', 'bartik'); @@ -214,10 +214,10 @@ class ThemeTest extends WebTestBase { $this->drupalPost('admin/appearance', $edit, t('Save configuration')); $this->drupalGet('admin'); - $this->assertRaw('core/themes/bartik', t('Site default theme used on administration page.')); + $this->assertRaw('core/themes/bartik', 'Site default theme used on administration page.'); $this->drupalGet('node/add'); - $this->assertRaw('core/themes/bartik', t('Site default theme used on the add content page.')); + $this->assertRaw('core/themes/bartik', 'Site default theme used on the add content page.'); } /** @@ -232,12 +232,12 @@ class ThemeTest extends WebTestBase { // Test the default theme on the secondary links (blocks admin page). $this->drupalGet('admin/structure/block'); - $this->assertText('Bartik(' . t('active tab') . ')', t('Default local task on blocks admin page is the default theme.')); + $this->assertText('Bartik(' . t('active tab') . ')', 'Default local task on blocks admin page is the default theme.'); // Switch back to Stark 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('Stark(' . t('active tab') . ')', t('Default local task on blocks admin page has changed.')); + $this->assertText('Stark(' . t('active tab') . ')', 'Default local task on blocks admin page has changed.'); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php index 79bea6b..3859041 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php @@ -62,10 +62,10 @@ class TokenReplaceTest extends WebTestBase { // 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.'); @@ -96,7 +96,7 @@ class TokenReplaceTest extends WebTestBase { $input = $test['prefix'] . '[site:name]' . $test['suffix']; $expected = $test['prefix'] . 'Drupal' . $test['suffix']; $output = token_replace($input, array(), array('langcode' => $language_interface->langcode)); - $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))); } } @@ -126,11 +126,11 @@ class TokenReplaceTest extends WebTestBase { $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('langcode' => $language_interface->langcode)); - $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. @@ -139,7 +139,7 @@ class TokenReplaceTest extends WebTestBase { foreach ($tests as $input => $expected) { $output = token_replace($input, array(), array('langcode' => $language_interface->langcode, '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))); } } @@ -162,11 +162,11 @@ class TokenReplaceTest extends WebTestBase { $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('langcode' => $language_interface->langcode)); - $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))); } } } diff --git a/core/modules/system/lib/Drupal/system/Tests/System/UnicodeUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/System/UnicodeUnitTest.php index ace9cae..58bef10 100644 --- a/core/modules/system/lib/Drupal/system/Tests/System/UnicodeUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/System/UnicodeUnitTest.php @@ -84,7 +84,7 @@ class UnicodeUnitTest extends UnitTestBase { } 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))); } } @@ -98,7 +98,7 @@ class UnicodeUnitTest extends UnitTestBase { } 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))); } } @@ -114,7 +114,7 @@ class UnicodeUnitTest extends UnitTestBase { } 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))); } } @@ -125,7 +125,7 @@ class UnicodeUnitTest extends UnitTestBase { ); 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))); } } @@ -185,7 +185,7 @@ class UnicodeUnitTest extends UnitTestBase { 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))); } } @@ -217,7 +217,7 @@ class UnicodeUnitTest extends UnitTestBase { '€' => '€', ); 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))); } } @@ -306,7 +306,7 @@ class UnicodeUnitTest extends UnitTestBase { 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')))); } } } -- 1.7.6.msysgit.0