$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,t('[Variable table] Row limit variable of @count equals row limit of @limit',array('@count'=>$current_limit,'@limit'=>$row_limit)));
$this->assertTrue($current_limit==$row_limit,format_string('[Variable table] Row limit variable of @count equals row limit of @limit',array('@count'=>$current_limit,'@limit'=>$row_limit)));
}
/**
...
...
@@ -96,14 +96,14 @@ class DBLogTestCase extends DrupalWebTestCase {
$this->generateLogEntries($row_limit+10);
// Verify that the database log row count exceeds the row limit.
$count=db_query('SELECT COUNT(wid) FROM {watchdog}')->fetchField();
$this->assertTrue($count>$row_limit,t('Dblog row count of @count exceeds row limit of @limit',array('@count'=>$count,'@limit'=>$row_limit)));
$this->assertTrue($count>$row_limit,format_string('Dblog row count of @count exceeds row limit of @limit',array('@count'=>$count,'@limit'=>$row_limit)));
// Run a cron job.
$this->cronRun();
// Verify that the database log row count equals the 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,t('Dblog row count of @count equals row limit of @limit plus one',array('@count'=>$count,'@limit'=>$row_limit)));
$this->assertTrue($count==$row_limit+1,format_string('Dblog row count of @count equals row limit of @limit plus one',array('@count'=>$count,'@limit'=>$row_limit)));
}
/**
...
...
@@ -153,35 +153,35 @@ class DBLogTestCase extends DrupalWebTestCase {
$this->drupalGet('admin/help/dblog');
$this->assertResponse($response);
if($response==200){
$this->assertText(t('Database logging'),t('DBLog help was displayed'));
$this->assertText(t('Database logging'),'DBLog help was displayed');
}
// View the database log report page.
$this->drupalGet('admin/reports/dblog');
$this->assertResponse($response);
if($response==200){
$this->assertText(t('Recent log messages'),t('DBLog report was displayed'));
$this->assertText(t('Recent log messages'),'DBLog report was displayed');
}
// View the database log page-not-found report page.
$this->drupalGet('admin/reports/page-not-found');
$this->assertResponse($response);
if($response==200){
$this->assertText(t('Top '.$quote.'page not found'.$quote.' errors'),t('DBLog page-not-found report was displayed'));
$this->assertText(t('Top '.$quote.'page not found'.$quote.' errors'),'DBLog page-not-found report was displayed');
}
// View the database log access-denied report page.
$this->drupalGet('admin/reports/access-denied');
$this->assertResponse($response);
if($response==200){
$this->assertText(t('Top '.$quote.'access denied'.$quote.' errors'),t('DBLog access-denied report was displayed'));
$this->assertText(t('Top '.$quote.'access denied'.$quote.' errors'),'DBLog access-denied report was displayed');
}
// View the database log event page.
$this->drupalGet('admin/reports/event/1');
$this->assertResponse($response);
if($response==200){
$this->assertText(t('Details'),t('DBLog event node was displayed'));
$this->assertText(t('Details'),'DBLog event node was displayed');
}
}
...
...
@@ -220,7 +220,7 @@ class DBLogTestCase extends DrupalWebTestCase {
$this->assertResponse(200);
// Retrieve the user object.
$user=user_load_by_name($name);
$this->assertTrue($user!=NULL,t('User @name was loaded',array('@name'=>$name)));
$this->assertTrue($user!=NULL,format_string('User @name was loaded',array('@name'=>$name)));
// pass_raw property is needed by drupalLogin.
$user->pass_raw=$pass;
// Login user.
...
...
@@ -233,7 +233,7 @@ class DBLogTestCase extends DrupalWebTestCase {
$ids[]=$row->wid;
}
$count_before=(isset($ids))?count($ids):0;
$this->assertTrue($count_before>0,t('DBLog contains @count records for @name',array('@count'=>$count_before,'@name'=>$user->name)));
$this->assertTrue($count_before>0,format_string('DBLog contains @count records for @name',array('@count'=>$count_before,'@name'=>$user->name)));
// Login the admin user.
$this->drupalLogin($this->big_user);
...
...
@@ -249,11 +249,11 @@ class DBLogTestCase extends DrupalWebTestCase {
// Add user.
// Default display includes name and email address; if too long, the email
// address is replaced by three periods.
$this->assertLogMessage(t('New user: %name (%email).',array('%name'=>$name,'%email'=>$user->mail)),t('DBLog event was recorded: [add user]'));
$this->assertLogMessage(t('New user: %name (%email).',array('%name'=>$name,'%email'=>$user->mail)),'DBLog event was recorded: [add user]');
// Login user.
$this->assertLogMessage(t('Session opened for %name.',array('%name'=>$name)),t('DBLog event was recorded: [login user]'));
$this->assertLogMessage(t('Session opened for %name.',array('%name'=>$name)),'DBLog event was recorded: [login user]');
// Logout user.
$this->assertLogMessage(t('Session closed for %name.',array('%name'=>$name)),t('DBLog event was recorded: [logout user]'));
$this->assertLogMessage(t('Session closed for %name.',array('%name'=>$name)),'DBLog event was recorded: [logout user]');
@@ -330,23 +330,23 @@ class DBLogTestCase extends DrupalWebTestCase {
// Verify that node events were recorded.
// Was node content added?
$this->assertLogMessage(t('@type: added %title.',array('@type'=>$type,'%title'=>$title)),t('DBLog event was recorded: [content added]'));
$this->assertLogMessage(t('@type: added %title.',array('@type'=>$type,'%title'=>$title)),'DBLog event was recorded: [content added]');
// Was node content updated?
$this->assertLogMessage(t('@type: updated %title.',array('@type'=>$type,'%title'=>$title)),t('DBLog event was recorded: [content updated]'));
$this->assertLogMessage(t('@type: updated %title.',array('@type'=>$type,'%title'=>$title)),'DBLog event was recorded: [content updated]');
// Was node content deleted?
$this->assertLogMessage(t('@type: deleted %title.',array('@type'=>$type,'%title'=>$title)),t('DBLog event was recorded: [content deleted]'));
$this->assertLogMessage(t('@type: deleted %title.',array('@type'=>$type,'%title'=>$title)),'DBLog event was recorded: [content deleted]');
// View the database log access-denied report page.
$this->drupalGet('admin/reports/access-denied');
$this->assertResponse(200);
// Verify that the 'access denied' event was recorded.
$this->assertText(t('admin/reports/dblog'),t('DBLog event was recorded: [access denied]'));
$this->assertText(t('admin/reports/dblog'),'DBLog event was recorded: [access denied]');
// View the database log page-not-found report page.
$this->drupalGet('admin/reports/page-not-found');
$this->assertResponse(200);
// Verify that the 'page not found' event was recorded.
$this->assertText(t('node/@nid',array('@nid'=>$node->nid)),t('DBLog event was recorded: [page not found]'));
$this->assertText(t('node/@nid',array('@nid'=>$node->nid)),'DBLog event was recorded: [page not found]');
}
/**
...
...
@@ -433,14 +433,14 @@ class DBLogTestCase extends DrupalWebTestCase {
// Add a watchdog entry.
dblog_watchdog($log);
// Make sure the table count has actually been incremented.
$this->assertEqual($count+1,db_query('SELECT COUNT(*) FROM {watchdog}')->fetchField(),t('dblog_watchdog() added an entry to the dblog :count',array(':count'=>$count)));
$this->assertEqual($count+1,db_query('SELECT COUNT(*) FROM {watchdog}')->fetchField(),format_string('dblog_watchdog() added an entry to the dblog :count',array(':count'=>$count)));