diff options
Diffstat (limited to 'modules/dblog/dblog.test')
-rw-r--r-- | modules/dblog/dblog.test | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/modules/dblog/dblog.test b/modules/dblog/dblog.test index c26c6324e..92f0dd4d3 100644 --- a/modules/dblog/dblog.test +++ b/modules/dblog/dblog.test @@ -55,10 +55,10 @@ class DBLogTestCase extends DrupalWebTestCase { // Check row limit variable. $current_limit = variable_get('dblog_row_limit', 1000); - $this->assertTrue($current_limit == $row_limit, '[Cache] Row limit variable of ' . $current_limit . ' equals row limit of ' . $row_limit); + $this->assertTrue($current_limit == $row_limit, t('[Cache] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit))); // Verify dblog row limit equals specified row limit. $current_limit = unserialize(db_query("SELECT value FROM {variable} WHERE name = :dblog_limit", array(':dblog_limit' => 'dblog_row_limit'))->fetchField()); - $this->assertTrue($current_limit == $row_limit, '[Variable table] Row limit variable of ' . $current_limit . ' equals row limit of ' . $row_limit); + $this->assertTrue($current_limit == $row_limit, t('[Variable table] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit))); } /** @@ -71,13 +71,13 @@ class DBLogTestCase extends DrupalWebTestCase { $this->generateLogEntries($row_limit + 10); // Verify dblog row count exceeds row limit. $count = db_query('SELECT COUNT(wid) FROM {watchdog}')->fetchField(); - $this->assertTrue($count > $row_limit, 'Dblog row count of ' . $count . ' exceeds row limit of ' . $row_limit); + $this->assertTrue($count > $row_limit, t('Dblog row count of @count exceeds row limit of @limit', array('@count' => $count, '@limit' => $row_limit))); // Run cron job. $this->cronRun(); // Verify dblog row count equals row limit plus one because cron adds a record after it runs. $count = db_query('SELECT COUNT(wid) FROM {watchdog}')->fetchField(); - $this->assertTrue($count == $row_limit + 1, 'Dblog row count of ' . $count . ' equals row limit of ' . $row_limit . ' plus one'); + $this->assertTrue($count == $row_limit + 1, t('Dblog row count of @count equals row limit of @limit plus one', array('@count' => $count, '@limit' => $row_limit))); } /** @@ -125,35 +125,35 @@ class DBLogTestCase extends DrupalWebTestCase { $this->drupalGet('admin/help/dblog'); $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Database logging'), 'DBLog help was displayed'); + $this->assertText(t('Database logging'), t('DBLog help was displayed')); } // View dblog report node. $this->drupalGet('admin/reports/dblog'); $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Recent log entries'), 'DBLog report was displayed'); + $this->assertText(t('Recent log entries'), t('DBLog report was displayed')); } // View dblog page-not-found report node. $this->drupalGet('admin/reports/page-not-found'); $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Top ' . $quote . 'page not found' . $quote . ' errors'), 'DBLog page-not-found report was displayed'); + $this->assertText(t('Top ' . $quote . 'page not found' . $quote . ' errors'), t('DBLog page-not-found report was displayed')); } // View dblog access-denied report node. $this->drupalGet('admin/reports/access-denied'); $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Top ' . $quote . 'access denied' . $quote . ' errors'), 'DBLog access-denied report was displayed'); + $this->assertText(t('Top ' . $quote . 'access denied' . $quote . ' errors'), t('DBLog access-denied report was displayed')); } // View dblog event node. $this->drupalGet('admin/reports/event/1'); $this->assertResponse($response); if ($response == 200) { - $this->assertText(t('Details'), 'DBLog event node was displayed'); + $this->assertText(t('Details'), t('DBLog event node was displayed')); } } @@ -192,7 +192,7 @@ class DBLogTestCase extends DrupalWebTestCase { $this->assertResponse(200); // Retrieve user object. $user = user_load_by_name($name); - $this->assertTrue($user != NULL, 'User ' . $name . ' was loaded'); + $this->assertTrue($user != NULL, t('User @name was loaded', array('@name' => $name))); $user->pass_raw = $pass; // Needed by drupalLogin. // Login user. $this->drupalLogin($user); @@ -204,7 +204,7 @@ class DBLogTestCase extends DrupalWebTestCase { $ids[] = $row->wid; } $count_before = (isset($ids)) ? count($ids) : 0; - $this->assertTrue($count_before > 0, 'DBLog contains ' . $count_before . ' records for ' . $user->name); + $this->assertTrue($count_before > 0, t('DBLog contains @count records for @name', array('@count' => $count_before, '@name' => $user->name))); // Login the admin user. $this->drupalLogin($this->big_user); @@ -238,12 +238,12 @@ class DBLogTestCase extends DrupalWebTestCase { $link = drupal_substr($value, strpos($value, 'admin/reports/event/')); $this->drupalGet($link); // Check for full message text on the details page. - $this->assertRaw($message, 'DBLog event details was found: [delete user]'); + $this->assertRaw($message, t('DBLog event details was found: [delete user]')); break; } } } - $this->assertTrue($link, 'DBLog event was recorded: [delete user]'); + $this->assertTrue($link, t('DBLog event was recorded: [delete user]')); // Visit random URL (to generate page not found event). $not_found_url = $this->randomName(60); $this->drupalGet($not_found_url); @@ -252,7 +252,7 @@ class DBLogTestCase extends DrupalWebTestCase { $this->drupalGet('admin/reports/page-not-found'); $this->assertResponse(200); // Check that full-length url displayed. - $this->assertText($not_found_url, 'DBLog event was recorded: [page not found]'); + $this->assertText($not_found_url, t('DBLog event was recorded: [page not found]')); } /** @@ -275,7 +275,7 @@ class DBLogTestCase extends DrupalWebTestCase { $this->assertResponse(200); // Retrieve node object. $node = $this->drupalGetNodeByTitle($title); - $this->assertTrue($node != NULL, 'Node ' . $title . ' was loaded'); + $this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title))); // Edit node. $edit = $this->getContentUpdate($type); $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save')); @@ -308,13 +308,13 @@ class DBLogTestCase extends DrupalWebTestCase { $this->drupalGet('admin/reports/access-denied'); $this->assertResponse(200); // Access denied. - $this->assertText(t('admin/reports/dblog'), 'DBLog event was recorded: [access denied]'); + $this->assertText(t('admin/reports/dblog'), t('DBLog event was recorded: [access denied]')); // View dblog page-not-found report node. $this->drupalGet('admin/reports/page-not-found'); $this->assertResponse(200); // Page not found. - $this->assertText(t('node/@nid', array('@nid' => $node->nid)), 'DBLog event was recorded: [page not found]'); + $this->assertText(t('node/@nid', array('@nid' => $node->nid)), t('DBLog event was recorded: [page not found]')); } /** @@ -332,14 +332,14 @@ class DBLogTestCase extends DrupalWebTestCase { 'choice[new:0][chtext]' => $this->randomName(32), 'choice[new:1][chtext]' => $this->randomName(32), ); - break; + break; default: $content = array( "title" => $this->randomName(8), "body[$langcode][0][value]" => $this->randomName(32), ); - break; + break; } return $content; } @@ -357,14 +357,14 @@ class DBLogTestCase extends DrupalWebTestCase { 'choice[chid:1][chtext]' => $this->randomName(32), 'choice[chid:2][chtext]' => $this->randomName(32), ); - break; + break; default: $langcode = LANGUAGE_NONE; $content = array( "body[$langcode][0][value]" => $this->randomName(32), ); - break; + break; } return $content; } @@ -391,14 +391,14 @@ class DBLogTestCase extends DrupalWebTestCase { // Add a watchdog entry. dblog_watchdog($log); // Make sure the table count has actually incremented. - $this->assertEqual($count + 1, db_query('SELECT COUNT(*) FROM {watchdog}')->fetchField(), 'dblog_watchdog() added an entry to the dblog ' . $count); + $this->assertEqual($count + 1, db_query('SELECT COUNT(*) FROM {watchdog}')->fetchField(), t('dblog_watchdog() added an entry to the dblog :count', array(':count' => $count))); // Login the admin user. $this->drupalLogin($this->big_user); // Now post to clear the db table. $this->drupalPost('admin/reports/dblog', array(), t('Clear log messages')); // Count rows in watchdog that previously related to the deleted user. $count = db_query('SELECT COUNT(*) FROM {watchdog}')->fetchField(); - $this->assertEqual($count, 0, 'DBLog contains ' . $count . ' records after a clear.'); + $this->assertEqual($count, 0, t('DBLog contains :count records after a clear.', array(':count' => $count))); } /** |