$this->assertRaw(t('The feed %name has been added.',array('%name'=>$edit['title'])),'The feed '.$edit['title'].' has been added.');
$this->assertRaw(t('The feed %name has been added.',array('%name'=>$edit['title'])),t('The feed !name has been added.',array('!name'=>$edit['title'])));
$feed=db_query("SELECT * FROM {aggregator_feed} WHERE title = :title AND url = :url",array(':title'=>$edit['title'],':url'=>$edit['url']))->fetch();
$this->assertTrue(!empty($feed),'The feed found in database.');
$this->assertTrue(!empty($feed),t('The feed found in database.'));
return$feed;
}
...
...
@@ -41,7 +41,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
@@ -104,7 +104,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
$feed->items[]=$item->iid;
}
$feed->item_count=count($feed->items);
$this->assertEqual($expected_count,$feed->item_count,'Total items in feed equal to the total items in database ('.$expected_count.' != '.$feed->item_count.')');
$this->assertEqual($expected_count,$feed->item_count,t('Total items in feed equal to the total items in database (!val1 != !val2)',array('!val1'=>$expected_count,'!val2'=>$feed->item_count)));
}
/**
...
...
@@ -115,7 +115,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
$this->assertRaw(t('The category %title has been added.',array('%title'=>$category_1['title'])),'The category '.$category_1['title'].' has been added.');
$this->assertRaw(t('The category %title has been added.',array('%title'=>$category_1['title'])),t('The category %title has been added.',array('%title'=>$category_1['title'])));
$this->assertRaw(t('The category %title has been added.',array('%title'=>$category_2['title'])),'The category '.$category_2['title'].' has been added.');
$this->assertRaw(t('The category %title has been added.',array('%title'=>$category_2['title'])),t('The category %title has been added.',array('%title'=>$category_2['title'])));
// Get categories from database.
$categories=$this->getCategories();
...
...
@@ -349,7 +349,7 @@ class CategorizeFeedTestCase extends AggregatorTestCase {
// Assert the feed has two categories.
$this->getFeedCategories($db_feed);
$this->assertEqual(count($db_feed->categories),2,'Feed has 2 categories');
$this->assertEqual(count($db_feed->categories),2,t('Feed has 2 categories'));
}
}
...
...
@@ -377,16 +377,16 @@ class UpdateFeedTestCase extends AggregatorTestCase {
$this->assertRaw(t('The feed %name has been updated.',array('%name'=>$edit['title'])),'The feed '.$edit['title'].' has been updated.');
$this->assertRaw(t('The feed %name has been updated.',array('%name'=>$edit['title'])),t('The feed %name has been updated.',array('%name'=>$edit['title'])));
$this->assertResponse(404,'Deleted feed source does not exists.');
$this->assertResponse(404,t('Deleted feed source does not exists.'));
// Check database for feed.
$result=db_query("SELECT COUNT(*) FROM {aggregator_feed} WHERE title = :title AND url = :url",array(':title'=>$feed->title,':url'=>$feed->url))->fetchField();
$this->assertFalse($result,'Feed not found in database');
$this->assertFalse($result,t('Feed not found in database'));
}
}
...
...
@@ -455,10 +455,10 @@ class UpdateFeedItemTestCase extends AggregatorTestCase {
);
$this->drupalGet($edit['url']);
$this->assertResponse(array(200),'URL '.$edit['url'].' is accessible');
$this->assertResponse(array(200),t('URL !url is accessible',array('!url'=>$edit['url'])));
$this->assertRaw(t('The feed %name has been added.',array('%name'=>$edit['title'])),'The feed '.$edit['title'].' has been added.');
$this->assertRaw(t('The feed %name has been added.',array('%name'=>$edit['title'])),t('The feed !name has been added.',array('!name'=>$edit['title'])));
$feed=db_query("SELECT * FROM {aggregator_feed} WHERE url = :url",array(':url'=>$edit['url']))->fetchObject();
@@ -480,7 +480,7 @@ class UpdateFeedItemTestCase extends AggregatorTestCase {
$after=db_query('SELECT timestamp FROM {aggregator_item} WHERE fid = :fid',array(':fid'=>$feed->fid))->fetchField();
$this->assertTrue($before===$after,'Publish timestamp of feed item was not updated ('.$before.' === '.$after.')');
$this->assertTrue($before===$after,t('Publish timestamp of feed item was not updated (!before === !after)',array('!before'=>$before,'!after'=>$after)));
}
}
...
...
@@ -541,14 +541,14 @@ class CategorizeFeedItemTestCase extends AggregatorTestCase {
// Simulate form submission on "admin/config/services/aggregator/add/category".
$this->assertRaw(t('The category %title has been added.',array('%title'=>$edit['title'])),'The category '.$edit['title'].' has been added.');
$this->assertRaw(t('The category %title has been added.',array('%title'=>$edit['title'])),t('The category %title has been added.',array('%title'=>$edit['title'])));
$category=db_query("SELECT * FROM {aggregator_category} WHERE title = :title",array(':title'=>$edit['title']))->fetch();
$this->assertTrue(!empty($category),'The category found in database.');
$this->assertTrue(!empty($category),t('The category found in database.'));
$this->assertRaw(t('A feed with the URL %url already exists.',array('%url'=>$feeds[0]['url'])),'Verifying that a duplicate URL was identified');
$this->assertRaw(t('A feed named %title already exists.',array('%title'=>$feeds[1]['title'])),'Verifying that a duplicate title was identified');
$this->assertRaw(t('A feed with the URL %url already exists.',array('%url'=>$feeds[0]['url'])),t('Verifying that a duplicate URL was identified'));
$this->assertRaw(t('A feed named %title already exists.',array('%title'=>$feeds[1]['title'])),t('Verifying that a duplicate title was identified'));
$after=db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
$this->assertEqual($after,2,'Verifying that two distinct feeds were added.');
$this->assertEqual($after,2,t('Verifying that two distinct feeds were added.'));
$feeds_from_db=db_query("SELECT f.title, f.url, f.refresh, cf.cid FROM {aggregator_feed} f LEFT JOIN {aggregator_category_feed} cf ON f.fid = cf.fid");
$refresh=$category=TRUE;
...
...
@@ -690,10 +690,10 @@ class ImportOPMLTestCase extends AggregatorTestCase {
$refresh=$refresh&&$feed->refresh==900;
}
$this->assertEqual($title[$feeds[0]['url']],$feeds[0]['title'],'First feed was added correctly.');
$this->assertEqual($url[$feeds[1]['title']],$feeds[1]['url'],'Second feed was added correctly.');
$this->assertTrue($refresh,'Refresh times are correct.');
$this->assertTrue($category,'Categories are correct.');
$this->assertEqual($title[$feeds[0]['url']],$feeds[0]['title'],t('First feed was added correctly.'));
$this->assertEqual($url[$feeds[1]['title']],$feeds[1]['url'],t('Second feed was added correctly.'));
$this->assertTrue($refresh,t('Refresh times are correct.'));
$this->assertTrue($category,t('Categories are correct.'));
}
functiontestOPMLImport(){
...
...
@@ -793,20 +793,20 @@ class AggregatorRenderingTestCase extends AggregatorTestCase {
$this->assertFieldByName($block['module'].'_'.$block['delta'].'[region]','','Aggregator feed block is available for positioning.');
@@ -38,8 +38,8 @@ class BlogTestCase extends DrupalWebTestCase {
$this->drupalGet('blog/'.$this->big_user->uid);
$this->assertResponse(200);
$this->assertTitle(t("@name's blog",array('@name'=>format_username($this->big_user))).' | Drupal','Blog title was displayed');
$this->assertText(t('You are not allowed to post a new blog entry.'),'No new entries can be posted without the right permission');
$this->assertTitle(t("@name's blog",array('@name'=>format_username($this->big_user))).' | Drupal',t('Blog title was displayed'));
$this->assertText(t('You are not allowed to post a new blog entry.'),t('No new entries can be posted without the right permission'));
}
/**
...
...
@@ -50,8 +50,8 @@ class BlogTestCase extends DrupalWebTestCase {
$this->drupalGet('blog/'.$this->own_user->uid);
$this->assertResponse(200);
$this->assertTitle(t("@name's blog",array('@name'=>format_username($this->own_user))).' | Drupal','Blog title was displayed');
$this->assertText(t('@author has not created any blog entries.',array('@author'=>format_username($this->own_user))),'Users blog displayed with no entries');
$this->assertTitle(t("@name's blog",array('@name'=>format_username($this->own_user))).' | Drupal',t('Blog title was displayed'));
$this->assertText(t('@author has not created any blog entries.',array('@author'=>format_username($this->own_user))),t('Users blog displayed with no entries'));
}
/**
...
...
@@ -69,7 +69,7 @@ class BlogTestCase extends DrupalWebTestCase {
$this->pass('Node '.$number.' doesn\'t have outline.');
$this->pass(t('Node '.$number.' doesn\'t have outline.'));
}
// Check previous, up, and next links.
if($previous){
$this->assertRaw(l('‹ '.$previous->title,'node/'.$previous->nid,array('attributes'=>array('class'=>array('page-previous'),'title'=>t('Go to previous page')))),'Previous page link found.');
$this->assertRaw(l('‹ '.$previous->title,'node/'.$previous->nid,array('attributes'=>array('class'=>array('page-previous'),'title'=>t('Go to previous page')))),t('Previous page link found.'));
}
if($up){
$this->assertRaw(l('up','node/'.$up->nid,array('attributes'=>array('class'=>array('page-up'),'title'=>t('Go to parent page')))),'Up page link found.');
$this->assertRaw(l('up','node/'.$up->nid,array('attributes'=>array('class'=>array('page-up'),'title'=>t('Go to parent page')))),t('Up page link found.'));
}
if($next){
$this->assertRaw(l($next->title.' ›','node/'.$next->nid,array('attributes'=>array('class'=>array('page-next'),'title'=>t('Go to next page')))),'Next page link found.');
$this->assertRaw(l($next->title.' ›','node/'.$next->nid,array('attributes'=>array('class'=>array('page-next'),'title'=>t('Go to next page')))),t('Next page link found.'));
}
// Compute the expected breadcrumb.
...
...
@@ -153,12 +153,12 @@ class BookTestCase extends DrupalWebTestCase {
}
// Compare expected and got breadcrumbs.
$this->assertIdentical($expected_breadcrumb,$got_breadcrumb,'The breadcrumb is correctly displayed on the page.');
$this->assertIdentical($expected_breadcrumb,$got_breadcrumb,t('The breadcrumb is correctly displayed on the page.'));
// Check printer friendly version.
$this->drupalGet('book/export/html/'.$node->nid);
$this->assertText($node->title,'Printer friendly title found.');
$this->assertRaw(check_markup($node->body[LANGUAGE_NONE][0]['value'],$node->body[LANGUAGE_NONE][0]['format']),'Printer friendly body found.');
$this->assertText($node->title,t('Printer friendly title found.'));
$this->assertRaw(check_markup($node->body[LANGUAGE_NONE][0]['value'],$node->body[LANGUAGE_NONE][0]['format']),t('Printer friendly body found.'));
$number++;
}
...
...
@@ -206,44 +206,44 @@ class BookTestCase extends DrupalWebTestCase {
$this->assertNotNull(($node===FALSE?NULL:$node),'Book node found in database.');
$this->assertNotNull(($node===FALSE?NULL:$node),t('Book node found in database.'));
$number++;
return$node;
}
/**
* Tests book export ("printer-friendly version") functionality.
*/
functiontestBookExport(){
// Create a book.
$nodes=$this->createBook();
// Login as web user and view printer-friendly version.
$this->drupalLogin($this->web_user);
$this->drupalGet('node/'.$this->book->nid);
$this->clickLink(t('Printer-friendly version'));
// Make sure each part of the book is there.
foreach($nodesas$node){
$this->assertText($node->title,'Node title found in printer friendly version.');
$this->assertRaw(check_markup($node->body[LANGUAGE_NONE][0]['value'],$node->body[LANGUAGE_NONE][0]['format']),'Node body found in printer friendly version.');
$this->assertText($node->title,t('Node title found in printer friendly version.'));
$this->assertRaw(check_markup($node->body[LANGUAGE_NONE][0]['value'],$node->body[LANGUAGE_NONE][0]['format']),t('Node body found in printer friendly version.'));
}
// Make sure we can't export an unsupported format.