diff --git a/modules/aggregator/aggregator.test b/modules/aggregator/aggregator.test index 160f8ba6a96f9c5a94cf5268d040add13c0dc08a..eb0343afb93b6dee500b8e4dd3b435cccf357f8d 100644 --- a/modules/aggregator/aggregator.test +++ b/modules/aggregator/aggregator.test @@ -26,10 +26,10 @@ class AggregatorTestCase extends DrupalWebTestCase { function createFeed($feed_url = NULL) { $edit = $this->getFeedEditArray($feed_url); $this->drupalPost('admin/config/services/aggregator/add/feed', $edit, t('Save')); - $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), t('The feed !name has been added.', array('!name' => $edit['title']))); + $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), 'The feed ' . $edit['title'] . ' has been added.'); $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), t('The feed found in database.')); + $this->assertTrue(!empty($feed), 'The feed found in database.'); return $feed; } @@ -41,7 +41,7 @@ class AggregatorTestCase extends DrupalWebTestCase { */ function deleteFeed($feed) { $this->drupalPost('admin/config/services/aggregator/edit/feed/' . $feed->fid, array(), t('Delete')); - $this->assertRaw(t('The feed %title has been deleted.', array('%title' => $feed->title)), t('Feed deleted successfully.')); + $this->assertRaw(t('The feed %title has been deleted.', array('%title' => $feed->title)), 'Feed deleted successfully.'); } /** @@ -91,7 +91,7 @@ class AggregatorTestCase extends DrupalWebTestCase { function updateFeedItems(&$feed, $expected_count) { // First, let's ensure we can get to the rss xml. $this->drupalGet($feed->url); - $this->assertResponse(200, t('!url is reachable.', array('!url' => $feed->url))); + $this->assertResponse(200, $feed->url . ' is reachable.'); // Refresh the feed (simulated link click). $this->drupalGet('admin/config/services/aggregator/update/' . $feed->fid); @@ -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, t('Total items in feed equal to the total items in database (!val1 != !val2)', array('!val1' => $expected_count, '!val2' => $feed->item_count))); + $this->assertEqual($expected_count, $feed->item_count, 'Total items in feed equal to the total items in database (' . $expected_count . ' != ' . $feed->item_count . ')'); } /** @@ -115,7 +115,7 @@ class AggregatorTestCase extends DrupalWebTestCase { */ function removeFeedItems($feed) { $this->drupalPost('admin/config/services/aggregator/remove/' . $feed->fid, array(), t('Remove items')); - $this->assertRaw(t('The news items from %title have been removed.', array('%title' => $feed->title)), t('Feed items removed.')); + $this->assertRaw(t('The news items from %title have been removed.', array('%title' => $feed->title)), 'Feed items removed.'); } /** @@ -295,15 +295,15 @@ class AddFeedTestCase extends AggregatorTestCase { $feed = $this->createFeed(); // Check feed data. - $this->assertEqual($this->getUrl(), url('admin/config/services/aggregator/add/feed', array('absolute' => TRUE)), t('Directed to correct url.')); - $this->assertTrue($this->uniqueFeed($feed->title, $feed->url), t('The feed is unique.')); + $this->assertEqual($this->getUrl(), url('admin/config/services/aggregator/add/feed', array('absolute' => TRUE)), 'Directed to correct url.'); + $this->assertTrue($this->uniqueFeed($feed->title, $feed->url), 'The feed is unique.'); // Check feed source. $this->drupalGet('aggregator/sources/' . $feed->fid); - $this->assertResponse(200, t('Feed source exists.')); - $this->assertText($feed->title, t('Page title')); + $this->assertResponse(200, 'Feed source exists.'); + $this->assertText($feed->title, 'Page title'); $this->drupalGet('aggregator/sources/' . $feed->fid . '/categorize'); - $this->assertResponse(200, t('Feed categorization page exists.')); + $this->assertResponse(200, 'Feed categorization page exists.'); // Delete feed. $this->deleteFeed($feed); @@ -327,11 +327,11 @@ class CategorizeFeedTestCase extends AggregatorTestCase { // Create 2 categories. $category_1 = array('title' => $this->randomName(10), 'description' => ''); $this->drupalPost('admin/config/services/aggregator/add/category', $category_1, t('Save')); - $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_1['title'])), 'The category ' . $category_1['title'] . ' has been added.'); $category_2 = array('title' => $this->randomName(10), 'description' => ''); $this->drupalPost('admin/config/services/aggregator/add/category', $category_2, t('Save')); - $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']))); + $this->assertRaw(t('The category %title has been added.', array('%title' => $category_2['title'])), 'The category ' . $category_2['title'] . ' has been added.'); // 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, t('Feed has 2 categories')); + $this->assertEqual(count($db_feed->categories), 2, 'Feed has 2 categories'); } } @@ -377,16 +377,16 @@ class UpdateFeedTestCase extends AggregatorTestCase { $edit[$same_field] = $feed->{$same_field}; } $this->drupalPost('admin/config/services/aggregator/edit/feed/' . $feed->fid, $edit, t('Save')); - $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->assertRaw(t('The feed %name has been updated.', array('%name' => $edit['title'])), 'The feed ' . $edit['title'] . ' has been updated.'); // Check feed data. $this->assertEqual($this->getUrl(), url('admin/config/services/aggregator/', array('absolute' => TRUE))); - $this->assertTrue($this->uniqueFeed($edit['title'], $edit['url']), t('The feed is unique.')); + $this->assertTrue($this->uniqueFeed($edit['title'], $edit['url']), 'The feed is unique.'); // Check feed source. $this->drupalGet('aggregator/sources/' . $feed->fid); - $this->assertResponse(200, t('Feed source exists.')); - $this->assertText($edit['title'], t('Page title')); + $this->assertResponse(200, 'Feed source exists.'); + $this->assertText($edit['title'], 'Page title'); // Delete feed. $feed->title = $edit['title']; // Set correct title so deleteFeed() will work. @@ -415,11 +415,11 @@ class RemoveFeedTestCase extends AggregatorTestCase { // Check feed source. $this->drupalGet('aggregator/sources/' . $feed->fid); - $this->assertResponse(404, t('Deleted feed source does not exists.')); + $this->assertResponse(404, '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, t('Feed not found in database')); + $this->assertFalse($result, 'Feed not found in database'); } } @@ -455,10 +455,10 @@ class UpdateFeedItemTestCase extends AggregatorTestCase { ); $this->drupalGet($edit['url']); - $this->assertResponse(array(200), t('URL !url is accessible', array('!url' => $edit['url']))); + $this->assertResponse(array(200), 'URL ' . $edit['url'] . ' is accessible'); $this->drupalPost('admin/config/services/aggregator/add/feed', $edit, t('Save')); - $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), t('The feed !name has been added.', array('!name' => $edit['title']))); + $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), 'The feed ' . $edit['title'] . ' has been added.'); $feed = db_query("SELECT * FROM {aggregator_feed} WHERE url = :url", array(':url' => $edit['url']))->fetchObject(); $this->drupalGet('admin/config/services/aggregator/update/' . $feed->fid); @@ -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, t('Publish timestamp of feed item was not updated (!before === !after)', array('!before' => $before, '!after' => $after))); + $this->assertTrue($before === $after, 'Publish timestamp of feed item was not updated (' . $before . ' === ' . $after . ')'); } } @@ -541,14 +541,14 @@ class CategorizeFeedItemTestCase extends AggregatorTestCase { // Simulate form submission on "admin/config/services/aggregator/add/category". $edit = array('title' => $this->randomName(10), 'description' => ''); $this->drupalPost('admin/config/services/aggregator/add/category', $edit, t('Save')); - $this->assertRaw(t('The category %title has been added.', array('%title' => $edit['title'])), t('The category %title has been added.', array('%title' => $edit['title']))); + $this->assertRaw(t('The category %title has been added.', array('%title' => $edit['title'])), 'The category ' . $edit['title'] . ' has been added.'); $category = db_query("SELECT * FROM {aggregator_category} WHERE title = :title", array(':title' => $edit['title']))->fetch(); - $this->assertTrue(!empty($category), t('The category found in database.')); + $this->assertTrue(!empty($category), 'The category found in database.'); $link_path = 'aggregator/categories/' . $category->cid; $menu_link = db_query("SELECT * FROM {menu_links} WHERE link_path = :link_path", array(':link_path' => $link_path))->fetch(); - $this->assertTrue(!empty($menu_link), t('The menu link associated with the category found in database.')); + $this->assertTrue(!empty($menu_link), 'The menu link associated with the category found in database.'); $feed = $this->createFeed(); db_insert('aggregator_category_feed') @@ -559,7 +559,7 @@ class CategorizeFeedItemTestCase extends AggregatorTestCase { ->execute(); $this->updateFeedItems($feed, $this->getDefaultFeedItemCount()); $this->getFeedCategories($feed); - $this->assertTrue(!empty($feed->categories), t('The category found in the feed.')); + $this->assertTrue(!empty($feed->categories), 'The category found in the feed.'); // For each category of a feed, ensure feed items have that category, too. if (!empty($feed->categories) && !empty($feed->items)) { @@ -570,7 +570,7 @@ class CategorizeFeedItemTestCase extends AggregatorTestCase { ->execute() ->fetchField(); - $this->assertEqual($feed->item_count, $categorized_count, t('Total items in feed equal to the total categorized feed items in database')); + $this->assertEqual($feed->item_count, $categorized_count, 'Total items in feed equal to the total categorized feed items in database'); } } @@ -603,11 +603,11 @@ class ImportOPMLTestCase extends AggregatorTestCase { ->execute(); $this->drupalGet('admin/config/services/aggregator/add/opml'); - $this->assertText('A single OPML document may contain a collection of many feeds.', t('Looking for help text.')); - $this->assertFieldByName('files[upload]', '', t('Looking for file upload field.')); - $this->assertFieldByName('remote', '', t('Looking for remote URL field.')); - $this->assertFieldByName('refresh', '', t('Looking for refresh field.')); - $this->assertFieldByName("category[$cid]", $cid, t('Looking for category field.')); + $this->assertText('A single OPML document may contain a collection of many feeds.', 'Looking for help text.'); + $this->assertFieldByName('files[upload]', '', 'Looking for file upload field.'); + $this->assertFieldByName('remote', '', 'Looking for remote URL field.'); + $this->assertFieldByName('refresh', '', 'Looking for refresh field.'); + $this->assertFieldByName("category[$cid]", $cid, 'Looking for category field.'); } /** @@ -618,7 +618,7 @@ class ImportOPMLTestCase extends AggregatorTestCase { $edit = array(); $this->drupalPost('admin/config/services/aggregator/add/opml', $edit, t('Import')); - $this->assertRaw(t('You must either upload a file or enter a URL.'), t('Error if no fields are filled.')); + $this->assertRaw(t('You must either upload a file or enter a URL.'), 'Error if no fields are filled.'); $path = $this->getEmptyOpml(); $edit = array( @@ -626,14 +626,14 @@ class ImportOPMLTestCase extends AggregatorTestCase { 'remote' => file_create_url($path), ); $this->drupalPost('admin/config/services/aggregator/add/opml', $edit, t('Import')); - $this->assertRaw(t('You must either upload a file or enter a URL.'), t('Error if both fields are filled.')); + $this->assertRaw(t('You must either upload a file or enter a URL.'), 'Error if both fields are filled.'); $edit = array('remote' => 'invalidUrl://empty'); $this->drupalPost('admin/config/services/aggregator/add/opml', $edit, t('Import')); - $this->assertText(t('This URL is not valid.'), t('Error if the URL is invalid.')); + $this->assertText(t('This URL is not valid.'), 'Error if the URL is invalid.'); $after = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField(); - $this->assertEqual($before, $after, t('No feeds were added during the three last form submissions.')); + $this->assertEqual($before, $after, 'No feeds were added during the three last form submissions.'); } /** @@ -644,14 +644,14 @@ class ImportOPMLTestCase extends AggregatorTestCase { $form['files[upload]'] = $this->getInvalidOpml(); $this->drupalPost('admin/config/services/aggregator/add/opml', $form, t('Import')); - $this->assertText(t('No new feed has been added.'), t('Attempting to upload invalid XML.')); + $this->assertText(t('No new feed has been added.'), 'Attempting to upload invalid XML.'); $edit = array('remote' => file_create_url($this->getEmptyOpml())); $this->drupalPost('admin/config/services/aggregator/add/opml', $edit, t('Import')); - $this->assertText(t('No new feed has been added.'), t('Attempting to load empty OPML from remote URL.')); + $this->assertText(t('No new feed has been added.'), 'Attempting to load empty OPML from remote URL.'); $after = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField(); - $this->assertEqual($before, $after, t('No feeds were added during the two last form submissions.')); + $this->assertEqual($before, $after, 'No feeds were added during the two last form submissions.'); db_delete('aggregator_feed')->execute(); db_delete('aggregator_category')->execute(); @@ -675,11 +675,11 @@ class ImportOPMLTestCase extends AggregatorTestCase { 'category[1]' => $category, ); $this->drupalPost('admin/config/services/aggregator/add/opml', $edit, t('Import')); - $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')); + $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'); $after = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField(); - $this->assertEqual($after, 2, t('Verifying that two distinct feeds were added.')); + $this->assertEqual($after, 2, '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'], 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.')); + $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.'); } function testOPMLImport() { @@ -793,20 +793,20 @@ class AggregatorRenderingTestCase extends AggregatorTestCase { $this->assertFieldByName($block['module'] . '_' . $block['delta'] . '[region]', '', 'Aggregator feed block is available for positioning.'); // Position it. $this->drupalPost('admin/structure/block', $edit, t('Save blocks')); - $this->assertText(t('The block settings have been updated.'), t('Block successfully moved to %region_name region.', array( '%region_name' => $region))); + $this->assertText(t('The block settings have been updated.'), 'Block successfully moved to ' . $region . ' region.'); // Confirm that the block is now being displayed on pages. $this->drupalGet('node'); - $this->assertText(t($block['title']), t('Feed block is displayed on the page.')); + $this->assertText(t($block['title']), 'Feed block is displayed on the page.'); // Find the expected read_more link. $href = 'aggregator/sources/' . $feed->fid; $links = $this->xpath('//a[@href = :href]', array(':href' => url($href))); - $this->assert(isset($links[0]), t('Link to href %href found.', array('%href' => $href))); + $this->assert(isset($links[0]), 'Link to href ' . $href . ' found.'); // Visit that page. $this->drupalGet($href); $correct_titles = $this->xpath('//h1[normalize-space(text())=:title]', array(':title' => $feed->title)); - $this->assertFalse(empty($correct_titles), t('Aggregator feed page is available and has the correct title.')); + $this->assertFalse(empty($correct_titles), 'Aggregator feed page is available and has the correct title.'); } } @@ -837,7 +837,7 @@ class FeedParserTestCase extends AggregatorTestCase { $feed = $this->createFeed($this->getRSS091Sample()); aggregator_refresh($feed); $this->drupalGet('aggregator/sources/' . $feed->fid); - $this->assertResponse(200, t('Feed %name exists.', array('%name' => $feed->title))); + $this->assertResponse(200, 'Feed ' . $feed->title . ' exists.'); $this->assertText('First example feed item title'); $this->assertLinkByHref('http://example.com/example-turns-one'); $this->assertText('First example feed item description.'); @@ -850,7 +850,7 @@ class FeedParserTestCase extends AggregatorTestCase { $feed = $this->createFeed($this->getAtomSample()); aggregator_refresh($feed); $this->drupalGet('aggregator/sources/' . $feed->fid); - $this->assertResponse(200, t('Feed %name exists.', array('%name' => $feed->title))); + $this->assertResponse(200, 'Feed ' . $feed->title . ' exists.'); $this->assertText('Atom-Powered Robots Run Amok'); $this->assertLinkByHref('http://example.org/2003/12/13/atom03'); $this->assertText('Some text.'); diff --git a/modules/block/block.test b/modules/block/block.test index 86584df7e813a271cb709e18e725031f7895677b..7cb70aaf1709e867abe8cd96e71c3c4787c8e8c2 100644 --- a/modules/block/block.test +++ b/modules/block/block.test @@ -46,9 +46,9 @@ class BlockTestCase extends DrupalWebTestCase { function testCustomBlock() { // Confirm that the add block link appears on block overview pages. $this->drupalGet('admin/structure/block'); - $this->assertRaw(l('Add block', 'admin/structure/block/add'), t('Add block link is present on block overview page for default theme.')); + $this->assertRaw(l('Add block', 'admin/structure/block/add'), 'Add block link is present on block overview page for default theme.'); $this->drupalGet('admin/structure/block/list/seven'); - $this->assertRaw(l('Add block', 'admin/structure/block/list/seven/add'), t('Add block link is present on block overview page for non-default theme.')); + $this->assertRaw(l('Add block', 'admin/structure/block/list/seven/add'), 'Add block link is present on block overview page for non-default theme.'); // Confirm that hidden regions are not shown as options for block placement // when adding a new block. @@ -59,7 +59,7 @@ class BlockTestCase extends DrupalWebTestCase { if ($theme->status) { foreach ($theme->info['regions_hidden'] as $hidden_region) { $elements = $this->xpath('//select[@id=:id]//option[@value=:value]', array(':id' => 'edit-regions-' . $key, ':value' => $hidden_region)); - $this->assertFalse(isset($elements[0]), t('The hidden region @region is not available for @theme.', array('@region' => $hidden_region, '@theme' => $key))); + $this->assertFalse(isset($elements[0]), 'The hidden region ' . $hidden_region . ' is not available for ' . $key . '.'); } } } @@ -72,11 +72,11 @@ class BlockTestCase extends DrupalWebTestCase { $this->drupalPost('admin/structure/block/add', $custom_block, t('Save block')); // Confirm that the custom block has been created, and then query the created bid. - $this->assertText(t('The block has been created.'), t('Custom block successfully created.')); + $this->assertText(t('The block has been created.'), 'Custom block successfully created.'); $bid = db_query("SELECT bid FROM {block_custom} WHERE info = :info", array(':info' => $custom_block['info']))->fetchField(); // Check to see if the custom block was created by checking that it's in the database.. - $this->assertNotNull($bid, t('Custom block found in database')); + $this->assertNotNull($bid, 'Custom block found in database'); // Check if the block can be moved to all availble regions. $custom_block['module'] = 'block'; @@ -87,8 +87,8 @@ class BlockTestCase extends DrupalWebTestCase { // Verify presence of configure and delete links for custom block. $this->drupalGet('admin/structure/block'); - $this->assertRaw(l(t('configure'), 'admin/structure/block/manage/block/' . $bid . '/configure'), t('Custom block configure link found.')); - $this->assertRaw(l(t('delete'), 'admin/structure/block/manage/block/' . $bid . '/delete'), t('Custom block delete link found.')); + $this->assertRaw(l(t('configure'), 'admin/structure/block/manage/block/' . $bid . '/configure'), 'Custom block configure link found.'); + $this->assertRaw(l(t('delete'), 'admin/structure/block/manage/block/' . $bid . '/delete'), 'Custom block delete link found.'); // Set visibility only for authenticated users, to verify delete functionality. $edit = array(); @@ -98,10 +98,10 @@ class BlockTestCase extends DrupalWebTestCase { // Delete the created custom block & verify that it's been deleted and no longer appearing on the page. $this->clickLink(t('delete')); $this->drupalPost('admin/structure/block/manage/block/' . $bid . '/delete', array(), t('Delete')); - $this->assertRaw(t('The block %title has been removed.', array('%title' => $custom_block['info'])), t('Custom block successfully deleted.')); - $this->assertNoText(t($custom_block['title']), t('Custom block no longer appears on page.')); + $this->assertRaw(t('The block %title has been removed.', array('%title' => $custom_block['info'])), 'Custom block successfully deleted.'); + $this->assertNoText(t($custom_block['title']), 'Custom block no longer appears on page.'); $count = db_query("SELECT 1 FROM {block_role} WHERE module = :module AND delta = :delta", array(':module' => $custom_block['module'], ':delta' => $custom_block['delta']))->fetchField(); - $this->assertFalse($count, t('Table block_role being cleaned.')); + $this->assertFalse($count, 'Table block_role being cleaned.'); } /** @@ -125,20 +125,20 @@ class BlockTestCase extends DrupalWebTestCase { // Confirm that the custom block is being displayed using configured text format. $this->drupalGet('node'); - $this->assertRaw('
-
-
-
';
$this->drupalPost('admin/config/content/formats/' . $filtered, $edit, t('Save configuration'));
- $this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], t('Allowed HTML tag added.'));
+ $this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], 'Allowed HTML tag added.');
$result = db_query('SELECT * FROM {cache_filter}')->fetchObject();
- $this->assertFalse($result, t('Cache cleared.'));
+ $this->assertFalse($result, 'Cache cleared.');
$elements = $this->xpath('//select[@name=:first]/following::select[@name=:second]', array(
':first' => 'filters[' . $first_filter . '][weight]',
':second' => 'filters[' . $second_filter . '][weight]',
));
- $this->assertTrue(!empty($elements), t('Order confirmed in admin interface.'));
+ $this->assertTrue(!empty($elements), 'Order confirmed in admin interface.');
// Reorder filters.
$edit = array();
$edit['filters[' . $second_filter . '][weight]'] = 1;
$edit['filters[' . $first_filter . '][weight]'] = 2;
$this->drupalPost(NULL, $edit, t('Save configuration'));
- $this->assertFieldByName('filters[' . $second_filter . '][weight]', 1, t('Order saved successfully.'));
- $this->assertFieldByName('filters[' . $first_filter . '][weight]', 2, t('Order saved successfully.'));
+ $this->assertFieldByName('filters[' . $second_filter . '][weight]', 1, 'Order saved successfully.');
+ $this->assertFieldByName('filters[' . $first_filter . '][weight]', 2, 'Order saved successfully.');
$elements = $this->xpath('//select[@name=:first]/following::select[@name=:second]', array(
':first' => 'filters[' . $second_filter . '][weight]',
':second' => 'filters[' . $first_filter . '][weight]',
));
- $this->assertTrue(!empty($elements), t('Reorder confirmed in admin interface.'));
+ $this->assertTrue(!empty($elements), 'Reorder confirmed in admin interface.');
$result = db_query('SELECT * FROM {filter} WHERE format = :format ORDER BY weight ASC', array(':format' => $filtered));
$filters = array();
@@ -265,7 +265,7 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$filters[] = $filter;
}
}
- $this->assertTrue(($filters[0]->name == $second_filter && $filters[1]->name == $first_filter), t('Order confirmed in database.'));
+ $this->assertTrue(($filters[0]->name == $second_filter && $filters[1]->name == $first_filter), 'Order confirmed in database.');
// Add format.
$edit = array();
@@ -274,18 +274,18 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$edit['filters[' . $second_filter . '][status]'] = TRUE;
$edit['filters[' . $first_filter . '][status]'] = TRUE;
$this->drupalPost('admin/config/content/formats/add', $edit, t('Save configuration'));
- $this->assertRaw(t('Added text format %format.', array('%format' => $edit['name'])), t('New filter created.'));
+ $this->assertRaw(t('Added text format %format.', array('%format' => $edit['name'])), 'New filter created.');
$format = $this->getFormat($edit['name']);
- $this->assertNotNull($format, t('Format found in database.'));
+ $this->assertNotNull($format, 'Format found in database.');
- $this->assertFieldByName('roles[2]', '', t('Role found.'));
- $this->assertFieldByName('filters[' . $second_filter . '][status]', '', t('Line break filter found.'));
- $this->assertFieldByName('filters[' . $first_filter . '][status]', '', t('Url filter found.'));
+ $this->assertFieldByName('roles[2]', '', 'Role found.');
+ $this->assertFieldByName('filters[' . $second_filter . '][status]', '', 'Line break filter found.');
+ $this->assertFieldByName('filters[' . $first_filter . '][status]', '', 'Url filter found.');
// Delete new filter.
$this->drupalPost('admin/config/content/formats/' . $format->format . '/delete', array(), t('Delete'));
- $this->assertRaw(t('Deleted text format %format.', array('%format' => $edit['name'])), t('Format successfully deleted.'));
+ $this->assertRaw(t('Deleted text format %format.', array('%format' => $edit['name'])), 'Format successfully deleted.');
// Allow authenticated users on full HTML.
$format = filter_format_load($full);
@@ -293,14 +293,14 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$edit['roles[1]'] = 0;
$edit['roles[2]'] = 1;
$this->drupalPost('admin/config/content/formats/' . $full, $edit, t('Save configuration'));
- $this->assertRaw(t('The text format %format has been updated.', array('%format' => $format->name)), t('Full HTML format successfully updated.'));
+ $this->assertRaw(t('The text format %format has been updated.', array('%format' => $format->name)), 'Full HTML format successfully updated.');
// Switch user.
$this->drupalLogout();
$this->drupalLogin($this->web_user);
$this->drupalGet('node/add/page');
- $this->assertRaw('', t('Full HTML filter accessible.'));
+ $this->assertRaw('', 'Full HTML filter accessible.');
// Use filtered HTML and see if it removes tags that are not allowed.
$body = '' . $this->randomName() . '';
@@ -313,20 +313,20 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$edit["body[$langcode][0][value]"] = $text;
$edit["body[$langcode][0][format]"] = $filtered;
$this->drupalPost('node/add/page', $edit, t('Save'));
- $this->assertRaw(t('Basic page %title has been created.', array('%title' => $edit["title"])), t('Filtered node created.'));
+ $this->assertRaw(t('Basic page %title has been created.', array('%title' => $edit["title"])), 'Filtered node created.');
$node = $this->drupalGetNodeByTitle($edit["title"]);
- $this->assertTrue($node, t('Node found in database.'));
+ $this->assertTrue($node, 'Node found in database.');
$this->drupalGet('node/' . $node->nid);
- $this->assertRaw($body . $extra_text, t('Filter removed invalid tag.'));
+ $this->assertRaw($body . $extra_text, 'Filter removed invalid tag.');
// Use plain text and see if it escapes all tags, whether allowed or not.
$edit = array();
$edit["body[$langcode][0][format]"] = $plain;
$this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
$this->drupalGet('node/' . $node->nid);
- $this->assertText(check_plain($text), t('The "Plain text" text format escapes all HTML tags.'));
+ $this->assertText(check_plain($text), 'The "Plain text" text format escapes all HTML tags.');
// Switch user.
$this->drupalLogout();
@@ -337,22 +337,22 @@ class FilterAdminTestCase extends DrupalWebTestCase {
$edit = array();
$edit['filters[filter_html][settings][allowed_html]'] = ' -
-
- ';
$this->drupalPost('admin/config/content/formats/' . $filtered, $edit, t('Save configuration'));
- $this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], t('Changes reverted.'));
+ $this->assertFieldByName('filters[filter_html][settings][allowed_html]', $edit['filters[filter_html][settings][allowed_html]'], 'Changes reverted.');
// Full HTML.
$edit = array();
$edit['roles[2]'] = FALSE;
$this->drupalPost('admin/config/content/formats/' . $full, $edit, t('Save configuration'));
- $this->assertRaw(t('The text format %format has been updated.', array('%format' => $format->name)), t('Full HTML format successfully reverted.'));
- $this->assertFieldByName('roles[2]', $edit['roles[2]'], t('Changes reverted.'));
+ $this->assertRaw(t('The text format %format has been updated.', array('%format' => $format->name)), 'Full HTML format successfully reverted.');
+ $this->assertFieldByName('roles[2]', $edit['roles[2]'], 'Changes reverted.');
// Filter order.
$edit = array();
$edit['filters[' . $second_filter . '][weight]'] = 2;
$edit['filters[' . $first_filter . '][weight]'] = 1;
$this->drupalPost('admin/config/content/formats/' . $filtered, $edit, t('Save configuration'));
- $this->assertFieldByName('filters[' . $second_filter . '][weight]', $edit['filters[' . $second_filter . '][weight]'], t('Changes reverted.'));
- $this->assertFieldByName('filters[' . $first_filter . '][weight]', $edit['filters[' . $first_filter . '][weight]'], t('Changes reverted.'));
+ $this->assertFieldByName('filters[' . $second_filter . '][weight]', $edit['filters[' . $second_filter . '][weight]'], 'Changes reverted.');
+ $this->assertFieldByName('filters[' . $first_filter . '][weight]', $edit['filters[' . $first_filter . '][weight]'], 'Changes reverted.');
}
/**
@@ -441,28 +441,28 @@ class FilterFormatAccessTestCase extends DrupalWebTestCase {
function testFormatPermissions() {
// Make sure that a regular user only has access to the text format they
// were granted access to, as well to the fallback format.
- $this->assertTrue(filter_access($this->allowed_format, $this->web_user), t('A regular user has access to a text format they were granted access to.'));
- $this->assertFalse(filter_access($this->disallowed_format, $this->web_user), t('A regular user does not have access to a text format they were not granted access to.'));
- $this->assertTrue(filter_access(filter_format_load(filter_fallback_format()), $this->web_user), t('A regular user has access to the fallback format.'));
+ $this->assertTrue(filter_access($this->allowed_format, $this->web_user), 'A regular user has access to a text format they were granted access to.');
+ $this->assertFalse(filter_access($this->disallowed_format, $this->web_user), 'A regular user does not have access to a text format they were not granted access to.');
+ $this->assertTrue(filter_access(filter_format_load(filter_fallback_format()), $this->web_user), 'A regular user has access to the fallback format.');
// Perform similar checks as above, but now against the entire list of
// available formats for this user.
- $this->assertTrue(in_array($this->allowed_format->format, array_keys(filter_formats($this->web_user))), t('The allowed format appears in the list of available formats for a regular user.'));
- $this->assertFalse(in_array($this->disallowed_format->format, array_keys(filter_formats($this->web_user))), t('The disallowed format does not appear in the list of available formats for a regular user.'));
- $this->assertTrue(in_array(filter_fallback_format(), array_keys(filter_formats($this->web_user))), t('The fallback format appears in the list of available formats for a regular user.'));
+ $this->assertTrue(in_array($this->allowed_format->format, array_keys(filter_formats($this->web_user))), 'The allowed format appears in the list of available formats for a regular user.');
+ $this->assertFalse(in_array($this->disallowed_format->format, array_keys(filter_formats($this->web_user))), 'The disallowed format does not appear in the list of available formats for a regular user.');
+ $this->assertTrue(in_array(filter_fallback_format(), array_keys(filter_formats($this->web_user))), 'The fallback format appears in the list of available formats for a regular user.');
// Make sure that a regular user only has permission to use the format
// they were granted access to.
- $this->assertTrue(user_access(filter_permission_name($this->allowed_format), $this->web_user), t('A regular user has permission to use the allowed text format.'));
- $this->assertFalse(user_access(filter_permission_name($this->disallowed_format), $this->web_user), t('A regular user does not have permission to use the disallowed text format.'));
+ $this->assertTrue(user_access(filter_permission_name($this->allowed_format), $this->web_user), 'A regular user has permission to use the allowed text format.');
+ $this->assertFalse(user_access(filter_permission_name($this->disallowed_format), $this->web_user), 'A regular user does not have permission to use the disallowed text format.');
// Make sure that the allowed format appears on the node form and that
// the disallowed format does not.
$this->drupalLogin($this->web_user);
$this->drupalGet('node/add/page');
- $this->assertRaw($this->formatSelectorHTML($this->allowed_format), t('The allowed text format appears as an option when adding a new node.'));
- $this->assertNoRaw($this->formatSelectorHTML($this->disallowed_format), t('The disallowed text format does not appear as an option when adding a new node.'));
- $this->assertRaw($this->formatSelectorHTML(filter_format_load(filter_fallback_format())), t('The fallback format appears as an option when adding a new node.'));
+ $this->assertRaw($this->formatSelectorHTML($this->allowed_format), 'The allowed text format appears as an option when adding a new node.');
+ $this->assertNoRaw($this->formatSelectorHTML($this->disallowed_format), 'The disallowed text format does not appear as an option when adding a new node.');
+ $this->assertRaw($this->formatSelectorHTML(filter_format_load(filter_fallback_format())), 'The fallback format appears as an option when adding a new node.');
}
function testFormatRoles() {
@@ -472,17 +472,17 @@ class FilterFormatAccessTestCase extends DrupalWebTestCase {
// Check that this role appears in the list of roles that have access to an
// allowed text format, but does not appear in the list of roles that have
// access to a disallowed text format.
- $this->assertTrue(in_array($rid, array_keys(filter_get_roles_by_format($this->allowed_format))), t('A role which has access to a text format appears in the list of roles that have access to that format.'));
- $this->assertFalse(in_array($rid, array_keys(filter_get_roles_by_format($this->disallowed_format))), t('A role which does not have access to a text format does not appear in the list of roles that have access to that format.'));
+ $this->assertTrue(in_array($rid, array_keys(filter_get_roles_by_format($this->allowed_format))), 'A role which has access to a text format appears in the list of roles that have access to that format.');
+ $this->assertFalse(in_array($rid, array_keys(filter_get_roles_by_format($this->disallowed_format))), 'A role which does not have access to a text format does not appear in the list of roles that have access to that format.');
// Check that the correct text format appears in the list of formats
// available to that role.
- $this->assertTrue(in_array($this->allowed_format->format, array_keys(filter_get_formats_by_role($rid))), t('A text format which a role has access to appears in the list of formats available to that role.'));
- $this->assertFalse(in_array($this->disallowed_format->format, array_keys(filter_get_formats_by_role($rid))), t('A text format which a role does not have access to does not appear in the list of formats available to that role.'));
+ $this->assertTrue(in_array($this->allowed_format->format, array_keys(filter_get_formats_by_role($rid))), 'A text format which a role has access to appears in the list of formats available to that role.');
+ $this->assertFalse(in_array($this->disallowed_format->format, array_keys(filter_get_formats_by_role($rid))), 'A text format which a role does not have access to does not appear in the list of formats available to that role.');
// Check that the fallback format is always allowed.
- $this->assertEqual(filter_get_roles_by_format(filter_format_load(filter_fallback_format())), user_roles(), t('All roles have access to the fallback format.'));
- $this->assertTrue(in_array(filter_fallback_format(), array_keys(filter_get_formats_by_role($rid))), t('The fallback format appears in the list of allowed formats for any role.'));
+ $this->assertEqual(filter_get_roles_by_format(filter_format_load(filter_fallback_format())), user_roles(), 'All roles have access to the fallback format.');
+ $this->assertTrue(in_array(filter_fallback_format(), array_keys(filter_get_formats_by_role($rid))), 'The fallback format appears in the list of allowed formats for any role.');
}
/**
@@ -516,19 +516,19 @@ class FilterFormatAccessTestCase extends DrupalWebTestCase {
$this->clickLink(t('Edit'));
// Verify that body field is read-only and contains replacement value.
- $this->assertFieldByXPath("//textarea[@name='$body_value_key' and @disabled='disabled']", t('This field has been disabled because you do not have sufficient permissions to edit it.'), t('Text format access denied message found.'));
+ $this->assertFieldByXPath("//textarea[@name='$body_value_key' and @disabled='disabled']", t('This field has been disabled because you do not have sufficient permissions to edit it.'), 'Text format access denied message found.');
// Verify that title can be changed, but preview displays original body.
$new_edit = array();
$new_edit['title'] = $this->randomName(8);
$this->drupalPost(NULL, $new_edit, t('Preview'));
- $this->assertText($edit[$body_value_key], t('Old body found in preview.'));
+ $this->assertText($edit[$body_value_key], 'Old body found in preview.');
// Save and verify that only the title was changed.
$this->drupalPost(NULL, $new_edit, t('Save'));
- $this->assertNoText($edit['title'], t('Old title not found.'));
- $this->assertText($new_edit['title'], t('New title found.'));
- $this->assertText($edit[$body_value_key], t('Old body found.'));
+ $this->assertNoText($edit['title'], 'Old title not found.');
+ $this->assertText($new_edit['title'], 'New title found.');
+ $this->assertText($edit[$body_value_key], 'Old body found.');
// Delete the Full HTML text format.
filter_format_delete($this->full_html_format);
@@ -536,8 +536,8 @@ class FilterFormatAccessTestCase extends DrupalWebTestCase {
// Verify that body field can be edited and a new format can be selected.
$this->drupalGet('node/' . $node->nid . '/edit');
- $this->assertNoFieldByXPath("//textarea[@name='$body_value_key' and @disabled='disabled']", NULL, t('Text format access denied message not found.'));
- $this->assertFieldByXPath("//select[@name='$body_format_key']", NULL, t('Text format selector found.'));
+ $this->assertNoFieldByXPath("//textarea[@name='$body_value_key' and @disabled='disabled']", NULL, 'Text format access denied message not found.');
+ $this->assertFieldByXPath("//select[@name='$body_format_key']", NULL, 'Text format selector found.');
}
/**
@@ -598,8 +598,8 @@ class FilterDefaultFormatTestCase extends DrupalWebTestCase {
// Check that each user's default format is the lowest weighted format that
// the user has access to.
- $this->assertEqual(filter_default_format($first_user), $first_format->format, t("The first user's default format is the lowest weighted format that the user has access to."));
- $this->assertEqual(filter_default_format($second_user), $second_format->format, t("The second user's default format is the lowest weighted format that the user has access to, and is different than the first user's."));
+ $this->assertEqual(filter_default_format($first_user), $first_format->format, "The first user's default format is the lowest weighted format that the user has access to.");
+ $this->assertEqual(filter_default_format($second_user), $second_format->format, "The second user's default format is the lowest weighted format that the user has access to, and is different than the first user's.");
// Reorder the two formats, and check that both users now have the same
// default.
@@ -607,7 +607,7 @@ class FilterDefaultFormatTestCase extends DrupalWebTestCase {
$edit['formats[' . $second_format->format . '][weight]'] = $minimum_weight - 3;
$this->drupalPost('admin/config/content/formats', $edit, t('Save changes'));
$this->resetFilterCaches();
- $this->assertEqual(filter_default_format($first_user), filter_default_format($second_user), t('After the formats are reordered, both users have the same default format.'));
+ $this->assertEqual(filter_default_format($first_user), filter_default_format($second_user), 'After the formats are reordered, both users have the same default format.');
}
/**
@@ -635,7 +635,7 @@ class FilterNoFormatTestCase extends DrupalWebTestCase {
// Make sure that when this text is run through check_markup() with no text
// format, it is filtered as though it is in the fallback format.
- $this->assertEqual(check_markup($text), check_markup($text, filter_fallback_format()), t('Text with no format is filtered the same as text in the fallback format.'));
+ $this->assertEqual(check_markup($text), check_markup($text, filter_fallback_format()), 'Text with no format is filtered the same as text in the fallback format.');
}
}
@@ -658,24 +658,24 @@ class FilterUnitTestCase extends DrupalUnitTestCase {
// Single line breaks should be changed to
tags, while paragraphs
// separated with double line breaks should be enclosed with tags.
$f = _filter_autop("aaa\nbbb\n\nccc");
- $this->assertEqual(str_replace("\n", '', $f), "aaa
bbb
ccc
", t('Line breaking basic case.'));
+ $this->assertEqual(str_replace("\n", '', $f), "aaa
bbb
ccc
", 'Line breaking basic case.');
// Text within some contexts should not be processed.
$f = _filter_autop("");
- $this->assertEqual($f, "", t('Line breaking -- do not break scripts.'));
+ $this->assertEqual($f, "", 'Line breaking -- do not break scripts.');
$f = _filter_autop(' ');
- $this->assertEqual(substr_count($f, ''), substr_count($f, '
'), t('Make sure line breaking produces matching paragraph tags.'));
+ $this->assertEqual(substr_count($f, ''), substr_count($f, '
'), 'Make sure line breaking produces matching paragraph tags.');
$f = _filter_autop('
');
- $this->assertEqual(substr_count($f, ''), substr_count($f, '
'), t('Make sure line breaking produces matching paragraph tags.'));
+ $this->assertEqual(substr_count($f, ''), substr_count($f, '
'), 'Make sure line breaking produces matching paragraph tags.');
$f = _filter_autop('aaa
');
- $this->assertEqual(substr_count($f, ''), substr_count($f, '
'), t('Make sure line breaking produces matching paragraph tags.'));
+ $this->assertEqual(substr_count($f, ''), substr_count($f, '
'), 'Make sure line breaking produces matching paragraph tags.');
$limit = max(ini_get('pcre.backtrack_limit'), ini_get('pcre.recursion_limit'));
$f = _filter_autop($this->randomName($limit));
- $this->assertNotEqual($f, '', t('Make sure line breaking can process long strings.'));
+ $this->assertNotEqual($f, '', 'Make sure line breaking can process long strings.');
}
/**
@@ -693,172 +693,172 @@ class FilterUnitTestCase extends DrupalUnitTestCase {
function testHtmlFilter() {
// Tag stripping, different ways to work around removal of HTML tags.
$f = filter_xss('');
- $this->assertNoNormalized($f, 'script', t('HTML tag stripping -- simple script without special characters.'));
+ $this->assertNoNormalized($f, 'script', 'HTML tag stripping -- simple script without special characters.');
$f = filter_xss('');
- $this->assertNoNormalized($f, 'script', t('HTML tag stripping -- empty script with source.'));
+ $this->assertNoNormalized($f, 'script', 'HTML tag stripping -- empty script with source.');
$f = filter_xss('');
- $this->assertNoNormalized($f, 'script', t('HTML tag stripping evasion -- non whitespace character after tag name.'));
+ $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- non whitespace character after tag name.');
$f = filter_xss('');
- $this->assertNoNormalized($f, 'script', t('HTML tag stripping evasion -- no space between tag and attribute.'));
+ $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- no space between tag and attribute.');
// Null between < and tag name works at least with IE6.
$f = filter_xss("<\0scr\0ipt>alert(0)");
- $this->assertNoNormalized($f, 'ipt', t('HTML tag stripping evasion -- breaking HTML with nulls.'));
+ $this->assertNoNormalized($f, 'ipt', 'HTML tag stripping evasion -- breaking HTML with nulls.');
$f = filter_xss("");
- $this->assertNoNormalized($f, 'script', t('HTML tag stripping evasion -- filter just removing "script".'));
+ $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- filter just removing "script".');
$f = filter_xss('<');
- $this->assertNoNormalized($f, 'script', t('HTML tag stripping evasion -- double opening brackets.'));
+ $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- double opening brackets.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'script', t('HTML tag stripping evasion -- a malformed image tag.'));
+ $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- a malformed image tag.');
$f = filter_xss('', array('blockquote'));
- $this->assertNoNormalized($f, 'script', t('HTML tag stripping evasion -- script in a blockqoute.'));
+ $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- script in a blockqoute.');
$f = filter_xss("");
- $this->assertNoNormalized($f, 'script', t('HTML tag stripping evasion -- script within a comment.'));
+ $this->assertNoNormalized($f, 'script', 'HTML tag stripping evasion -- script within a comment.');
// Dangerous attributes removal.
$f = filter_xss('', array('p'));
- $this->assertNoNormalized($f, 'onmouseover', t('HTML filter attributes removal -- events, no evasion.'));
+ $this->assertNoNormalized($f, 'onmouseover', 'HTML filter attributes removal -- events, no evasion.');
$f = filter_xss('
- ', array('li'));
- $this->assertNoNormalized($f, 'style', t('HTML filter attributes removal -- style, no evasion.'));
+ $this->assertNoNormalized($f, 'style', 'HTML filter attributes removal -- style, no evasion.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'onerror', t('HTML filter attributes removal evasion -- spaces before equals sign.'));
+ $this->assertNoNormalized($f, 'onerror', 'HTML filter attributes removal evasion -- spaces before equals sign.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'onabort', t('HTML filter attributes removal evasion -- non alphanumeric characters before equals sign.'));
+ $this->assertNoNormalized($f, 'onabort', 'HTML filter attributes removal evasion -- non alphanumeric characters before equals sign.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'onmediaerror', t('HTML filter attributes removal evasion -- varying case.'));
+ $this->assertNoNormalized($f, 'onmediaerror', 'HTML filter attributes removal evasion -- varying case.');
// Works at least with IE6.
$f = filter_xss("", array('img'));
- $this->assertNoNormalized($f, 'focus', t('HTML filter attributes removal evasion -- breaking with nulls.'));
+ $this->assertNoNormalized($f, 'focus', 'HTML filter attributes removal evasion -- breaking with nulls.');
// Only whitelisted scheme names allowed in attributes.
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing -- no evasion.'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing -- no evasion.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing evasion -- no quotes.'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- no quotes.');
// A bit like CVE-2006-0070.
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing evasion -- no alert ;)'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- no alert ;)');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing evasion -- grave accents.'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- grave accents.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing -- rare attribute.'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing -- rare attribute.');
$f = filter_xss('
', array('table'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing -- another tag.'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing -- another tag.');
$f = filter_xss(' ', array('base'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing -- one more attribute and tag.'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing -- one more attribute and tag.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing evasion -- varying case.'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- varying case.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing evasion -- UTF-8 decimal encoding.'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- UTF-8 decimal encoding.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing evasion -- long UTF-8 encoding.'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- long UTF-8 encoding.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing evasion -- UTF-8 hex encoding.'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- UTF-8 hex encoding.');
$f = filter_xss("", array('img'));
- $this->assertNoNormalized($f, 'script', t('HTML scheme clearing evasion -- an embedded tab.'));
+ $this->assertNoNormalized($f, 'script', 'HTML scheme clearing evasion -- an embedded tab.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'script', t('HTML scheme clearing evasion -- an encoded, embedded tab.'));
+ $this->assertNoNormalized($f, 'script', 'HTML scheme clearing evasion -- an encoded, embedded tab.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'script', t('HTML scheme clearing evasion -- an encoded, embedded newline.'));
+ $this->assertNoNormalized($f, 'script', 'HTML scheme clearing evasion -- an encoded, embedded newline.');
// With
this test would fail, but the entity gets turned into
// 
, so it's OK.
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'script', t('HTML scheme clearing evasion -- an encoded, embedded carriage return.'));
+ $this->assertNoNormalized($f, 'script', 'HTML scheme clearing evasion -- an encoded, embedded carriage return.');
$f = filter_xss("", array('img'));
- $this->assertNoNormalized($f, 'cript', t('HTML scheme clearing evasion -- broken into many lines.'));
+ $this->assertNoNormalized($f, 'cript', 'HTML scheme clearing evasion -- broken into many lines.');
$f = filter_xss("", array('img'));
- $this->assertNoNormalized($f, 'cript', t('HTML scheme clearing evasion -- embedded nulls.'));
+ $this->assertNoNormalized($f, 'cript', 'HTML scheme clearing evasion -- embedded nulls.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'javascript', t('HTML scheme clearing evasion -- spaces and metacharacters before scheme.'));
+ $this->assertNoNormalized($f, 'javascript', 'HTML scheme clearing evasion -- spaces and metacharacters before scheme.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'vbscript', t('HTML scheme clearing evasion -- another scheme.'));
+ $this->assertNoNormalized($f, 'vbscript', 'HTML scheme clearing evasion -- another scheme.');
$f = filter_xss('', array('img'));
- $this->assertNoNormalized($f, 'nosuchscheme', t('HTML scheme clearing evasion -- unknown scheme.'));
+ $this->assertNoNormalized($f, 'nosuchscheme', 'HTML scheme clearing evasion -- unknown scheme.');
// Netscape 4.x javascript entities.
$f = filter_xss('
', array('br'));
- $this->assertNoNormalized($f, 'alert', t('Netscape 4.x javascript entities.'));
+ $this->assertNoNormalized($f, 'alert', 'Netscape 4.x javascript entities.');
// DRUPAL-SA-2008-006: Invalid UTF-8, these only work as reflected XSS with
// Internet Explorer 6.
$f = filter_xss("\" style=\"background-image: url(javascript:alert(0));\"\xe0
", array('p'));
- $this->assertNoNormalized($f, 'style', t('HTML filter -- invalid UTF-8.'));
+ $this->assertNoNormalized($f, 'style', 'HTML filter -- invalid UTF-8.');
$f = filter_xss("\xc0aaa");
- $this->assertEqual($f, '', t('HTML filter -- overlong UTF-8 sequences.'));
+ $this->assertEqual($f, '', 'HTML filter -- overlong UTF-8 sequences.');
$f = filter_xss("Who's Online");
- $this->assertNormalized($f, "who's online", t('HTML filter -- html entity number'));
+ $this->assertNormalized($f, "who's online", 'HTML filter -- html entity number');
$f = filter_xss("Who's Online");
- $this->assertNormalized($f, "who's online", t('HTML filter -- encoded html entity number'));
+ $this->assertNormalized($f, "who's online", 'HTML filter -- encoded html entity number');
$f = filter_xss("Who&#039; Online");
- $this->assertNormalized($f, "who' online", t('HTML filter -- double encoded html entity number'));
+ $this->assertNormalized($f, "who' online", 'HTML filter -- double encoded html entity number');
}
/**
@@ -887,34 +887,34 @@ class FilterUnitTestCase extends DrupalUnitTestCase {
// HTML filter is not able to secure some tags, these should never be
// allowed.
$f = _filter_html('', $filter);
- $this->assertNoNormalized($f, 'script', t('HTML filter should always remove script tags.'));
+ $this->assertNoNormalized($f, 'script', 'HTML filter should always remove script tags.');
$f = _filter_html('', $filter);
- $this->assertNoNormalized($f, 'iframe', t('HTML filter should always remove iframe tags.'));
+ $this->assertNoNormalized($f, 'iframe', 'HTML filter should always remove iframe tags.');
$f = _filter_html('', $filter);
- $this->assertNoNormalized($f, 'object', t('HTML filter should always remove object tags.'));
+ $this->assertNoNormalized($f, 'object', 'HTML filter should always remove object tags.');
$f = _filter_html('', $filter);
- $this->assertNoNormalized($f, 'style', t('HTML filter should always remove style tags.'));
+ $this->assertNoNormalized($f, 'style', 'HTML filter should always remove style tags.');
// Some tags make CSRF attacks easier, let the user take the risk herself.
$f = _filter_html('', $filter);
- $this->assertNoNormalized($f, 'img', t('HTML filter should remove img tags on default.'));
+ $this->assertNoNormalized($f, 'img', 'HTML filter should remove img tags on default.');
$f = _filter_html('', $filter);
- $this->assertNoNormalized($f, 'img', t('HTML filter should remove input tags on default.'));
+ $this->assertNoNormalized($f, 'img', 'HTML filter should remove input tags on default.');
// Filtering content of some attributes is infeasible, these shouldn't be
// allowed too.
$f = _filter_html('
', $filter);
- $this->assertNoNormalized($f, 'style', t('HTML filter should remove style attribute on default.'));
+ $this->assertNoNormalized($f, 'style', 'HTML filter should remove style attribute on default.');
$f = _filter_html('', $filter);
- $this->assertNoNormalized($f, 'onerror', t('HTML filter should remove on* attributes on default.'));
+ $this->assertNoNormalized($f, 'onerror', 'HTML filter should remove on* attributes on default.');
- $f = _filter_html('
', $filter);
- $this->assertNoNormalized($f, 'onerror', t('HTML filter should remove empty on* attributes on default.'));
+ $f = _filter_html('
', $filter);
+ $this->assertNoNormalized($f, 'onerror', 'HTML filter should remove empty on* attributes on default.');
}
/**
@@ -932,23 +932,23 @@ class FilterUnitTestCase extends DrupalUnitTestCase {
// Test if the rel="nofollow" attribute is added, even if we try to prevent
// it.
$f = _filter_html('text', $filter);
- $this->assertNormalized($f, 'rel="nofollow"', t('Spam deterrent -- no evasion.'));
+ $this->assertNormalized($f, 'rel="nofollow"', 'Spam deterrent -- no evasion.');
$f = _filter_html('text', $filter);
- $this->assertNormalized($f, 'rel="nofollow"', t('Spam deterrent evasion -- capital A.'));
+ $this->assertNormalized($f, 'rel="nofollow"', 'Spam deterrent evasion -- capital A.');
$f = _filter_html("text", $filter);
- $this->assertNormalized($f, 'rel="nofollow"', t('Spam deterrent evasion -- non whitespace character after tag name.'));
+ $this->assertNormalized($f, 'rel="nofollow"', 'Spam deterrent evasion -- non whitespace character after tag name.');
$f = _filter_html("<\0a\0 href=\"http://www.example.com/\">text", $filter);
- $this->assertNormalized($f, 'rel="nofollow"', t('Spam deterrent evasion -- some nulls.'));
+ $this->assertNormalized($f, 'rel="nofollow"', 'Spam deterrent evasion -- some nulls.');
$f = _filter_html('', $filter);
- $this->assertNormalized($f, 'rel="nofollow"', t('Spam deterrent evasion -- link within a comment.'));
+ $this->assertNormalized($f, 'rel="nofollow"', 'Spam deterrent evasion -- link within a comment.');
$f = _filter_html('text', $filter);
- $this->assertNoNormalized($f, 'rel="follow"', t('Spam deterrent evasion -- with rel set - rel="follow" removed.'));
- $this->assertNormalized($f, 'rel="nofollow"', t('Spam deterrent evasion -- with rel set - rel="nofollow" added.'));
+ $this->assertNoNormalized($f, 'rel="follow"', 'Spam deterrent evasion -- with rel set - rel="follow" removed.');
+ $this->assertNormalized($f, 'rel="nofollow"', 'Spam deterrent evasion -- with rel set - rel="nofollow" added.');
}
/**
@@ -957,13 +957,13 @@ class FilterUnitTestCase extends DrupalUnitTestCase {
function testAdminHtmlFilter() {
// DRUPAL-SA-2008-044
$f = filter_xss_admin('');
- $this->assertNoNormalized($f, 'object', t('Admin HTML filter -- should not allow object tag.'));
+ $this->assertNoNormalized($f, 'object', 'Admin HTML filter -- should not allow object tag.');
$f = filter_xss_admin('');
- $this->assertNoNormalized($f, 'script', t('Admin HTML filter -- should not allow script tag.'));
+ $this->assertNoNormalized($f, 'script', 'Admin HTML filter -- should not allow script tag.');
$f = filter_xss_admin(' ');
- $this->assertEqual($f, '', t('Admin HTML filter -- should never allow some tags.'));
+ $this->assertEqual($f, '', 'Admin HTML filter -- should never allow some tags.');
}
/**
@@ -992,73 +992,73 @@ class FilterUnitTestCase extends DrupalUnitTestCase {
// Converting URLs.
$f = _filter_url('http://www.example.com/', $filter);
- $this->assertEqual($f, 'http://www.example.com/', t('Converting URLs.'));
+ $this->assertEqual($f, 'http://www.example.com/', 'Converting URLs.');
$f = _filter_url('http://www.example.com/?a=1&b=2', $filter);
- $this->assertEqual($f, 'http://www.example.com/?a=1&b=2', t('Converting URLs -- ampersands.'));
+ $this->assertEqual($f, 'http://www.example.com/?a=1&b=2', 'Converting URLs -- ampersands.');
$f = _filter_url('ftp://user:pass@ftp.example.com/dir1/dir2', $filter);
- $this->assertEqual($f, 'ftp://user:pass@ftp.example.com/dir1/dir2', t('Converting URLs -- FTP scheme.'));
+ $this->assertEqual($f, 'ftp://user:pass@ftp.example.com/dir1/dir2', 'Converting URLs -- FTP scheme.');
// Converting domain names.
$f = _filter_url('www.example.com', $filter);
- $this->assertEqual($f, 'www.example.com', t('Converting domain names.'));
+ $this->assertEqual($f, 'www.example.com', 'Converting domain names.');
$f = _filter_url('- www.example.com
', $filter);
- $this->assertEqual($f, '- www.example.com
', t('Converting domain names -- domain in a list.'));
+ $this->assertEqual($f, '- www.example.com
', 'Converting domain names -- domain in a list.');
$f = _filter_url('(www.example.com/dir?a=1&b=2#a)', $filter);
- $this->assertEqual($f, '(www.example.com/dir?a=1&b=2#a)', t('Converting domain names -- domain in parentheses.'));
+ $this->assertEqual($f, '(www.example.com/dir?a=1&b=2#a)', 'Converting domain names -- domain in parentheses.');
// Converting e-mail addresses.
$f = _filter_url('johndoe@example.com', $filter);
- $this->assertEqual($f, 'johndoe@example.com', t('Converting e-mail addresses.'));
+ $this->assertEqual($f, 'johndoe@example.com', 'Converting e-mail addresses.');
$f = _filter_url('aaa@sub.tv', $filter);
- $this->assertEqual($f, 'aaa@sub.tv', t('Converting e-mail addresses -- a short e-mail from Tuvalu.'));
+ $this->assertEqual($f, 'aaa@sub.tv', 'Converting e-mail addresses -- a short e-mail from Tuvalu.');
// URL trimming.
$filter->settings['filter_url_length'] = 28;
$f = _filter_url('http://www.example.com/d/ff.ext?a=1&b=2#a1', $filter);
- $this->assertNormalized($f, 'http://www.example.com/d/ff....', t('URL trimming.'));
+ $this->assertNormalized($f, 'http://www.example.com/d/ff....', 'URL trimming.');
// Not breaking existing links.
$f = _filter_url('www.example.com', $filter);
- $this->assertEqual($f, 'www.example.com', t('Converting URLs -- do not break existing links.'));
+ $this->assertEqual($f, 'www.example.com', 'Converting URLs -- do not break existing links.');
$f = _filter_url('http://www.example.com', $filter);
- $this->assertEqual($f, 'http://www.example.com', t('Converting URLs -- do not break existing, relative links.'));
+ $this->assertEqual($f, 'http://www.example.com', 'Converting URLs -- do not break existing, relative links.');
// Addresses within some tags such as code or script should not be converted.
$f = _filter_url('http://www.example.com
', $filter);
- $this->assertEqual($f, 'http://www.example.com
', t('Converting URLs -- skip code contents.'));
+ $this->assertEqual($f, 'http://www.example.com
', 'Converting URLs -- skip code contents.');
$f = _filter_url('http://www.example.com
', $filter);
- $this->assertEqual($f, 'http://www.example.com
', t('Converting URLs -- really skip code contents.'));
+ $this->assertEqual($f, 'http://www.example.com
', 'Converting URLs -- really skip code contents.');
$f = _filter_url('', $filter);
- $this->assertEqual($f, '', t('Converting URLs -- do not process scripts.'));
+ $this->assertEqual($f, '', 'Converting URLs -- do not process scripts.');
// Addresses in attributes should not be converted.
$f = _filter_url('', $filter);
- $this->assertEqual($f, '', t('Converting URLs -- do not convert addresses in attributes.'));
+ $this->assertEqual($f, '', 'Converting URLs -- do not convert addresses in attributes.');
$f = _filter_url('text', $filter);
- $this->assertEqual($f, 'text', t('Converting URLs -- do not break existing links with custom title attribute.'));
+ $this->assertEqual($f, 'text', 'Converting URLs -- do not break existing links with custom title attribute.');
// Even though a dot at the end of a URL can indicate a fully qualified
// domain name, such usage is rare compared to using a link at the end
// of a sentence, so remove the dot from the link.
// @todo It can also be used at the end of a filename or a query string.
$f = _filter_url('www.example.com.', $filter);
- $this->assertEqual($f, 'www.example.com.', t('Converting URLs -- do not recognize a dot at the end of a domain name (FQDNs).'));
+ $this->assertEqual($f, 'www.example.com.', 'Converting URLs -- do not recognize a dot at the end of a domain name (FQDNs).');
$f = _filter_url('http://www.example.com.', $filter);
- $this->assertEqual($f, 'http://www.example.com.', t('Converting URLs -- do not recognize a dot at the end of an URL (FQDNs).'));
+ $this->assertEqual($f, 'http://www.example.com.', 'Converting URLs -- do not recognize a dot at the end of an URL (FQDNs).');
$f = _filter_url('www.example.com/index.php?a=.', $filter);
- $this->assertEqual($f, 'www.example.com/index.php?a=.', t('Converting URLs -- do forget about a dot at the end of a query string.'));
+ $this->assertEqual($f, 'www.example.com/index.php?a=.', 'Converting URLs -- do forget about a dot at the end of a query string.');
}
/**
@@ -1069,114 +1069,114 @@ class FilterUnitTestCase extends DrupalUnitTestCase {
function testHtmlCorrectorFilter() {
// Tag closing.
$f = _filter_htmlcorrector('text');
- $this->assertEqual($f, '
text
', t('HTML corrector -- tag closing at the end of input.'));
+ $this->assertEqual($f, 'text
', 'HTML corrector -- tag closing at the end of input.');
$f = _filter_htmlcorrector('text
text');
- $this->assertEqual($f, '
text
text
', t('HTML corrector -- tag closing.'));
+ $this->assertEqual($f, 'text
text
', 'HTML corrector -- tag closing.');
$f = _filter_htmlcorrector("- e1
- e2");
- $this->assertEqual($f, "
- e1
- e2
", t('HTML corrector -- unclosed list tags.'));
+ $this->assertEqual($f, "- e1
- e2
", 'HTML corrector -- unclosed list tags.');
$f = _filter_htmlcorrector('content');
- $this->assertEqual($f, 'content', t('HTML corrector -- unclosed tag with attribute.'));
+ $this->assertEqual($f, 'content', 'HTML corrector -- unclosed tag with attribute.');
// XHTML slash for empty elements.
$f = _filter_htmlcorrector('
');
- $this->assertEqual($f, '
', t('HTML corrector -- XHTML closing slash.'));
+ $this->assertEqual($f, '
', 'HTML corrector -- XHTML closing slash.');
$f = _filter_htmlcorrector('test
');
- $this->assertEqual($f, 'test
', t('HTML corrector -- Convert uppercased tags to proper lowercased ones.'));
+ $this->assertEqual($f, 'test
', 'HTML corrector -- Convert uppercased tags to proper lowercased ones.');
$f = _filter_htmlcorrector('test
');
- $this->assertEqual($f, 'test
', t('HTML corrector -- Convert uppercased tags to proper lowercased ones.'));
+ $this->assertEqual($f, 'test
', 'HTML corrector -- Convert uppercased tags to proper lowercased ones.');
$f = _filter_htmlcorrector('test
');
- $this->assertEqual($f, 'test
', t('HTML corrector -- Let proper XHTML pass through.'));
+ $this->assertEqual($f, 'test
', 'HTML corrector -- Let proper XHTML pass through.');
$f = _filter_htmlcorrector('test
');
- $this->assertEqual($f, 'test
', t('HTML corrector -- Let proper XHTML pass through, but ensure there is a single space before the closing slash.'));
+ $this->assertEqual($f, 'test
', 'HTML corrector -- Let proper XHTML pass through, but ensure there is a single space before the closing slash.');
$f = _filter_htmlcorrector('test
');
- $this->assertEqual($f, 'test
', t('HTML corrector -- Let proper XHTML pass through, but ensure there are not too many spaces before the closing slash.'));
+ $this->assertEqual($f, 'test
', 'HTML corrector -- Let proper XHTML pass through, but ensure there are not too many spaces before the closing slash.');
$f = _filter_htmlcorrector('');
- $this->assertEqual($f, '', t('HTML corrector -- Convert XHTML that is properly formed but that would not be compatible with typical HTML user agents.'));
+ $this->assertEqual($f, '', 'HTML corrector -- Convert XHTML that is properly formed but that would not be compatible with typical HTML user agents.');
$f = _filter_htmlcorrector('test1
test2');
- $this->assertEqual($f, 'test1
test2', t('HTML corrector -- Automatically close single tags.'));
+ $this->assertEqual($f, 'test1
test2', 'HTML corrector -- Automatically close single tags.');
$f = _filter_htmlcorrector('line1
line2');
- $this->assertEqual($f, 'line1
line2', t('HTML corrector -- Automatically close single tags.'));
+ $this->assertEqual($f, 'line1
line2', 'HTML corrector -- Automatically close single tags.');
$f = _filter_htmlcorrector('line1
line2');
- $this->assertEqual($f, 'line1
line2', t('HTML corrector -- Automatically close single tags.'));
+ $this->assertEqual($f, 'line1
line2', 'HTML corrector -- Automatically close single tags.');
$f = _filter_htmlcorrector('test');
- $this->assertEqual($f, 'test', t('HTML corrector -- Automatically close single tags.'));
+ $this->assertEqual($f, 'test', 'HTML corrector -- Automatically close single tags.');
$f = _filter_htmlcorrector('
');
- $this->assertEqual($f, '
', t("HTML corrector -- Transform empty tags to a single closed tag if the tag's content model is EMPTY."));
+ $this->assertEqual($f, '
', "HTML corrector -- Transform empty tags to a single closed tag if the tag's content model is EMPTY.");
$f = _filter_htmlcorrector('');
- $this->assertEqual($f, '', t("HTML corrector -- Do not transform empty tags to a single closed tag if the tag's content model is not EMPTY."));
+ $this->assertEqual($f, '', "HTML corrector -- Do not transform empty tags to a single closed tag if the tag's content model is not EMPTY.");
$f = _filter_htmlcorrector('line1
line2');
- $this->assertEqual($f, 'line1
line2', t('HTML corrector -- Move non-inline elements outside of inline containers.'));
+ $this->assertEqual($f, 'line1
line2', 'HTML corrector -- Move non-inline elements outside of inline containers.');
$f = _filter_htmlcorrector('line1
line2');
- $this->assertEqual($f, 'line1
line2', t('HTML corrector -- Move non-inline elements outside of inline containers.'));
+ $this->assertEqual($f, 'line1
line2', 'HTML corrector -- Move non-inline elements outside of inline containers.');
$f = _filter_htmlcorrector('test
test
\n');
- $this->assertEqual($f, 'test
test
\n', t('HTML corrector -- Auto-close improperly nested tags.'));
+ $this->assertEqual($f, 'test
test
\n', 'HTML corrector -- Auto-close improperly nested tags.');
$f = _filter_htmlcorrector('Line1
bold stuff');
- $this->assertEqual($f, 'Line1
bold stuff
', t('HTML corrector -- Properly close unclosed tags, and remove useless closing tags.'));
+ $this->assertEqual($f, 'Line1
bold stuff
', 'HTML corrector -- Properly close unclosed tags, and remove useless closing tags.');
$f = _filter_htmlcorrector('test ');
- $this->assertEqual($f, 'test ', t('HTML corrector -- Do not touch HTML comments.'));
+ $this->assertEqual($f, 'test ', 'HTML corrector -- Do not touch HTML comments.');
$f = _filter_htmlcorrector('test ');
- $this->assertEqual($f, 'test ', t('HTML corrector -- Do not touch HTML comments.'));
+ $this->assertEqual($f, 'test ', 'HTML corrector -- Do not touch HTML comments.');
$f = _filter_htmlcorrector('test ');
$this->assertEqual($f, 'test ', t('HTML corrector -- Do not touch HTML comments.'));
+ comment
-->', 'HTML corrector -- Do not touch HTML comments.');
$f = _filter_htmlcorrector('test ');
- $this->assertEqual($f, 'test ', t('HTML corrector -- Do not touch HTML comments.'));
+ $this->assertEqual($f, 'test ', 'HTML corrector -- Do not touch HTML comments.');
$f = _filter_htmlcorrector('test ');
- $this->assertEqual($f, 'test ', t('HTML corrector -- Do not touch HTML comments.'));
+ $this->assertEqual($f, 'test ', 'HTML corrector -- Do not touch HTML comments.');
$f = _filter_htmlcorrector('test\n
\n');
- $this->assertEqual($f, 'test\n
\n', t('HTML corrector -- New-lines are accepted and kept as-is.'));
+ $this->assertEqual($f, 'test\n
\n', 'HTML corrector -- New-lines are accepted and kept as-is.');
$f = _filter_htmlcorrector('دروبال');
- $this->assertEqual($f, '
دروبال
', t('HTML corrector -- Encoding is correctly kept.'));
+ $this->assertEqual($f, 'دروبال
', 'HTML corrector -- Encoding is correctly kept.');
$f = _filter_htmlcorrector('');
$this->assertEqual($f, '', t('HTML corrector -- CDATA added to script element'));
+', 'HTML corrector -- CDATA added to script element');
$f = _filter_htmlcorrector('');
$this->assertEqual($f, '', t('HTML corrector -- CDATA added to a nested script element'));
+', 'HTML corrector -- CDATA added to a nested script element');
$f = _filter_htmlcorrector('');
$this->assertEqual($f, '', t('HTML corrector -- CDATA added to a style element.'));
+', 'HTML corrector -- CDATA added to a style element.');
}
/**
@@ -1240,16 +1240,16 @@ alert("test")
// Test that characters that have special meaning in XML are changed into
// entities.
$f = $function('<>&"');
- $this->assertEqual($f, '<>&"', t('The @function() function correctly filters basic HTML entities.', $replacements));
+ $this->assertEqual($f, '<>&"', 'The ' . $replacements['@function'] . '() function correctly filters basic HTML entities.');
// A single quote can also be used for evil things in some contexts.
$f = $function('\'');
- $this->assertEqual($f, ''', t('The @function() function correctly filters single quotes.', $replacements));
+ $this->assertEqual($f, ''', 'The ' . $replacements['@function'] . '() function correctly filters single quotes.');
// Test that the filter is not fooled by different evasion techniques.
// Ignore PHP 5.3+ invalid multibyte sequence warning.
$f = @$function("\xc2\"");
- $this->assertEqual($f, '', t('The @function() function correctly filters invalid UTF-8.', $replacements));
+ $this->assertEqual($f, '', 'The ' . $replacements['@function'] . '() function correctly filters invalid UTF-8.');
}
}
@@ -1281,8 +1281,8 @@ class FilterHooksTestCase extends DrupalWebTestCase {
$edit['name'] = $name;
$edit['roles[1]'] = 1;
$this->drupalPost('admin/config/content/formats/add', $edit, t('Save configuration'));
- $this->assertRaw(t('Added text format %format.', array('%format' => $name)), t('New format created.'));
- $this->assertText('hook_filter_format_insert invoked.', t('hook_filter_format_insert was invoked.'));
+ $this->assertRaw(t('Added text format %format.', array('%format' => $name)), 'New format created.');
+ $this->assertText('hook_filter_format_insert invoked.', 'hook_filter_format_insert was invoked.');
$format_id = db_query("SELECT format FROM {filter_format} WHERE name = :name", array(':name' => $name))->fetchField();
@@ -1290,8 +1290,8 @@ class FilterHooksTestCase extends DrupalWebTestCase {
$edit = array();
$edit['roles[2]'] = 1;
$this->drupalPost('admin/config/content/formats/' . $format_id, $edit, t('Save configuration'));
- $this->assertRaw(t('The text format %format has been updated.', array('%format' => $name)), t('Format successfully updated.'));
- $this->assertText('hook_filter_format_update invoked.', t('hook_filter_format_update() was invoked.'));
+ $this->assertRaw(t('The text format %format has been updated.', array('%format' => $name)), 'Format successfully updated.');
+ $this->assertText('hook_filter_format_update invoked.', 'hook_filter_format_update() was invoked.');
// Add a new custom block.
$custom_block = array();
@@ -1301,16 +1301,16 @@ class FilterHooksTestCase extends DrupalWebTestCase {
// Use the format created.
$custom_block['body[format]'] = $format_id;
$this->drupalPost('admin/structure/block/add', $custom_block, t('Save block'));
- $this->assertText(t('The block has been created.'), t('New block successfully created.'));
+ $this->assertText(t('The block has been created.'), 'New block successfully created.');
// Verify the new block is in the database.
$bid = db_query("SELECT bid FROM {block_custom} WHERE info = :info", array(':info' => $custom_block['info']))->fetchField();
- $this->assertNotNull($bid, t('New block found in database'));
+ $this->assertNotNull($bid, 'New block found in database');
// Delete the text format.
$this->drupalPost('admin/config/content/formats/' . $format_id . '/delete', array(), t('Delete'));
- $this->assertRaw(t('Deleted text format %format.', array('%format' => $name)), t('Format successfully deleted.'));
- $this->assertText('hook_filter_format_delete invoked.', t('hook_filter_format_delete() was invoked.'));
+ $this->assertRaw(t('Deleted text format %format.', array('%format' => $name)), 'Format successfully deleted.');
+ $this->assertText('hook_filter_format_delete invoked.', 'hook_filter_format_delete() was invoked.');
// Verify that the deleted format was replaced with the fallback format.
$current_format = db_select('block_custom', 'b')
@@ -1318,7 +1318,7 @@ class FilterHooksTestCase extends DrupalWebTestCase {
->condition('bid', $bid)
->execute()
->fetchField();
- $this->assertEqual($current_format, filter_fallback_format(), t('Deleted text format replaced with the fallback format.'));
+ $this->assertEqual($current_format, filter_fallback_format(), 'Deleted text format replaced with the fallback format.');
}
}
diff --git a/modules/forum/forum.test b/modules/forum/forum.test
index a7b9a081000a687a12b972dbf21d628fd514bcc1..f114c43730a8962ed0faa223083957324d3df9b8 100644
--- a/modules/forum/forum.test
+++ b/modules/forum/forum.test
@@ -102,16 +102,16 @@ class ForumTestCase extends DrupalWebTestCase {
// Must remove forum topics to test creating orphan topics.
$vid = variable_get('forum_nav_vocabulary');
$tree = taxonomy_get_tree($vid);
- foreach($tree as $term) {
+ foreach ($tree as $term) {
taxonomy_term_delete($term->tid);
}
// Create an orphan forum item.
$this->drupalLogin($this->admin_user);
- $this->drupalPost('node/add/forum', array('title' => $this->randomName(10), 'body[' . LANGUAGE_NONE .'][0][value]' => $this->randomName(120)), t('Save'));
+ $this->drupalPost('node/add/forum', array('title' => $this->randomName(10), 'body[' . LANGUAGE_NONE . '][0][value]' => $this->randomName(120)), t('Save'));
$nid_count = db_query('SELECT COUNT(nid) FROM {node}')->fetchField();
- $this->assertEqual(0, $nid_count, t('A forum node was not created when missing a forum vocabulary.'));
+ $this->assertEqual(0, $nid_count, 'A forum node was not created when missing a forum vocabulary.');
// Reset the defaults for future tests.
module_enable(array('forum'));
@@ -131,14 +131,14 @@ class ForumTestCase extends DrupalWebTestCase {
$edit['forum_active[region]'] = 'sidebar_second';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertResponse(200);
- $this->assertText(t('The block settings have been updated.'), t('Active forum topics forum block was enabled'));
+ $this->assertText(t('The block settings have been updated.'), 'Active forum topics forum block was enabled');
// Enable the new forum block.
$edit = array();
$edit['forum_new[region]'] = 'sidebar_second';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertResponse(200);
- $this->assertText(t('The block settings have been updated.'), t('[New forum topics] Forum block was enabled'));
+ $this->assertText(t('The block settings have been updated.'), '[New forum topics] Forum block was enabled');
// Retrieve forum menu id.
$mlid = db_query_range("SELECT mlid FROM {menu_links} WHERE link_path = 'forum' AND menu_name = 'navigation' AND module = 'system' ORDER BY mlid ASC", 0, 1)->fetchField();
@@ -156,13 +156,13 @@ class ForumTestCase extends DrupalWebTestCase {
// Verify "edit container" link exists and functions correctly.
$this->drupalGet('admin/structure/forum');
$this->clickLink('edit container');
- $this->assertRaw('Edit container', t('Followed the link to edit the container'));
+ $this->assertRaw('Edit container', 'Followed the link to edit the container');
// Create forum inside the forum container.
$this->forum = $this->createForum('forum', $this->container['tid']);
// Verify the "edit forum" link exists and functions correctly.
$this->drupalGet('admin/structure/forum');
$this->clickLink('edit forum');
- $this->assertRaw('Edit forum', t('Followed the link to edit the forum'));
+ $this->assertRaw('Edit forum', 'Followed the link to edit the forum');
// Navigate back to forum structure page.
$this->drupalGet('admin/structure/forum');
// Create second forum in container.
@@ -197,15 +197,15 @@ class ForumTestCase extends DrupalWebTestCase {
// Edit the vocabulary.
$this->drupalPost('admin/structure/taxonomy/' . $original_settings->machine_name . '/edit', $edit, t('Save'));
$this->assertResponse(200);
- $this->assertRaw(t('Updated vocabulary %name.', array('%name' => $title)), t('Vocabulary was edited'));
+ $this->assertRaw(t('Updated vocabulary %name.', array('%name' => $title)), 'Vocabulary was edited');
// Grab the newly edited vocabulary.
entity_get_controller('taxonomy_vocabulary')->resetCache();
$current_settings = taxonomy_vocabulary_load($vid);
// Make sure we actually edited the vocabulary properly.
- $this->assertEqual($current_settings->name, $title, t('The name was updated'));
- $this->assertEqual($current_settings->description, $description, t('The description was updated'));
+ $this->assertEqual($current_settings->name, $title, 'The name was updated');
+ $this->assertEqual($current_settings->description, $description, 'The description was updated');
// Restore the original vocabulary.
taxonomy_vocabulary_save($original_settings);
@@ -241,7 +241,7 @@ class ForumTestCase extends DrupalWebTestCase {
$this->drupalPost('admin/structure/forum/add/' . $type, $edit, t('Save'));
$this->assertResponse(200);
$type = ($type == 'container') ? 'forum container' : 'forum';
- $this->assertRaw(t('Created new @type %term.', array('%term' => $name, '@type' => t($type))), t(ucfirst($type) . ' was created'));
+ $this->assertRaw(t('Created new @type %term.', array('%term' => $name, '@type' => t($type))), ucfirst($type) . ' was created');
// Verify forum.
$term = db_query("SELECT * FROM {taxonomy_term_data} t WHERE t.vid = :vid AND t.name = :name AND t.description = :desc", array(':vid' => variable_get('forum_nav_vocabulary', ''), ':name' => $name, ':desc' => $description))->fetchAssoc();
@@ -318,24 +318,24 @@ class ForumTestCase extends DrupalWebTestCase {
$type = t('Forum topic');
if ($container) {
- $this->assertNoRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), t('Forum topic was not created'));
- $this->assertRaw(t('The item %title is a forum container, not a forum.', array('%title' => $forum['name'])), t('Error message was shown'));
+ $this->assertNoRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), 'Forum topic was not created');
+ $this->assertRaw(t('The item %title is a forum container, not a forum.', array('%title' => $forum['name'])), 'Error message was shown');
return;
}
else {
- $this->assertRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), t('Forum topic was created'));
- $this->assertNoRaw(t('The item %title is a forum container, not a forum.', array('%title' => $forum['name'])), t('No error message was shown'));
+ $this->assertRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), 'Forum topic was created');
+ $this->assertNoRaw(t('The item %title is a forum container, not a forum.', array('%title' => $forum['name'])), 'No error message was shown');
}
// Retrieve node object, ensure that the topic was created and in the proper forum.
$node = $this->drupalGetNodeByTitle($title);
- $this->assertTrue($node != NULL, t('Node @title was loaded', array('@title' => $title)));
+ $this->assertTrue($node != NULL, 'Node ' . $title . ' was loaded');
$this->assertEqual($node->taxonomy_forums[LANGUAGE_NONE][0]['tid'], $tid, 'Saved forum topic was in the expected forum');
// View forum topic.
$this->drupalGet('node/' . $node->nid);
- $this->assertRaw($title, t('Subject was found'));
- $this->assertRaw($body, t('Body was found'));
+ $this->assertRaw($title, 'Subject was found');
+ $this->assertRaw($body, 'Body was found');
return $node;
}
@@ -359,14 +359,14 @@ class ForumTestCase extends DrupalWebTestCase {
$this->drupalGet('admin/help/forum');
$this->assertResponse($response2);
if ($response2 == 200) {
- $this->assertTitle(t('Forum | Drupal'), t('Forum help title was displayed'));
- $this->assertText(t('Forum'), t('Forum help node was displayed'));
+ $this->assertTitle(t('Forum | Drupal'), 'Forum help title was displayed');
+ $this->assertText(t('Forum'), 'Forum help node was displayed');
}
// Verify the forum blocks were displayed.
$this->drupalGet('');
$this->assertResponse(200);
- $this->assertText(t('New forum topics'), t('[New forum topics] Forum block was displayed'));
+ $this->assertText(t('New forum topics'), '[New forum topics] Forum block was displayed');
// View forum container page.
$this->verifyForumView($this->container);
@@ -378,20 +378,20 @@ class ForumTestCase extends DrupalWebTestCase {
// View forum node.
$this->drupalGet('node/' . $node->nid);
$this->assertResponse(200);
- $this->assertTitle($node->title . ' | Drupal', t('Forum node was displayed'));
+ $this->assertTitle($node->title . ' | Drupal', 'Forum node was displayed');
$breadcrumb = array(
l(t('Home'), NULL),
l(t('Forums'), 'forum'),
l($this->container['name'], 'forum/' . $this->container['tid']),
l($this->forum['name'], 'forum/' . $this->forum['tid']),
);
- $this->assertRaw(theme('breadcrumb', array('breadcrumb' => $breadcrumb)), t('Breadcrumbs were displayed'));
+ $this->assertRaw(theme('breadcrumb', array('breadcrumb' => $breadcrumb)), 'Breadcrumbs were displayed');
// View forum edit node.
$this->drupalGet('node/' . $node->nid . '/edit');
$this->assertResponse($response);
if ($response == 200) {
- $this->assertTitle('Edit Forum topic ' . $node->title . ' | Drupal', t('Forum edit node was displayed'));
+ $this->assertTitle('Edit Forum topic ' . $node->title . ' | Drupal', 'Forum edit node was displayed');
}
if ($response == 200) {
@@ -404,7 +404,7 @@ class ForumTestCase extends DrupalWebTestCase {
$edit["taxonomy_forums[$langcode]"] = $this->root_forum['tid'];
$edit['shadow'] = TRUE;
$this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
- $this->assertRaw(t('Forum topic %title has been updated.', array('%title' => $edit["title"])), t('Forum node was edited'));
+ $this->assertRaw(t('Forum topic %title has been updated.', array('%title' => $edit["title"])), 'Forum node was edited');
// Verify topic was moved to a different forum.
$forum_tid = db_query("SELECT tid FROM {forum} WHERE nid = :nid AND vid = :vid", array(
@@ -416,7 +416,7 @@ class ForumTestCase extends DrupalWebTestCase {
// Delete forum node.
$this->drupalPost('node/' . $node->nid . '/delete', array(), t('Delete'));
$this->assertResponse($response);
- $this->assertRaw(t('Forum topic %title has been deleted.', array('%title' => $edit['title'])), t('Forum node was deleted'));
+ $this->assertRaw(t('Forum topic %title has been deleted.', array('%title' => $edit['title'])), 'Forum node was deleted');
}
}
@@ -430,7 +430,7 @@ class ForumTestCase extends DrupalWebTestCase {
// View forum page.
$this->drupalGet('forum/' . $forum['tid']);
$this->assertResponse(200);
- $this->assertTitle($forum['name'] . ' | Drupal', t('Forum name was displayed'));
+ $this->assertTitle($forum['name'] . ' | Drupal', 'Forum name was displayed');
$breadcrumb = array(
l(t('Home'), NULL),
@@ -440,7 +440,7 @@ class ForumTestCase extends DrupalWebTestCase {
$breadcrumb[] = l($parent['name'], 'forum/' . $parent['tid']);
}
- $this->assertRaw(theme('breadcrumb', array('breadcrumb' => $breadcrumb)), t('Breadcrumbs were displayed'));
+ $this->assertRaw(theme('breadcrumb', array('breadcrumb' => $breadcrumb)), 'Breadcrumbs were displayed');
}
/**
diff --git a/modules/help/help.test b/modules/help/help.test
index db739f3459d3b06b1ac56141542e94b7106f9e21..070f8159a6e73a7eca069148fd0d4e3a514b86c6 100644
--- a/modules/help/help.test
+++ b/modules/help/help.test
@@ -41,17 +41,17 @@ class HelpTestCase extends DrupalWebTestCase {
// Check for css on admin/help.
$this->drupalLogin($this->big_user);
$this->drupalGet('admin/help');
- $this->assertRaw(drupal_get_path('module', 'help') . '/help.css', t('The help.css file is present in the HTML.'));
+ $this->assertRaw(drupal_get_path('module', 'help') . '/help.css', 'The help.css file is present in the HTML.');
// Verify that introductory help text exists, goes for 100% module coverage.
$this->assertRaw(t('For more information, refer to the specific topics listed in the next section or to the online Drupal handbooks.', array('@drupal' => 'http://drupal.org/handbooks')), 'Help intro text correctly appears.');
// Verify that help topics text appears.
- $this->assertRaw('' . t('Help topics') . '
' . t('Help is available on the following items:') . '
', t('Help topics text correctly appears.'));
+ $this->assertRaw('' . t('Help topics') . '
' . t('Help is available on the following items:') . '
', 'Help topics text correctly appears.');
// Make sure links are properly added for modules implementing hook_help().
foreach ($this->modules as $module => $name) {
- $this->assertLink($name, 0, t('Link properly added to @name (admin/help/@module)', array('@module' => $module, '@name' => $name)));
+ $this->assertLink($name, 0, 'Link properly added to ' . $name . ' (admin/help/' . $module . ')');
}
}
@@ -66,9 +66,9 @@ class HelpTestCase extends DrupalWebTestCase {
$this->drupalGet('admin/help/' . $module);
$this->assertResponse($response);
if ($response == 200) {
- $this->assertTitle($name . ' | Drupal', t('[' . $module . '] Title was displayed'));
- $this->assertRaw('' . t($name) . '
', t('[' . $module . '] Heading was displayed'));
- }
+ $this->assertTitle($name . ' | Drupal', '[' . $module . '] Title was displayed');
+ $this->assertRaw('' . t($name) . '
', '[' . $module . '] Heading was displayed');
+ }
}
}
@@ -116,6 +116,6 @@ class NoHelpTestCase extends DrupalWebTestCase {
$this->drupalLogin($this->big_user);
$this->drupalGet('admin/help');
- $this->assertNoText('Hook menu tests', t('Making sure the test module menu_test does not display a help link in admin/help'));
+ $this->assertNoText('Hook menu tests', 'Making sure the test module menu_test does not display a help link in admin/help');
}
}
diff --git a/modules/image/image.test b/modules/image/image.test
index 9f0604d1d6690bdd385051fc7e28d81cccdd1149..a31dfc240c9da5dc91a57226e467656cbc894f37 100644
--- a/modules/image/image.test
+++ b/modules/image/image.test
@@ -133,11 +133,11 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase {
function testImageStylePath() {
$actual = image_style_path($this->style_name, 'public://foo/bar.gif');
$expected = 'public://styles/' . $this->style_name . '/foo/bar.gif';
- $this->assertEqual($actual, $expected, t('Got the path for a file URI.'));
+ $this->assertEqual($actual, $expected, 'Got the path for a file URI.');
$actual = image_style_path($this->style_name, 'foo/bar.gif');
$expected = 'public://styles/' . $this->style_name . '/foo/bar.gif';
- $this->assertEqual($actual, $expected, t('Got the path for a relative file path.'));
+ $this->assertEqual($actual, $expected, 'Got the path for a relative file path.');
}
/**
@@ -167,53 +167,53 @@ class ImageStylesPathAndUrlUnitTest extends DrupalWebTestCase {
// Create the directories for the styles.
$d = $scheme . '://styles/' . $this->style_name;
$status = file_prepare_directory($d, FILE_CREATE_DIRECTORY);
- $this->assertNotIdentical(FALSE, $status, t('Created the directory for the generated images for the test style.'));
+ $this->assertNotIdentical(FALSE, $status, 'Created the directory for the generated images for the test style.');
// Create a working copy of the file.
$files = $this->drupalGetTestFiles('image');
$file = reset($files);
$image_info = image_get_info($file->uri);
$original_uri = file_unmanaged_copy($file->uri, $scheme . '://', FILE_EXISTS_RENAME);
- $this->assertNotIdentical(FALSE, $original_uri, t('Created the generated image file.'));
+ $this->assertNotIdentical(FALSE, $original_uri, 'Created the generated image file.');
// Get the URL of a file that has not been generated yet and try to access
// it before image_style_url has been called.
$generated_uri = $scheme . '://styles/' . $this->style_name . '/' . basename($original_uri);
- $this->assertFalse(file_exists($generated_uri), t('Generated file does not exist.'));
+ $this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
$expected_generate_url = url('image/generate/' . $this->style_name . '/' . $scheme . '/' . basename($original_uri), array('absolute' => TRUE));
$this->drupalGet($expected_generate_url);
- $this->assertResponse(403, t('Access to generate URL was denied.'));
+ $this->assertResponse(403, 'Access to generate URL was denied.');
// Check that a generate URL is returned.
$actual_generate_url = image_style_url($this->style_name, $original_uri);
- $this->assertEqual($actual_generate_url, $expected_generate_url, t('Got the generate URL for a non-existent file.'));
+ $this->assertEqual($actual_generate_url, $expected_generate_url, 'Got the generate URL for a non-existent file.');
// Fetch the URL that generates the file while another process appears to
// be generating the same file (this is signaled using a lock).
$lock_name = 'image_style_generate:' . $this->style_name . ':' . drupal_hash_base64($original_uri);
- $this->assertTrue(lock_acquire($lock_name), t('Lock was acquired.'));
+ $this->assertTrue(lock_acquire($lock_name), 'Lock was acquired.');
$this->drupalGet($expected_generate_url);
- $this->assertResponse(503, t('Service Unavailable response received.'));
- $this->assertTrue($this->drupalGetHeader('Retry-After'), t('Retry-After header received.'));
+ $this->assertResponse(503, 'Service Unavailable response received.');
+ $this->assertTrue($this->drupalGetHeader('Retry-After'), 'Retry-After header received.');
lock_release($lock_name);
// Fetch the URL that generates the file.
$this->drupalGet($expected_generate_url);
- $this->assertTrue(file_exists($generated_uri), t('Generated file was created.'));
- $this->assertRaw(file_get_contents($generated_uri), t('URL returns expected file.'));
+ $this->assertTrue(file_exists($generated_uri), 'Generated file was created.');
+ $this->assertRaw(file_get_contents($generated_uri), 'URL returns expected file.');
$generated_image_info = image_get_info($generated_uri);
- $this->assertEqual($this->drupalGetHeader('Content-Type'), $generated_image_info['mime_type'], t('Expected Content-Type was reported.'));
- $this->assertEqual($this->drupalGetHeader('Content-Length'), $generated_image_info['file_size'], t('Expected Content-Length was reported.'));
- $this->assertTrue(lock_may_be_available($lock_name), t('Lock was released.'));
+ $this->assertEqual($this->drupalGetHeader('Content-Type'), $generated_image_info['mime_type'], 'Expected Content-Type was reported.');
+ $this->assertEqual($this->drupalGetHeader('Content-Length'), $generated_image_info['file_size'], 'Expected Content-Length was reported.');
+ $this->assertTrue(lock_may_be_available($lock_name), 'Lock was released.');
// Check that the URL points directly to the generated file.
$expected_generated_url = file_create_url($generated_uri);
$actual_generated_url = image_style_url($this->style_name, $original_uri);
$this->drupalGet($expected_generated_url);
- $this->assertEqual($actual_generated_url, $expected_generated_url, t('Got the download URL for an existing file.'));
- $this->assertRaw(file_get_contents($generated_uri), t('URL returns expected file.'));
- $this->assertEqual($this->drupalGetHeader('Content-Type'), $generated_image_info['mime_type'], t('Expected Content-Type was reported.'));
- $this->assertEqual($this->drupalGetHeader('Content-Length'), $generated_image_info['file_size'], t('Expected Content-Length was reported.'));
+ $this->assertEqual($actual_generated_url, $expected_generated_url, 'Got the download URL for an existing file.');
+ $this->assertRaw(file_get_contents($generated_uri), 'URL returns expected file.');
+ $this->assertEqual($this->drupalGetHeader('Content-Type'), $generated_image_info['mime_type'], 'Expected Content-Type was reported.');
+ $this->assertEqual($this->drupalGetHeader('Content-Length'), $generated_image_info['file_size'], 'Expected Content-Length was reported.');
}
}
@@ -239,13 +239,13 @@ class ImageEffectsUnitTest extends ImageToolkitTestCase {
* Test the image_resize_effect() function.
*/
function testResizeEffect() {
- $this->assertTrue(image_resize_effect($this->image, array('width' => 1, 'height' => 2)), t('Function returned the expected value.'));
+ $this->assertTrue(image_resize_effect($this->image, array('width' => 1, 'height' => 2)), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('resize'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual($calls['resize'][0][1], 1, t('Width was passed correctly'));
- $this->assertEqual($calls['resize'][0][2], 2, t('Height was passed correctly'));
+ $this->assertEqual($calls['resize'][0][1], 1, 'Width was passed correctly');
+ $this->assertEqual($calls['resize'][0][2], 2, 'Height was passed correctly');
}
/**
@@ -253,13 +253,13 @@ class ImageEffectsUnitTest extends ImageToolkitTestCase {
*/
function testScaleEffect() {
// @todo: need to test upscaling.
- $this->assertTrue(image_scale_effect($this->image, array('width' => 10, 'height' => 10)), t('Function returned the expected value.'));
+ $this->assertTrue(image_scale_effect($this->image, array('width' => 10, 'height' => 10)), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('resize'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual($calls['resize'][0][1], 10, t('Width was passed correctly'));
- $this->assertEqual($calls['resize'][0][2], 5, t('Height was based off aspect ratio and passed correctly'));
+ $this->assertEqual($calls['resize'][0][1], 10, 'Width was passed correctly');
+ $this->assertEqual($calls['resize'][0][2], 5, 'Height was based off aspect ratio and passed correctly');
}
/**
@@ -267,42 +267,42 @@ class ImageEffectsUnitTest extends ImageToolkitTestCase {
*/
function testCropEffect() {
// @todo should test the keyword offsets.
- $this->assertTrue(image_crop_effect($this->image, array('anchor' => 'top-1', 'width' => 3, 'height' => 4)), t('Function returned the expected value.'));
+ $this->assertTrue(image_crop_effect($this->image, array('anchor' => 'top-1', 'width' => 3, 'height' => 4)), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('crop'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual($calls['crop'][0][1], 0, t('X was passed correctly'));
- $this->assertEqual($calls['crop'][0][2], 1, t('Y was passed correctly'));
- $this->assertEqual($calls['crop'][0][3], 3, t('Width was passed correctly'));
- $this->assertEqual($calls['crop'][0][4], 4, t('Height was passed correctly'));
+ $this->assertEqual($calls['crop'][0][1], 0, 'X was passed correctly');
+ $this->assertEqual($calls['crop'][0][2], 1, 'Y was passed correctly');
+ $this->assertEqual($calls['crop'][0][3], 3, 'Width was passed correctly');
+ $this->assertEqual($calls['crop'][0][4], 4, 'Height was passed correctly');
}
/**
* Test the image_scale_and_crop_effect() function.
*/
function testScaleAndCropEffect() {
- $this->assertTrue(image_scale_and_crop_effect($this->image, array('width' => 5, 'height' => 10)), t('Function returned the expected value.'));
+ $this->assertTrue(image_scale_and_crop_effect($this->image, array('width' => 5, 'height' => 10)), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('resize', 'crop'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual($calls['crop'][0][1], 7.5, t('X was computed and passed correctly'));
- $this->assertEqual($calls['crop'][0][2], 0, t('Y was computed and passed correctly'));
- $this->assertEqual($calls['crop'][0][3], 5, t('Width was computed and passed correctly'));
- $this->assertEqual($calls['crop'][0][4], 10, t('Height was computed and passed correctly'));
+ $this->assertEqual($calls['crop'][0][1], 7.5, 'X was computed and passed correctly');
+ $this->assertEqual($calls['crop'][0][2], 0, 'Y was computed and passed correctly');
+ $this->assertEqual($calls['crop'][0][3], 5, 'Width was computed and passed correctly');
+ $this->assertEqual($calls['crop'][0][4], 10, 'Height was computed and passed correctly');
}
/**
* Test the image_desaturate_effect() function.
*/
function testDesaturateEffect() {
- $this->assertTrue(image_desaturate_effect($this->image, array()), t('Function returned the expected value.'));
+ $this->assertTrue(image_desaturate_effect($this->image, array()), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('desaturate'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual(count($calls['desaturate'][0]), 1, t('Only the image was passed.'));
+ $this->assertEqual(count($calls['desaturate'][0]), 1, 'Only the image was passed.');
}
/**
@@ -310,13 +310,13 @@ class ImageEffectsUnitTest extends ImageToolkitTestCase {
*/
function testRotateEffect() {
// @todo: need to test with 'random' => TRUE
- $this->assertTrue(image_rotate_effect($this->image, array('degrees' => 90, 'bgcolor' => '#fff')), t('Function returned the expected value.'));
+ $this->assertTrue(image_rotate_effect($this->image, array('degrees' => 90, 'bgcolor' => '#fff')), 'Function returned the expected value.');
$this->assertToolkitOperationsCalled(array('rotate'));
// Check the parameters.
$calls = image_test_get_all_calls();
- $this->assertEqual($calls['rotate'][0][1], 90, t('Degrees were passed correctly'));
- $this->assertEqual($calls['rotate'][0][2], 0xffffff, t('Background color was passed correctly'));
+ $this->assertEqual($calls['rotate'][0][1], 90, 'Degrees were passed correctly');
+ $this->assertEqual($calls['rotate'][0][2], 0xffffff, 'Background color was passed correctly');
}
}
@@ -400,7 +400,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
'name' => $style_name,
);
$this->drupalPost('admin/config/media/image-styles/add', $edit, t('Create new style'));
- $this->assertRaw(t('Style %name was created.', array('%name' => $style_name)), t('Image style successfully created.'));
+ $this->assertRaw(t('Style %name was created.', array('%name' => $style_name)), 'Image style successfully created.');
// Add effect form.
@@ -422,7 +422,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
foreach ($style['effects'] as $ieid => $effect) {
$this->drupalGet($style_path . '/effects/' . $ieid);
foreach ($effect_edits[$effect['name']] as $field => $value) {
- $this->assertFieldByName($field, $value, t('The %field field in the %effect effect has the correct value of %value.', array('%field' => $field, '%effect' => $effect['name'], '%value' => $value)));
+ $this->assertFieldByName($field, $value, 'The ' . $field . ' field in the ' . $effect['name'] . ' effect has the correct value of ' . $value . '.');
}
}
@@ -438,7 +438,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
$order_correct = FALSE;
}
}
- $this->assertTrue($order_correct, t('The order of the effects is correctly set by default.'));
+ $this->assertTrue($order_correct, 'The order of the effects is correctly set by default.');
// Test the style overview form.
// Change the name of the style and adjust the weights of effects.
@@ -454,7 +454,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Create an image to make sure it gets flushed after saving.
$image_path = $this->createSampleImage($style);
- $this->assertEqual($this->getImageCount($style), 1, t('Image style %style image %file successfully generated.', array('%style' => $style['name'], '%file' => $image_path)));
+ $this->assertEqual($this->getImageCount($style), 1, 'Image style ' . $style['name'] . ' image ' . $image_path . ' successfully generated.');
$this->drupalPost($style_path, $edit, t('Update style'));
@@ -463,12 +463,12 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Check that the URL was updated.
$this->drupalGet($style_path);
- $this->assertResponse(200, t('Image style %original renamed to %new', array('%original' => $style['name'], '%new' => $style_name)));
+ $this->assertResponse(200, 'Image style ' . $style['name'] . ' renamed to ' . $style_name);
// Check that the image was flushed after updating the style.
// This is especially important when renaming the style. Make sure that
// the old image directory has been deleted.
- $this->assertEqual($this->getImageCount($style), 0, t('Image style %style was flushed after renaming the style and updating the order of effects.', array('%style' => $style['name'])));
+ $this->assertEqual($this->getImageCount($style), 0, 'Image style ' . $style['name'] . ' was flushed after renaming the style and updating the order of effects.');
// Load the style by the new name with the new weights.
drupal_static_reset('image_styles');
@@ -483,18 +483,18 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
$order_correct = FALSE;
}
}
- $this->assertTrue($order_correct, t('The order of the effects is correctly set by default.'));
+ $this->assertTrue($order_correct, 'The order of the effects is correctly set by default.');
// Image effect deletion form.
// Create an image to make sure it gets flushed after deleting an effect.
$image_path = $this->createSampleImage($style);
- $this->assertEqual($this->getImageCount($style), 1, t('Image style %style image %file successfully generated.', array('%style' => $style['name'], '%file' => $image_path)));
+ $this->assertEqual($this->getImageCount($style), 1, 'Image style ' . $style['name'] . ' image ' . $image_path . ' successfully generated.');
// Test effect deletion form.
$effect = array_pop($style['effects']);
$this->drupalPost($style_path . '/effects/' . $effect['ieid'] . '/delete', array(), t('Delete'));
- $this->assertRaw(t('The image effect %name has been deleted.', array('%name' => $effect['label'])), t('Image effect deleted.'));
+ $this->assertRaw(t('The image effect %name has been deleted.', array('%name' => $effect['label'])), 'Image effect deleted.');
// Style deletion form.
@@ -503,10 +503,10 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Confirm the style directory has been removed.
$directory = file_directory_path() . '/styles/' . $style_name;
- $this->assertFalse(is_dir($directory), t('Image style %style directory removed on style deletion.', array('%style' => $style['name'])));
+ $this->assertFalse(is_dir($directory), 'Image style ' . $style['name'] . ' directory removed on style deletion.');
drupal_static_reset('image_styles');
- $this->assertFalse(image_style_load($style_name), t('Image style %style successfully deleted.', array('%style' => $style['name'])));
+ $this->assertFalse(image_style_load($style_name), 'Image style ' . $style['name'] . ' successfully deleted.');
}
@@ -522,28 +522,28 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Ensure deleting a default is not possible.
$this->drupalGet($delete_path);
- $this->assertText(t('Page not found'), t('Default styles may not be deleted.'));
+ $this->assertText(t('Page not found'), 'Default styles may not be deleted.');
// Ensure that editing a default is not possible (without overriding).
$this->drupalGet($edit_path);
- $this->assertNoField('edit-name', t('Default styles may not be renamed.'));
- $this->assertNoField('edit-submit', t('Default styles may not be edited.'));
- $this->assertNoField('edit-add', t('Default styles may not have new effects added.'));
+ $this->assertNoField('edit-name', 'Default styles may not be renamed.');
+ $this->assertNoField('edit-submit', 'Default styles may not be edited.');
+ $this->assertNoField('edit-add', 'Default styles may not have new effects added.');
// Create an image to make sure the default works before overriding.
drupal_static_reset('image_styles');
$style = image_style_load($style_name);
$image_path = $this->createSampleImage($style);
- $this->assertEqual($this->getImageCount($style), 1, t('Image style %style image %file successfully generated.', array('%style' => $style['name'], '%file' => $image_path)));
+ $this->assertEqual($this->getImageCount($style), 1, 'Image style ' . $style['name'] . ' image ' . $image_path . ' successfully generated.');
// Verify that effects attached to a default style do not have an ieid key.
foreach ($style['effects'] as $effect) {
- $this->assertFalse(isset($effect['ieid']), t('The %effect effect does not have an ieid.', array('%effect' => $effect['name'])));
+ $this->assertFalse(isset($effect['ieid']), 'The ' . $effect['name'] . ' effect does not have an ieid.');
}
// Override the default.
$this->drupalPost($edit_path, array(), t('Override defaults'));
- $this->assertRaw(t('The %style style has been overridden, allowing you to change its settings.', array('%style' => $style_name)), t('Default image style may be overridden.'));
+ $this->assertRaw(t('The %style style has been overridden, allowing you to change its settings.', array('%style' => $style_name)), 'Default image style may be overridden.');
// Add sample effect to the overridden style.
$this->drupalPost($edit_path, array('new' => 'image_desaturate'), t('Add'));
@@ -552,22 +552,22 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Verify that effects attached to the style have an ieid now.
foreach ($style['effects'] as $effect) {
- $this->assertTrue(isset($effect['ieid']), t('The %effect effect has an ieid.', array('%effect' => $effect['name'])));
+ $this->assertTrue(isset($effect['ieid']), 'The ' . $effect['name'] . ' effect has an ieid.');
}
// The style should now have 2 effect, the original scale provided by core
// and the desaturate effect we added in the override.
$effects = array_values($style['effects']);
- $this->assertEqual($effects[0]['name'], 'image_scale', t('The default effect still exists in the overridden style.'));
- $this->assertEqual($effects[1]['name'], 'image_desaturate', t('The added effect exists in the overridden style.'));
+ $this->assertEqual($effects[0]['name'], 'image_scale', 'The default effect still exists in the overridden style.');
+ $this->assertEqual($effects[1]['name'], 'image_desaturate', 'The added effect exists in the overridden style.');
// Check that we are unable to rename an overridden style.
$this->drupalGet($edit_path);
- $this->assertNoField('edit-name', t('Overridden styles may not be renamed.'));
+ $this->assertNoField('edit-name', 'Overridden styles may not be renamed.');
// Create an image to ensure the override works properly.
$image_path = $this->createSampleImage($style);
- $this->assertEqual($this->getImageCount($style), 1, t('Image style %style image %file successfully generated.', array('%style' => $style['name'], '%file' => $image_path)));
+ $this->assertEqual($this->getImageCount($style), 1, 'Image style ' . $style['name'] . ' image ' . $image_path . ' successfully generated.');
// Revert the image style.
$this->drupalPost($revert_path, array(), t('Revert'));
@@ -576,8 +576,8 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// The style should now have the single effect for scale.
$effects = array_values($style['effects']);
- $this->assertEqual($effects[0]['name'], 'image_scale', t('The default effect still exists in the reverted style.'));
- $this->assertFalse(array_key_exists(1, $effects), t('The added effect has been removed in the reverted style.'));
+ $this->assertEqual($effects[0]['name'], 'image_scale', 'The default effect still exists in the reverted style.');
+ $this->assertFalse(array_key_exists(1, $effects), 'The added effect has been removed in the reverted style.');
}
/**
@@ -602,7 +602,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
// Test that image is displayed using newly created style.
$this->drupalGet('node/' . $nid);
- $this->assertRaw(image_style_url($style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri']), t('Image displayed using style @style.', array('@style' => $style_name)));
+ $this->assertRaw(image_style_url($style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri']), 'Image displayed using style ' . $style_name . '.');
// Rename the style and make sure the image field is updated.
$new_style_name = strtolower($this->randomName(10));
@@ -610,9 +610,9 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
'name' => $new_style_name,
);
$this->drupalPost('admin/config/media/image-styles/edit/' . $style_name, $edit, t('Update style'));
- $this->assertText(t('Changes to the style have been saved.'), t('Style %name was renamed to %new_name.', array('%name' => $style_name, '%new_name' => $new_style_name)));
+ $this->assertText(t('Changes to the style have been saved.'), 'Style ' . $style_name . ' was renamed to ' . $new_style_name . '.');
$this->drupalGet('node/' . $nid);
- $this->assertRaw(image_style_url($new_style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri']), t('Image displayed using style replacement style.'));
+ $this->assertRaw(image_style_url($new_style_name, $node->{$field_name}[LANGUAGE_NONE][0]['uri']), 'Image displayed using style replacement style.');
// Delete the style and choose a replacement style.
$edit = array(
@@ -623,7 +623,7 @@ class ImageAdminStylesUnitTest extends ImageFieldTestCase {
$this->assertRaw($message, $message);
$this->drupalGet('node/' . $nid);
- $this->assertRaw(image_style_url('thumbnail', $node->{$field_name}[LANGUAGE_NONE][0]['uri']), t('Image displayed using style replacement style.'));
+ $this->assertRaw(image_style_url('thumbnail', $node->{$field_name}[LANGUAGE_NONE][0]['uri']), 'Image displayed using style replacement style.');
}
}
@@ -658,7 +658,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
'getsize' => TRUE,
);
$default_output = theme('image', $image_info);
- $this->assertRaw($default_output, t('Default formatter displaying correctly on full node view.'));
+ $this->assertRaw($default_output, 'Default formatter displaying correctly on full node view.');
// Test the image linked to file formatter.
$instance = field_info_instance('node', $field_name, 'article');
@@ -666,14 +666,14 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
field_update_instance($instance);
$default_output = l(theme('image', $image_info), file_create_url($image_uri), array('html' => TRUE));
$this->drupalGet('node/' . $nid);
- $this->assertRaw($default_output, t('Image linked to file formatter displaying correctly on full node view.'));
+ $this->assertRaw($default_output, 'Image linked to file formatter displaying correctly on full node view.');
// Test the image linked to content formatter.
$instance['display']['default']['type'] = 'image_link_content';
field_update_instance($instance);
$default_output = l(theme('image', $image_info), 'node/' . $nid, array('html' => TRUE, 'attributes' => array('class' => 'active')));
$this->drupalGet('node/' . $nid);
- $this->assertRaw($default_output, t('Image linked to content formatter displaying correctly on full node view.'));
+ $this->assertRaw($default_output, 'Image linked to content formatter displaying correctly on full node view.');
// Test the image style 'thumbnail' formatter.
$instance['display']['default']['type'] = 'image__thumbnail';
@@ -685,7 +685,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
$image_info['getsize'] = FALSE;
$default_output = theme('image', $image_info);
$this->drupalGet('node/' . $nid);
- $this->assertRaw($default_output, t('Image style thumbnail formatter displaying correctly on full node view.'));
+ $this->assertRaw($default_output, 'Image style thumbnail formatter displaying correctly on full node view.');
}
/**
@@ -710,16 +710,16 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
$instance = field_info_instance('node', $field_name, 'article');
$this->drupalGet('node/add/article');
- $this->assertText(t('Files must be less than 50 KB.'), t('Image widget max file size is displayed on article form.'));
- $this->assertText(t('Allowed file types: ' . $test_image_extension . '.'), t('Image widget allowed file types displayed on article form.'));
- $this->assertText(t('Images must be between 10x10 and 100x100 pixels.'), t('Image widget allowed resolution displayed on article form.'));
+ $this->assertText(t('Files must be less than 50 KB.'), 'Image widget max file size is displayed on article form.');
+ $this->assertText(t('Allowed file types: ' . $test_image_extension . '.'), 'Image widget allowed file types displayed on article form.');
+ $this->assertText(t('Images must be between 10x10 and 100x100 pixels.'), 'Image widget allowed resolution displayed on article form.');
// We have to create the article first and then edit it because the alt
// and title fields do not display until the image has been attached.
$nid = $this->uploadNodeImage($test_image, $field_name, 'article');
$this->drupalGet('node/' . $nid . '/edit');
- $this->assertFieldByName($field_name . '[' . LANGUAGE_NONE . '][0][alt]', '', t('Alt field displayed on article form.'));
- $this->assertFieldByName($field_name . '[' . LANGUAGE_NONE . '][0][title]', '', t('Title field displayed on article form.'));
+ $this->assertFieldByName($field_name . '[' . LANGUAGE_NONE . '][0][alt]', '', 'Alt field displayed on article form.');
+ $this->assertFieldByName($field_name . '[' . LANGUAGE_NONE . '][0][title]', '', 'Title field displayed on article form.');
// Verify that the attached image is being previewed using the 'medium'
// style.
$node = node_load($nid, NULL, TRUE);
@@ -728,7 +728,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
'getsize' => FALSE,
);
$default_output = theme('image', $image_info);
- $this->assertRaw($default_output, t("Preview image is displayed using 'medium' style."));
+ $this->assertRaw($default_output, "Preview image is displayed using 'medium' style.");
// Add alt/title fields to the image and verify that they are displayed.
$image_info = array(
@@ -743,7 +743,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
);
$this->drupalPost('node/' . $nid . '/edit', $edit, t('Save'));
$default_output = theme('image', $image_info);
- $this->assertRaw($default_output, t('Image displayed using user supplied alt and title attributes.'));
+ $this->assertRaw($default_output, 'Image displayed using user supplied alt and title attributes.');
}
/**
@@ -760,7 +760,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
$this->drupalGet('node/' . $node->nid);
// Verify that no image is displayed on the page by checking for the class
// that would be used on the image field.
- $this->assertNoPattern('', t('No image displayed when no image is attached and no default image specified.'));
+ $this->assertNoPattern('', 'No image displayed when no image is attached and no default image specified.');
// Add a default image to the imagefield instance.
$images = $this->drupalGetTestFiles('image');
@@ -774,7 +774,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
$image = file_load($field['settings']['default_image']);
$default_output = theme('image', array('path' => $image->uri, 'getsize' => TRUE));
$this->drupalGet('node/' . $node->nid);
- $this->assertRaw($default_output, t('Default image displayed when no user supplied image is present.'));
+ $this->assertRaw($default_output, 'Default image displayed when no user supplied image is present.');
// Create a node with an image attached and ensure that the default image
// is not displayed.
@@ -786,8 +786,8 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
);
$image_output = theme('image', $image_info);
$this->drupalGet('node/' . $nid);
- $this->assertNoRaw($default_output, t('Default image is not displayed when user supplied image is present.'));
- $this->assertRaw($image_output, t('User supplied image is displayed.'));
+ $this->assertNoRaw($default_output, 'Default image is not displayed when user supplied image is present.');
+ $this->assertRaw($image_output, 'User supplied image is displayed.');
// Remove default image from the field and make sure it is no longer used.
$edit = array(
@@ -797,7 +797,7 @@ class ImageFieldDisplayTestCase extends ImageFieldTestCase {
// Clear field info cache so the new default image is detected.
field_info_cache_clear();
$field = field_info_field($field_name);
- $this->assertFalse($field['settings']['default_image'], t('Default image removed from field.'));
+ $this->assertFalse($field['settings']['default_image'], 'Default image removed from field.');
}
}
@@ -843,8 +843,8 @@ class ImageFieldValidateTestCase extends ImageFieldTestCase {
}
}
$nid = $this->uploadNodeImage($image_that_is_too_small, $field_name, 'article');
- $this->assertText(t('The specified file ' . $image_that_is_too_small->filename . ' could not be uploaded. The image is too small; the minimum dimensions are 50x50 pixels.'), t('Node save failed when minimum image resolution was not met.'));
+ $this->assertText(t('The specified file ' . $image_that_is_too_small->filename . ' could not be uploaded. The image is too small; the minimum dimensions are 50x50 pixels.'), 'Node save failed when minimum image resolution was not met.');
$nid = $this->uploadNodeImage($image_that_is_too_big, $field_name, 'article');
- $this->assertText(t('The image was resized to fit within the maximum allowed dimensions of 100x100 pixels.'), t('Image exceeding max resolution was properly resized.'));
+ $this->assertText(t('The image was resized to fit within the maximum allowed dimensions of 100x100 pixels.'), 'Image exceeding max resolution was properly resized.');
}
}
diff --git a/modules/locale/locale.test b/modules/locale/locale.test
index e6c7cac819e9cbc08fbaa938d1535851b2fed93d..03dce7ec76243300b0230858211ad96fd01282e7 100644
--- a/modules/locale/locale.test
+++ b/modules/locale/locale.test
@@ -51,8 +51,8 @@ class LocaleConfigurationTest extends DrupalWebTestCase {
'langcode' => 'fr',
);
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
- $this->assertText('fr', t('Language added successfully.'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertText('fr', 'Language added successfully.');
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
// Add custom language.
// Code for the language.
@@ -71,79 +71,79 @@ class LocaleConfigurationTest extends DrupalWebTestCase {
'direction' => '0',
);
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add custom language'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
- $this->assertText($langcode, t('Language code found.'));
- $this->assertText($name, t('Name found.'));
- $this->assertText($native, t('Native found.'));
- $this->assertText($native, t('Test language added.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
+ $this->assertText($langcode, 'Language code found.');
+ $this->assertText($name, 'Name found.');
+ $this->assertText($native, 'Native found.');
+ $this->assertText($native, 'Test language added.');
// Check if we can change the default language.
$path = 'admin/config/regional/language';
$this->drupalGet($path);
- $this->assertFieldChecked('edit-site-default-en', t('English is the default language.'));
+ $this->assertFieldChecked('edit-site-default-en', 'English is the default language.');
// Change the default language.
$edit = array(
'site_default' => $langcode,
);
$this->drupalPost(NULL, $edit, t('Save configuration'));
- $this->assertNoFieldChecked('edit-site-default-en', t('Default language updated.'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertNoFieldChecked('edit-site-default-en', 'Default language updated.');
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
// Ensure we can't delete the default language.
$this->drupalGet('admin/config/regional/language/delete/' . $langcode);
- $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
- $this->assertText(t('The default language cannot be deleted.'), t('Failed to delete the default language.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
+ $this->assertText(t('The default language cannot be deleted.'), 'Failed to delete the default language.');
// Check if we can disable a language.
$edit = array(
'enabled[en]' => FALSE,
);
$this->drupalPost($path, $edit, t('Save configuration'));
- $this->assertNoFieldChecked('edit-enabled-en', t('Language disabled.'));
+ $this->assertNoFieldChecked('edit-enabled-en', 'Language disabled.');
// Set disabled language to be the default and ensure it is re-enabled.
$edit = array(
'site_default' => 'en',
);
$this->drupalPost(NULL, $edit, t('Save configuration'));
- $this->assertFieldChecked('edit-enabled-en', t('Default language re-enabled.'));
+ $this->assertFieldChecked('edit-enabled-en', 'Default language re-enabled.');
// Ensure 'edit' link works.
$this->clickLink(t('edit'));
- $this->assertTitle(t('Edit language | Drupal'), t('Page title is "Edit language".'));
+ $this->assertTitle(t('Edit language | Drupal'), 'Page title is "Edit language".');
// Edit a language.
$name = $this->randomName(16);
$edit = array(
'name' => $name,
);
$this->drupalPost('admin/config/regional/language/edit/' . $langcode, $edit, t('Save language'));
- $this->assertRaw($name, t('The language has been updated.'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertRaw($name, 'The language has been updated.');
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
// Ensure 'delete' link works.
$this->drupalGet('admin/config/regional/language');
$this->clickLink(t('delete'));
- $this->assertText(t('Are you sure you want to delete the language'), t('"delete" link is correct.'));
+ $this->assertText(t('Are you sure you want to delete the language'), '"delete" link is correct.');
// Delete the language.
$this->drupalGet('admin/config/regional/language/delete/' . $langcode);
// First test the 'cancel' link.
$this->clickLink(t('Cancel'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
- $this->assertRaw($name, t('The language was not deleted.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
+ $this->assertRaw($name, 'The language was not deleted.');
// Delete the language for real. This a confirm form, we do not need any
// fields changed.
$this->drupalPost('admin/config/regional/language/delete/' . $langcode, array(), t('Delete'));
// We need raw here because %locale will add HTML.
- $this->assertRaw(t('The language %locale has been removed.', array('%locale' => $name)), t('The test language has been removed.'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertRaw(t('The language %locale has been removed.', array('%locale' => $name)), 'The test language has been removed.');
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
// Verify that language is no longer found.
$this->drupalGet('admin/config/regional/language/delete/' . $langcode);
- $this->assertResponse(404, t('Language no longer found.'));
+ $this->assertResponse(404, 'Language no longer found.');
// Ensure we can't delete the English language.
$this->drupalGet('admin/config/regional/language/delete/en');
- $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
- $this->assertText(t('The English language cannot be deleted.'), t('Failed to delete English language.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
+ $this->assertText(t('The English language cannot be deleted.'), 'Failed to delete English language.');
}
}
@@ -202,12 +202,12 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
t($name, array(), array('langcode' => $langcode));
// Reset locale cache.
locale_reset();
- $this->assertText($langcode, t('Language code found.'));
- $this->assertText($name, t('Name found.'));
- $this->assertText($native, t('Native found.'));
+ $this->assertText($langcode, 'Language code found.');
+ $this->assertText($name, 'Name found.');
+ $this->assertText($native, 'Native found.');
// No t() here, we do not want to add this string to the database and it's
// surely not translated yet.
- $this->assertText($native, t('Test language added.'));
+ $this->assertText($native, 'Test language added.');
$this->drupalLogout();
// Search for the name and translate it.
@@ -222,8 +222,8 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
// assertText() seems to remove the input field where $name always could be
// found, so this is not a false assert. See how assertNoText succeeds
// later.
- $this->assertText($name, t('Search found the name.'));
- $this->assertRaw($language_indicator, t('Name is untranslated.'));
+ $this->assertText($name, 'Search found the name.');
+ $this->assertRaw($language_indicator, 'Name is untranslated.');
// Assume this is the only result, given the random name.
$this->clickLink(t('edit'));
// We save the lid from the path.
@@ -231,24 +231,24 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
preg_match('!admin/config/regional/translate/edit/(\d+)!', $this->getUrl(), $matches);
$lid = $matches[1];
// No t() here, it's surely not translated yet.
- $this->assertText($name, t('name found on edit screen.'));
+ $this->assertText($name, 'name found on edit screen.');
$edit = array(
"translations[$langcode]" => $translation,
);
$this->drupalPost(NULL, $edit, t('Save translations'));
- $this->assertText(t('The string has been saved.'), t('The string has been saved.'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
- $this->assertTrue($name != $translation && t($name, array(), array('langcode' => $langcode)) == $translation, t('t() works.'));
+ $this->assertText(t('The string has been saved.'), 'The string has been saved.');
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), 'Correct page redirection.');
+ $this->assertTrue($name != $translation && t($name, array(), array('langcode' => $langcode)) == $translation, 't() works.');
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
// The indicator should not be here.
- $this->assertNoRaw($language_indicator, t('String is translated.'));
+ $this->assertNoRaw($language_indicator, 'String is translated.');
// Try to edit a non-existent string and ensure we're redirected correctly.
// Assuming we don't have 999,999 strings already.
$random_lid = 999999;
$this->drupalGet('admin/config/regional/translate/edit/' . $random_lid);
- $this->assertText(t('String not found'), t('String not found.'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertText(t('String not found'), 'String not found.');
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), 'Correct page redirection.');
$this->drupalLogout();
// Delete the language.
@@ -257,12 +257,12 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
// This a confirm form, we do not need any fields changed.
$this->drupalPost($path, array(), t('Delete'));
// We need raw here because %locale will add HTML.
- $this->assertRaw(t('The language %locale has been removed.', array('%locale' => $name)), t('The test language has been removed.'));
+ $this->assertRaw(t('The language %locale has been removed.', array('%locale' => $name)), 'The test language has been removed.');
// Reload to remove $name.
$this->drupalGet($path);
- $this->assertNoText($langcode, t('Language code not found.'));
- $this->assertNoText($name, t('Name not found.'));
- $this->assertNoText($native, t('Native not found.'));
+ $this->assertNoText($langcode, 'Language code not found.');
+ $this->assertNoText($name, 'Name not found.');
+ $this->assertNoText($native, 'Native not found.');
$this->drupalLogout();
// Delete the string.
@@ -276,20 +276,20 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
// Assume this is the only result, given the random name.
$this->clickLink(t('delete'));
- $this->assertText(t('Are you sure you want to delete the string'), t('"delete" link is correct.'));
+ $this->assertText(t('Are you sure you want to delete the string'), '"delete" link is correct.');
// Delete the string.
$path = 'admin/config/regional/translate/delete/' . $lid;
$this->drupalGet($path);
// First test the 'cancel' link.
$this->clickLink(t('Cancel'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
- $this->assertRaw($name, t('The string was not deleted.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), 'Correct page redirection.');
+ $this->assertRaw($name, 'The string was not deleted.');
// Delete the name string.
$this->drupalPost('admin/config/regional/translate/delete/' . $lid, array(), t('Delete'));
- $this->assertText(t('The string has been removed.'), t('The string has been removed message.'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertText(t('The string has been removed.'), 'The string has been removed message.');
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/translate', array('absolute' => TRUE)), 'Correct page redirection.');
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertNoText($name, t('Search now can not find the name.'));
+ $this->assertNoText($name, 'Search now can not find the name.');
}
/*
@@ -330,7 +330,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
->condition('l.textgroup', 'default')
->execute();
$url = 'admin/config/regional/translate/edit/' . $result->fetchObject()->lid;
- $edit = array('translations['. $langcode .']' => $this->randomName());
+ $edit = array('translations[' . $langcode . ']' => $this->randomName());
$this->drupalPost($url, $edit, t('Save translations'));
// Trigger JavaScript translation parsing and building.
@@ -345,14 +345,14 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
->execute()
->fetchObject();
$js_file = 'public://' . variable_get('locale_js_directory', 'languages') . '/' . $langcode . '_' . $file->javascript . '.js';
- $this->assertTrue($result = file_exists($js_file), t('JavaScript file created: %file', array('%file' => $result ? $js_file : t('not found'))));
+ $this->assertTrue($result = file_exists($js_file), 'JavaScript file created: ' . $result ? $js_file : t('not found'));
// Test JavaScript translation rebuilding.
file_unmanaged_delete($js_file);
- $this->assertTrue($result = !file_exists($js_file), t('JavaScript file deleted: %file', array('%file' => $result ? $js_file : t('found'))));
+ $this->assertTrue($result = !file_exists($js_file), 'JavaScript file deleted: ' . $result ? $js_file : t('found'));
cache_clear_all();
_locale_rebuild_js($langcode);
- $this->assertTrue($result = file_exists($js_file), t('JavaScript file rebuilt: %file', array('%file' => $result ? $js_file : t('not found'))));
+ $this->assertTrue($result = file_exists($js_file), 'JavaScript file rebuilt: ' . $result ? $js_file : t('not found'));
}
/**
@@ -382,7 +382,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
$key = $this->randomName(16);
$bad_translations[$key] = '<' . $key;
$key = $this->randomName(16);
- $bad_translations[$key] ="" . $key;
+ $bad_translations[$key] = "" . $key;
// Add custom language.
$edit = array(
@@ -405,7 +405,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
// Find the edit path.
$content = $this->drupalGetContent();
- $this->assertTrue(preg_match('@(admin/config/regional/translate/edit/[0-9]+)@', $content, $matches), t('Found the edit path.'));
+ $this->assertTrue(preg_match('@(admin/config/regional/translate/edit/[0-9]+)@', $content, $matches), 'Found the edit path.');
$path = $matches[0];
foreach ($bad_translations as $key => $translation) {
$edit = array(
@@ -414,8 +414,8 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
$this->drupalPost($path, $edit, t('Save translations'));
// Check for a form error on the textarea.
$form_class = $this->xpath('//form[@id="locale-translate-edit-form"]//textarea/@class');
- $this->assertNotIdentical(FALSE, strpos($form_class[0], 'error'), t('The string was rejected as unsafe.'));
- $this->assertNoText(t('The string has been saved.'), t('The string was not saved.'));
+ $this->assertNotIdentical(FALSE, strpos($form_class[0], 'error'), 'The string was rejected as unsafe.');
+ $this->assertNoText(t('The string has been saved.'), 'The string was not saved.');
}
}
@@ -472,7 +472,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
// assertText() seems to remove the input field where $name always could be
// found, so this is not a false assert. See how assertNoText succeeds
// later.
- $this->assertText($name, t('Search found the string.'));
+ $this->assertText($name, 'Search found the string.');
// Ensure untranslated string doesn't appear if searching on 'only
// translated strings'.
@@ -483,7 +483,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
'group' => 'all',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertText(t('No strings available.'), t("Search didn't find the string."));
+ $this->assertText(t('No strings available.'), "Search didn't find the string.");
// Ensure untranslated string appears if searching on 'only untranslated
// strings'.
@@ -494,7 +494,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
'group' => 'all',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertNoText(t('No strings available.'), t('Search found the string.'));
+ $this->assertNoText(t('No strings available.'), 'Search found the string.');
// Add translation.
// Assume this is the only result, given the random name.
@@ -517,7 +517,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
'group' => 'all',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertNoText(t('No strings available.'), t('Search found the translation.'));
+ $this->assertNoText(t('No strings available.'), 'Search found the translation.');
// Ensure translated source string doesn't appear if searching on 'only
// untranslated strings'.
@@ -528,7 +528,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
'group' => 'all',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertText(t('No strings available.'), t("Search didn't find the source string."));
+ $this->assertText(t('No strings available.'), "Search didn't find the source string.");
// Ensure translated string doesn't appear if searching on 'only
// untranslated strings'.
@@ -539,7 +539,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
'group' => 'all',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertText(t('No strings available.'), t("Search didn't find the translation."));
+ $this->assertText(t('No strings available.'), "Search didn't find the translation.");
// Ensure translated string does appear if searching on the custom language.
$search = array(
@@ -549,7 +549,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
'group' => 'all',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertNoText(t('No strings available.'), t('Search found the translation.'));
+ $this->assertNoText(t('No strings available.'), 'Search found the translation.');
// Ensure translated string doesn't appear if searching on English.
$search = array(
@@ -559,7 +559,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
'group' => 'all',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertText(t('No strings available.'), t("Search didn't find the translation."));
+ $this->assertText(t('No strings available.'), "Search didn't find the translation.");
// Search for a string that isn't in the system.
$unavailable_string = $this->randomName(16);
@@ -570,7 +570,7 @@ class LocaleTranslationFunctionalTest extends DrupalWebTestCase {
'group' => 'all',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertText(t('No strings available.'), t("Search didn't find the invalid string."));
+ $this->assertText(t('No strings available.'), "Search didn't find the invalid string.");
}
}
@@ -608,16 +608,16 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
));
// The import should automatically create the corresponding language.
- $this->assertRaw(t('The language %language has been created.', array('%language' => 'French')), t('The language has been automatically created.'));
+ $this->assertRaw(t('The language %language has been created.', array('%language' => 'French')), 'The language has been automatically created.');
// The import should have created 7 strings.
- $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 7, '%update' => 0, '%delete' => 0)), t('The translation file was successfully imported.'));
+ $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 7, '%update' => 0, '%delete' => 0)), 'The translation file was successfully imported.');
// This import should have saved plural forms to have 2 variants.
- $this->assert(db_query("SELECT plurals FROM {languages} WHERE language = 'fr'")->fetchField() == 2, t('Plural number initialized.'));
+ $this->assert(db_query("SELECT plurals FROM {languages} WHERE language = 'fr'")->fetchField() == 2, 'Plural number initialized.');
// Ensure we were redirected correctly.
- $this->assertEqual($this->getUrl(), url('admin/config/regional/translate', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/translate', array('absolute' => TRUE)), 'Correct page redirection.');
// Try importing a .po file with invalid tags in the default text group.
@@ -626,9 +626,9 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
));
// The import should have created 1 string and rejected 2.
- $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 1, '%update' => 0, '%delete' => 0)), t('The translation file was successfully imported.'));
+ $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 1, '%update' => 0, '%delete' => 0)), 'The translation file was successfully imported.');
$skip_message = format_plural(2, 'One translation string was skipped because it contains disallowed HTML.', '@count translation strings were skipped because they contain disallowed HTML.');
- $this->assertRaw($skip_message, t('Unsafe strings were skipped.'));
+ $this->assertRaw($skip_message, 'Unsafe strings were skipped.');
// Try importing a .po file with invalid tags in a non default text group.
@@ -638,7 +638,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
));
// The import should have created 3 strings.
- $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 3, '%update' => 0, '%delete' => 0)), t('The translation file was successfully imported.'));
+ $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 3, '%update' => 0, '%delete' => 0)), 'The translation file was successfully imported.');
// Try importing a .po file which doesn't exist.
@@ -648,8 +648,8 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
'files[file]' => $name,
'group' => 'custom',
), t('Import'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/import', array('absolute' => TRUE)), t('Correct page redirection.'));
- $this->assertText(t('File to import not found.'), t('File to import not found message.'));
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/translate/import', array('absolute' => TRUE)), 'Correct page redirection.');
+ $this->assertText(t('File to import not found.'), 'File to import not found message.');
// Try importing a .po file with overriding strings, and ensure existing
@@ -660,7 +660,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
));
// The import should have created 1 string.
- $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 1, '%update' => 0, '%delete' => 0)), t('The translation file was successfully imported.'));
+ $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 1, '%update' => 0, '%delete' => 0)), 'The translation file was successfully imported.');
// Ensure string wasn't overwritten.
$search = array(
'string' => 'Montag',
@@ -669,10 +669,10 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
'group' => 'all',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertText(t('No strings available.'), t('String not overwritten by imported string.'));
+ $this->assertText(t('No strings available.'), 'String not overwritten by imported string.');
// This import should not have changed number of plural forms.
- $this->assert(db_query("SELECT plurals FROM {languages} WHERE language = 'fr'")->fetchField() == 2, t('Plural numbers untouched.'));
+ $this->assert(db_query("SELECT plurals FROM {languages} WHERE language = 'fr'")->fetchField() == 2, 'Plural numbers untouched.');
// Try importing a .po file with overriding strings, and ensure existing
// strings are overwritten.
@@ -682,7 +682,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
));
// The import should have updated 2 strings.
- $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 0, '%update' => 2, '%delete' => 0)), t('The translation file was successfully imported.'));
+ $this->assertRaw(t('The translation was successfully imported. There are %number newly created translated strings, %update strings were updated and %delete strings were removed.', array('%number' => 0, '%update' => 2, '%delete' => 0)), 'The translation file was successfully imported.');
// Ensure string was overwritten.
$search = array(
'string' => 'Montag',
@@ -691,9 +691,9 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
'group' => 'all',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertNoText(t('No strings available.'), t('String overwritten by imported string.'));
+ $this->assertNoText(t('No strings available.'), 'String overwritten by imported string.');
// This import should have changed number of plural forms.
- $this->assert(db_query("SELECT plurals FROM {languages} WHERE language = 'fr'")->fetchField() == 3, t('Plural numbers changed.'));
+ $this->assert(db_query("SELECT plurals FROM {languages} WHERE language = 'fr'")->fetchField() == 3, 'Plural numbers changed.');
}
/**
@@ -722,7 +722,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
// Ensure the translation file was automatically imported when language was
// added.
- $this->assertText(t('One translation file imported for the enabled modules.'), t('Language file automatically imported.'));
+ $this->assertText(t('One translation file imported for the enabled modules.'), 'Language file automatically imported.');
// Ensure strings were successfully imported.
$search = array(
@@ -732,7 +732,7 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
'group' => 'all',
);
$this->drupalPost('admin/config/regional/translate/translate', $search, t('Filter'));
- $this->assertNoText(t('No strings available.'), t('String successfully imported.'));
+ $this->assertNoText(t('No strings available.'), 'String successfully imported.');
}
/**
@@ -745,8 +745,8 @@ class LocaleImportFunctionalTest extends DrupalWebTestCase {
'langcode' => 'hr',
));
- $this->assertIdentical(t('May', array(), array('langcode' => 'hr', 'context' => 'Long month name')), 'Svibanj', t('Long month name context is working.'));
- $this->assertIdentical(t('May', array(), array('langcode' => 'hr')), 'Svi.', t('Default context is working.'));
+ $this->assertIdentical(t('May', array(), array('langcode' => 'hr', 'context' => 'Long month name')), 'Svibanj', 'Long month name context is working.');
+ $this->assertIdentical(t('May', array(), array('langcode' => 'hr')), 'Svi.', 'Default context is working.');
}
/**
@@ -919,9 +919,9 @@ class LocaleExportFunctionalTest extends DrupalWebTestCase {
), t('Export'));
// Ensure we have a translation file.
- $this->assertRaw('# French translation of Drupal', t('Exported French translation file.'));
+ $this->assertRaw('# French translation of Drupal', 'Exported French translation file.');
// Ensure our imported translations exist in the file.
- $this->assertRaw('msgstr "lundi"', t('French translations present in exported file.'));
+ $this->assertRaw('msgstr "lundi"', 'French translations present in exported file.');
}
/**
@@ -934,7 +934,7 @@ class LocaleExportFunctionalTest extends DrupalWebTestCase {
// doesn't work.
$this->drupalPost('admin/config/regional/translate/export', array(), t('Export'));
// Ensure we have a translation file.
- $this->assertRaw('# LANGUAGE translation of PROJECT', t('Exported translation template file.'));
+ $this->assertRaw('# LANGUAGE translation of PROJECT', 'Exported translation template file.');
}
/**
@@ -982,7 +982,7 @@ class LocaleInstallTest extends DrupalWebTestCase {
function testFunctionSignatures() {
$reflector_t = new ReflectionFunction('t');
$reflector_st = new ReflectionFunction('st');
- $this->assertEqual($reflector_t->getParameters(), $reflector_st->getParameters(), t('Function signatures of t() and st() are equal.'));
+ $this->assertEqual($reflector_t->getParameters(), $reflector_st->getParameters(), 'Function signatures of t() and st() are equal.');
}
}
@@ -1021,7 +1021,7 @@ class LocaleUninstallFunctionalTest extends DrupalWebTestCase {
// Check the UI language.
drupal_language_initialize();
global $language;
- $this->assertEqual($language->language, $this->language, t('Current language: %lang', array('%lang' => $language->language)));
+ $this->assertEqual($language->language, $this->language, 'Current language: ' . $language->language);
// Enable multilingual workflow option for articles.
variable_set('language_content_type_article', 1);
@@ -1042,7 +1042,7 @@ class LocaleUninstallFunctionalTest extends DrupalWebTestCase {
_locale_rebuild_js('fr');
$file = db_query('SELECT javascript FROM {languages} WHERE language = :language', array(':language' => 'fr'))->fetchObject();
$js_file = 'public://' . variable_get('locale_js_directory', 'languages') . '/fr_' . $file->javascript . '.js';
- $this->assertTrue($result = file_exists($js_file), t('JavaScript file created: %file', array('%file' => $result ? $js_file : t('none'))));
+ $this->assertTrue($result = file_exists($js_file), 'JavaScript file created: ' . $result ? $js_file : t('none'));
// Disable string caching.
variable_set('locale_cache_strings', 0);
@@ -1067,44 +1067,44 @@ class LocaleUninstallFunctionalTest extends DrupalWebTestCase {
// Check the init language logic.
drupal_language_initialize();
- $this->assertEqual($language->language, 'en', t('Language after uninstall: %lang', array('%lang' => $language->language)));
+ $this->assertEqual($language->language, 'en', 'Language after uninstall: ' . $language->language);
// Check JavaScript files deletion.
- $this->assertTrue($result = !file_exists($js_file), t('JavaScript file deleted: %file', array('%file' => $result ? $js_file : t('found'))));
+ $this->assertTrue($result = !file_exists($js_file), 'JavaScript file deleted: ' . $result ? $js_file : t('found'));
// Check language count.
$language_count = variable_get('language_count', 1);
- $this->assertEqual($language_count, 1, t('Language count: %count', array('%count' => $language_count)));
+ $this->assertEqual($language_count, 1, 'Language count: ' . $language_count);
// Check language negotiation.
require_once DRUPAL_ROOT . '/includes/language.inc';
- $this->assertTrue(count(language_types()) == count(drupal_language_types()), t('Language types reset'));
+ $this->assertTrue(count(language_types()) == count(drupal_language_types()), 'Language types reset');
$language_negotiation = language_negotiation_get(LANGUAGE_TYPE_INTERFACE) == LANGUAGE_NEGOTIATION_DEFAULT;
- $this->assertTrue($language_negotiation, t('Interface language negotiation: %setting', array('%setting' => t($language_negotiation ? 'none' : 'set'))));
+ $this->assertTrue($language_negotiation, 'Interface language negotiation: ' . t($language_negotiation ? 'none' : 'set'));
$language_negotiation = language_negotiation_get(LANGUAGE_TYPE_CONTENT) == LANGUAGE_NEGOTIATION_DEFAULT;
- $this->assertTrue($language_negotiation, t('Content language negotiation: %setting', array('%setting' => t($language_negotiation ? 'none' : 'set'))));
+ $this->assertTrue($language_negotiation, 'Content language negotiation: ' . t($language_negotiation ? 'none' : 'set'));
$language_negotiation = language_negotiation_get(LANGUAGE_TYPE_URL) == LANGUAGE_NEGOTIATION_DEFAULT;
- $this->assertTrue($language_negotiation, t('URL language negotiation: %setting', array('%setting' => t($language_negotiation ? 'none' : 'set'))));
+ $this->assertTrue($language_negotiation, 'URL language negotiation: ' . t($language_negotiation ? 'none' : 'set'));
// Check language providers settings.
- $this->assertFalse(variable_get('locale_language_negotiation_url_part', FALSE), t('URL language provider indicator settings cleared.'));
- $this->assertFalse(variable_get('locale_language_negotiation_session_param', FALSE), t('Visit language provider settings cleared.'));
+ $this->assertFalse(variable_get('locale_language_negotiation_url_part', FALSE), 'URL language provider indicator settings cleared.');
+ $this->assertFalse(variable_get('locale_language_negotiation_session_param', FALSE), 'Visit language provider settings cleared.');
// Check JavaScript parsed.
$javascript_parsed_count = count(variable_get('javascript_parsed', array()));
- $this->assertEqual($javascript_parsed_count, 0, t('JavaScript parsed count: %count', array('%count' => $javascript_parsed_count)));
+ $this->assertEqual($javascript_parsed_count, 0, 'JavaScript parsed count: ' . $javascript_parsed_count);
// Check multilingual workflow option for articles.
$multilingual = variable_get('language_content_type_article', 0);
- $this->assertEqual($multilingual, 0, t('Multilingual workflow option: %status', array('%status' => t($multilingual ? 'enabled': 'disabled'))));
+ $this->assertEqual($multilingual, 0, 'Multilingual workflow option: ' . t($multilingual ? 'enabled' : 'disabled'));
// Check JavaScript translations directory.
$locale_js_directory = variable_get('locale_js_directory', 'languages');
- $this->assertEqual($locale_js_directory, 'languages', t('JavaScript translations directory: %dir', array('%dir' => $locale_js_directory)));
+ $this->assertEqual($locale_js_directory, 'languages', 'JavaScript translations directory: ' . $locale_js_directory);
// Check string caching.
$locale_cache_strings = variable_get('locale_cache_strings', 1);
- $this->assertEqual($locale_cache_strings, 1, t('String caching: %status', array('%status' => t($locale_cache_strings ? 'enabled': 'disabled'))));
+ $this->assertEqual($locale_cache_strings, 1, 'String caching: ' . t($locale_cache_strings ? 'enabled' : 'disabled'));
}
}
@@ -1177,7 +1177,7 @@ class LocaleLanguageSwitchingFunctionalTest extends DrupalWebTestCase {
// Assert that the language switching block is displayed on the frontpage.
$this->drupalGet('');
- $this->assertText(t('Languages'), t('Language switcher block found.'));
+ $this->assertText(t('Languages'), 'Language switcher block found.');
// Assert that only the current language is marked as active.
list($language_switcher) = $this->xpath('//div[@id=:id]/div[@class="content"]', array(':id' => 'block-locale-' . $language_type));
@@ -1206,8 +1206,8 @@ class LocaleLanguageSwitchingFunctionalTest extends DrupalWebTestCase {
$anchors['inactive'][] = $language;
}
}
- $this->assertIdentical($links, array('active' => array('en'), 'inactive' => array('fr')), t('Only the current language list item is marked as active on the language switcher block.'));
- $this->assertIdentical($anchors, array('active' => array('en'), 'inactive' => array('fr')), t('Only the current language anchor is marked as active on the language switcher block.'));
+ $this->assertIdentical($links, array('active' => array('en'), 'inactive' => array('fr')), 'Only the current language list item is marked as active on the language switcher block.');
+ $this->assertIdentical($anchors, array('active' => array('en'), 'inactive' => array('fr')), 'Only the current language anchor is marked as active on the language switcher block.');
}
}
@@ -1286,21 +1286,21 @@ class LocaleUserLanguageFunctionalTest extends DrupalWebTestCase {
$path = 'user/' . $web_user->uid . '/edit';
$this->drupalGet($path);
// Ensure language settings fieldset is available.
- $this->assertText(t('Language settings'), t('Language settings available.'));
+ $this->assertText(t('Language settings'), 'Language settings available.');
// Ensure custom language is present.
- $this->assertText($name, t('Language present on form.'));
+ $this->assertText($name, 'Language present on form.');
// Ensure disabled language isn't present.
- $this->assertNoText($name_disabled, t('Disabled language not present on form.'));
+ $this->assertNoText($name_disabled, 'Disabled language not present on form.');
// Switch to our custom language.
$edit = array(
'language' => $langcode,
);
$this->drupalPost($path, $edit, t('Save'));
// Ensure form was submitted successfully.
- $this->assertText(t('The changes have been saved.'), t('Changes were saved.'));
+ $this->assertText(t('The changes have been saved.'), 'Changes were saved.');
// Check if language was changed.
$elements = $this->xpath('//input[@id=:id]', array(':id' => 'edit-language-' . $langcode));
- $this->assertTrue(isset($elements[0]) && !empty($elements[0]['checked']), t('Default language successfully updated.'));
+ $this->assertTrue(isset($elements[0]) && !empty($elements[0]['checked']), 'Default language successfully updated.');
$this->drupalLogout();
}
@@ -1338,20 +1338,20 @@ class LocaleUserCreationTest extends DrupalWebTestCase {
'langcode' => 'fr',
);
$this->drupalPost('admin/config/regional/language/add', $edit, t('Add language'));
- $this->assertText($langcode, t('Language added successfully.'));
- $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), t('Correct page redirection.'));
+ $this->assertText($langcode, 'Language added successfully.');
+ $this->assertEqual($this->getUrl(), url('admin/config/regional/language', array('absolute' => TRUE)), 'Correct page redirection.');
// Set language negotiation.
$edit = array(
'language[enabled][locale-url]' => TRUE,
);
$this->drupalPost('admin/config/regional/language/configure', $edit, t('Save settings'));
- $this->assertText(t('Language negotiation configuration saved.'), t('Set language negotiation.'));
+ $this->assertText(t('Language negotiation configuration saved.'), 'Set language negotiation.');
// Check if the language selector is available on admin/people/create and
// set to the currently active language.
$this->drupalGet($langcode . '/admin/people/create');
- $this->assertFieldChecked("edit-language-$langcode", t('Global language set in the language selector.'));
+ $this->assertFieldChecked("edit-language-$langcode", 'Global language set in the language selector.');
// Create a user with the admin/people/create form and check if the correct
// language is set.
@@ -1366,7 +1366,7 @@ class LocaleUserCreationTest extends DrupalWebTestCase {
$this->drupalPost($langcode . '/admin/people/create', $edit, t('Create new account'));
$user = user_load_by_name($username);
- $this->assertEqual($user->language, $langcode, t('New user has correct language set.'));
+ $this->assertEqual($user->language, $langcode, 'New user has correct language set.');
// Register a new user and check if the language selector is hidden.
$this->drupalLogout();
@@ -1383,7 +1383,7 @@ class LocaleUserCreationTest extends DrupalWebTestCase {
$this->drupalPost($langcode . '/user/register', $edit, t('Create new account'));
$user = user_load_by_name($username);
- $this->assertEqual($user->language, $langcode, t('New user has correct language set.'));
+ $this->assertEqual($user->language, $langcode, 'New user has correct language set.');
// Test if the admin can use the language selector and if the
// correct language is was saved.
@@ -1391,7 +1391,7 @@ class LocaleUserCreationTest extends DrupalWebTestCase {
$this->drupalLogin($admin_user);
$this->drupalGet($user_edit);
- $this->assertFieldChecked("edit-language-$langcode", t('Language selector is accessible and correct language is selected.'));
+ $this->assertFieldChecked("edit-language-$langcode", 'Language selector is accessible and correct language is selected.');
// Set pass_raw so we can login the new user.
$user->pass_raw = $this->randomName(10);
@@ -1404,7 +1404,7 @@ class LocaleUserCreationTest extends DrupalWebTestCase {
$this->drupalLogin($user);
$this->drupalGet($user_edit);
- $this->assertFieldChecked("edit-language-$langcode", t('Language selector is accessible and correct language is selected.'));
+ $this->assertFieldChecked("edit-language-$langcode", 'Language selector is accessible and correct language is selected.');
}
}
@@ -1480,11 +1480,11 @@ class LocalePathFunctionalTest extends DrupalWebTestCase {
// Confirm English language path alias works.
$this->drupalGet($english_path);
- $this->assertText($node->title, t('English alias works.'));
+ $this->assertText($node->title, 'English alias works.');
// Confirm custom language path alias works.
$this->drupalGet($prefix . '/' . $custom_language_path);
- $this->assertText($node->title, t('Custom language alias works.'));
+ $this->assertText($node->title, 'Custom language alias works.');
$this->drupalLogout();
}
@@ -1563,28 +1563,28 @@ class LocaleContentFunctionalTest extends DrupalWebTestCase {
// Set "Basic page" content type to use multilingual support.
$this->drupalGet('admin/structure/types/manage/page');
- $this->assertText(t('Multilingual support'), t('Multilingual support fieldset present on content type configuration form.'));
+ $this->assertText(t('Multilingual support'), 'Multilingual support fieldset present on content type configuration form.');
$edit = array(
'language_content_type' => 1,
);
$this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
- $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Basic page')), t('Basic page content type has been updated.'));
+ $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Basic page')), 'Basic page content type has been updated.');
$this->drupalLogout();
// Verify language selection is not present on add article form.
$this->drupalLogin($web_user);
$this->drupalGet('node/add/article');
// Verify language select list is not present.
- $this->assertNoFieldByName('language', '', t('Language select not present on add article form.'));
+ $this->assertNoFieldByName('language', '', 'Language select not present on add article form.');
// Verify language selection appears on add "Basic page" form.
$this->drupalGet('node/add/page');
// Verify language select list is present.
- $this->assertFieldByName('language', '', t('Language select present on add Basic page form.'));
+ $this->assertFieldByName('language', '', 'Language select present on add Basic page form.');
// Ensure enabled language appears.
- $this->assertText($name, t('Enabled language present.'));
+ $this->assertText($name, 'Enabled language present.');
// Ensure disabled language doesn't appear.
- $this->assertNoText($name_disabled, t('Disabled language not present.'));
+ $this->assertNoText($name_disabled, 'Disabled language not present.');
// Create "Basic page" content.
$node_title = $this->randomName();
@@ -1599,13 +1599,13 @@ class LocaleContentFunctionalTest extends DrupalWebTestCase {
// Edit the content and ensure correct language is selected.
$path = 'node/' . $node->nid . '/edit';
$this->drupalGet($path);
- $this->assertRaw('', t('Correct language selected.'));
+ $this->assertRaw('', 'Correct language selected.');
// Ensure we can change the node language.
$edit = array(
'language' => 'en',
);
$this->drupalPost($path, $edit, t('Save'));
- $this->assertRaw(t('%title has been updated.', array('%title' => $node_title)), t('Basic page content updated.'));
+ $this->assertRaw(t('%title has been updated.', array('%title' => $node_title)), 'Basic page content updated.');
$this->drupalLogout();
}
@@ -1698,7 +1698,7 @@ class LocaleUILanguageNegotiationTest extends DrupalWebTestCase {
$language_browser_fallback_string = "In $language_browser_fallback In $language_browser_fallback In $language_browser_fallback";
$language_string = "In $language In $language In $language";
// Do a translate search of our target string.
- $edit = array( 'string' => $default_string);
+ $edit = array('string' => $default_string);
$this->drupalPost('admin/config/regional/translate/translate', $edit, t('Filter'));
// Should find the string and now click edit to post translated string.
$this->clickLink('edit');
@@ -1840,7 +1840,7 @@ class LocaleMultilingualFieldsFunctionalTest extends DrupalWebTestCase {
'language_content_type' => 1,
);
$this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
- $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Basic page')), t('Basic page content type has been updated.'));
+ $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Basic page')), 'Basic page content type has been updated.');
}
/**
@@ -1863,10 +1863,10 @@ class LocaleMultilingualFieldsFunctionalTest extends DrupalWebTestCase {
// Check that the node exists in the database.
$node = $this->drupalGetNodeByTitle($edit[$title_key]);
- $this->assertTrue($node, t('Node found in database.'));
+ $this->assertTrue($node, 'Node found in database.');
$assert = isset($node->body['en']) && !isset($node->body[LANGUAGE_NONE]) && $node->body['en'][0]['value'] == $body_value;
- $this->assertTrue($assert, t('Field language correctly set.'));
+ $this->assertTrue($assert, 'Field language correctly set.');
// Change node language.
$this->drupalGet("node/$node->nid/edit");
@@ -1876,20 +1876,20 @@ class LocaleMultilingualFieldsFunctionalTest extends DrupalWebTestCase {
);
$this->drupalPost(NULL, $edit, t('Save'));
$node = $this->drupalGetNodeByTitle($edit[$title_key]);
- $this->assertTrue($node, t('Node found in database.'));
+ $this->assertTrue($node, 'Node found in database.');
$assert = isset($node->body['it']) && !isset($node->body['en']) && $node->body['it'][0]['value'] == $body_value;
- $this->assertTrue($assert, t('Field language correctly changed.'));
+ $this->assertTrue($assert, 'Field language correctly changed.');
// Enable content language URL detection.
language_negotiation_set(LANGUAGE_TYPE_CONTENT, array(LOCALE_LANGUAGE_NEGOTIATION_URL => 0));
// Test multilingual field language fallback logic.
$this->drupalGet("it/node/$node->nid");
- $this->assertRaw($body_value, t('Body correctly displayed using Italian as requested language'));
+ $this->assertRaw($body_value, 'Body correctly displayed using Italian as requested language');
$this->drupalGet("node/$node->nid");
- $this->assertRaw($body_value, t('Body correctly displayed using English as requested language'));
+ $this->assertRaw($body_value, 'Body correctly displayed using English as requested language');
}
/*
@@ -1912,7 +1912,7 @@ class LocaleMultilingualFieldsFunctionalTest extends DrupalWebTestCase {
// Check that the node exists in the database.
$node = $this->drupalGetNodeByTitle($edit[$title_key]);
- $this->assertTrue($node, t('Node found in database.'));
+ $this->assertTrue($node, 'Node found in database.');
// Check if node body is showed.
$this->drupalGet("node/$node->nid");
@@ -1983,10 +1983,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/menu/menu.test b/modules/menu/menu.test
index d1b822699c4ca17ee6b5191a79ad704c5d58a3bf..a050fd90c29b0a0640e75edd64a49e399e9b675e 100644
--- a/modules/menu/menu.test
+++ b/modules/menu/menu.test
@@ -71,7 +71,7 @@ class MenuTestCase extends DrupalWebTestCase {
$item['options']['attributes']['title'] = $description;
menu_link_save($item);
$saved_item = menu_link_load($item['mlid']);
- $this->assertEqual($description, $saved_item['options']['attributes']['title'], t('Saving an existing link updates the description (title attribute)'));
+ $this->assertEqual($description, $saved_item['options']['attributes']['title'], 'Saving an existing link updates the description (title attribute)');
$this->resetMenuLink($item, $old_title);
}
@@ -112,14 +112,14 @@ class MenuTestCase extends DrupalWebTestCase {
// Assert the new menu.
$this->drupalGet('admin/structure/menu/manage/' . $menu_name . '/edit');
- $this->assertText($title, t('Custom menu was added.'));
+ $this->assertText($title, 'Custom menu was added.');
// Edit the menu.
$new_title = $this->randomName(16);
$menu['title'] = $new_title;
menu_save($menu);
$this->drupalGet('admin/structure/menu/manage/' . $menu_name . '/edit');
- $this->assertText($new_title, t('Custom menu was edited.'));
+ $this->assertText($new_title, 'Custom menu was edited.');
}
/**
@@ -140,7 +140,7 @@ class MenuTestCase extends DrupalWebTestCase {
$this->drupalPost('admin/structure/menu/add', $edit, t('Save'));
// Verify that using a menu_name that is too long results in a validation message.
- $this->assertText(format_plural(MENU_MAX_MENU_NAME_LENGTH_UI, "The menu name can't be longer than 1 character.", "The menu name can't be longer than @count characters."), t('Validation failed when menu name is too long.'));
+ $this->assertText(format_plural(MENU_MAX_MENU_NAME_LENGTH_UI, "The menu name can't be longer than 1 character.", "The menu name can't be longer than @count characters."), 'Validation failed when menu name is too long.');
// Change the menu_name so it no longer exceeds the maximum length.
$menu_name = substr(hash('sha256', $this->randomName(16)), 0, MENU_MAX_MENU_NAME_LENGTH_UI);
@@ -148,7 +148,7 @@ class MenuTestCase extends DrupalWebTestCase {
$this->drupalPost('admin/structure/menu/add', $edit, t('Save'));
// Verify that no validation error is given for menu_name length.
- $this->assertNoText(format_plural(MENU_MAX_MENU_NAME_LENGTH_UI, "The menu name can't be longer than 1 character.", "The menu name can't be longer than @count characters."), t('Validation failed when menu name is too long.'));
+ $this->assertNoText(format_plural(MENU_MAX_MENU_NAME_LENGTH_UI, "The menu name can't be longer than 1 character.", "The menu name can't be longer than @count characters."), 'Validation failed when menu name is too long.');
// Unlike most other modules, there is no confirmation message displayed.
$this->drupalGet('admin/structure/menu');
@@ -160,7 +160,7 @@ class MenuTestCase extends DrupalWebTestCase {
$edit['menu_' . $menu_name . '[region]'] = 'sidebar_first';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
$this->assertResponse(200);
- $this->assertText(t('The block settings have been updated.'), t('Custom menu block was enabled'));
+ $this->assertText(t('The block settings have been updated.'), 'Custom menu block was enabled');
return menu_load($menu_name);
}
@@ -177,11 +177,11 @@ class MenuTestCase extends DrupalWebTestCase {
// Delete custom menu.
$this->drupalPost("admin/structure/menu/manage/$menu_name/delete", array(), t('Delete'));
$this->assertResponse(200);
- $this->assertRaw(t('The custom menu %title has been deleted.', array('%title' => $title)), t('Custom menu was deleted'));
+ $this->assertRaw(t('The custom menu %title has been deleted.', array('%title' => $title)), 'Custom menu was deleted');
$this->assertFalse(menu_load($menu_name), 'Custom menu was deleted');
// Test if all menu links associated to the menu were removed from database.
$result = db_query("SELECT menu_name FROM {menu_links} WHERE menu_name = :menu_name", array(':menu_name' => $menu_name))->fetchField();
- $this->assertFalse($result, t('All menu links associated to the custom menu were deleted.'));
+ $this->assertFalse($result, 'All menu links associated to the custom menu were deleted.');
}
/**
@@ -220,7 +220,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Verify in the database.
$hidden = db_query("SELECT hidden FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $item1['mlid']))->fetchField();
- $this->assertEqual($hidden, 0, t('Link is not hidden in the database table when enabled via the overview form'));
+ $this->assertEqual($hidden, 0, 'Link is not hidden in the database table when enabled via the overview form');
// Save menu links for later tests.
$this->items[] = $item1;
@@ -238,13 +238,13 @@ class MenuTestCase extends DrupalWebTestCase {
$item = $this->addMenuLink(0, $path);
$this->drupalGet('admin/structure/menu/item/' . $item['mlid'] . '/edit');
- $this->assertFieldByName('link_path', $path, t('Path is found with both query and fragment.'));
+ $this->assertFieldByName('link_path', $path, 'Path is found with both query and fragment.');
// Now change the path to something without query and fragment.
$path = 'node';
$this->drupalPost('admin/structure/menu/item/' . $item['mlid'] . '/edit', array('link_path' => $path), t('Save'));
$this->drupalGet('admin/structure/menu/item/' . $item['mlid'] . '/edit');
- $this->assertFieldByName('link_path', $path, t('Path no longer has query or fragment.'));
+ $this->assertFieldByName('link_path', $path, 'Path no longer has query or fragment.');
}
/**
@@ -345,7 +345,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Verify menu link link.
$this->clickLink($title);
$title = $parent_node->title;
- $this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Parent menu link link target was correct'));
+ $this->assertTitle(t("@title | Drupal", array('@title' => $title)), 'Parent menu link link target was correct');
}
// Verify menu link.
@@ -355,7 +355,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Verify menu link link.
$this->clickLink($title);
$title = $item_node->title;
- $this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Menu link link target was correct'));
+ $this->assertTitle(t("@title | Drupal", array('@title' => $title)), 'Menu link link target was correct');
}
/**
@@ -394,7 +394,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Reset menu link.
$this->drupalPost("admin/structure/menu/item/$mlid/reset", array(), t('Reset'));
$this->assertResponse(200);
- $this->assertRaw(t('The menu link was reset to its default settings.'), t('Menu link was reset'));
+ $this->assertRaw(t('The menu link was reset to its default settings.'), 'Menu link was reset');
// Verify menu link.
$this->drupalGet('');
@@ -414,7 +414,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Delete menu link.
$this->drupalPost("admin/structure/menu/item/$mlid/delete", array(), t('Confirm'));
$this->assertResponse(200);
- $this->assertRaw(t('The menu link %title has been deleted.', array('%title' => $title)), t('Menu link was deleted'));
+ $this->assertRaw(t('The menu link %title has been deleted.', array('%title' => $title)), 'Menu link was deleted');
// Verify deletion.
$this->drupalGet('');
@@ -454,7 +454,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Unlike most other modules, there is no confirmation message displayed.
// Verify in the database.
$hidden = db_query("SELECT hidden FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $mlid))->fetchField();
- $this->assertEqual($hidden, 1, t('Link is hidden in the database table'));
+ $this->assertEqual($hidden, 1, 'Link is hidden in the database table');
}
/**
@@ -470,7 +470,7 @@ class MenuTestCase extends DrupalWebTestCase {
// Verify in the database.
$hidden = db_query("SELECT hidden FROM {menu_links} WHERE mlid = :mlid", array(':mlid' => $mlid))->fetchField();
- $this->assertEqual($hidden, 0, t('Link is not hidden in the database table'));
+ $this->assertEqual($hidden, 0, 'Link is not hidden in the database table');
}
/**
@@ -497,21 +497,21 @@ class MenuTestCase extends DrupalWebTestCase {
$this->drupalGet('admin/help/menu');
$this->assertResponse($response);
if ($response == 200) {
- $this->assertText(t('Menu'), t('Menu help was displayed'));
+ $this->assertText(t('Menu'), 'Menu help was displayed');
}
// View menu build overview node.
$this->drupalGet('admin/structure/menu');
$this->assertResponse($response);
if ($response == 200) {
- $this->assertText(t('Menus'), t('Menu build overview node was displayed'));
+ $this->assertText(t('Menus'), 'Menu build overview node was displayed');
}
// View navigation menu customization node.
$this->drupalGet('admin/structure/menu/manage/navigation');
- $this->assertResponse($response);
+ $this->assertResponse($response);
if ($response == 200) {
- $this->assertText(t('Navigation'), t('Navigation menu node was displayed'));
+ $this->assertText(t('Navigation'), 'Navigation menu node was displayed');
}
// View menu edit node.
@@ -519,21 +519,21 @@ class MenuTestCase extends DrupalWebTestCase {
$this->drupalGet('admin/structure/menu/item/' . $item['mlid'] . '/edit');
$this->assertResponse($response);
if ($response == 200) {
- $this->assertText(t('Edit menu item'), t('Menu edit node was displayed'));
+ $this->assertText(t('Edit menu item'), 'Menu edit node was displayed');
}
// View menu settings node.
$this->drupalGet('admin/structure/menu/settings');
$this->assertResponse($response);
if ($response == 200) {
- $this->assertText(t('Menus'), t('Menu settings node was displayed'));
+ $this->assertText(t('Menus'), 'Menu settings node was displayed');
}
// View add menu node.
$this->drupalGet('admin/structure/menu/add');
$this->assertResponse($response);
if ($response == 200) {
- $this->assertText(t('Menus'), t('Add menu node was displayed'));
+ $this->assertText(t('Menus'), 'Add menu node was displayed');
}
}
}
@@ -614,7 +614,7 @@ class MenuNodeTestCase extends DrupalWebTestCase {
$this->assertLink($node_title);
$this->drupalGet('node/' . $node->nid . '/edit');
- $this->assertOptionSelected('edit-menu-weight', 17, t('Menu weight correct in edit form'));
+ $this->assertOptionSelected('edit-menu-weight', 17, 'Menu weight correct in edit form');
// Edit the node and remove the menu link.
$edit = array(
diff --git a/modules/node/node.test b/modules/node/node.test
index f5d3aefe2d818abca25df921256f166f44b9902d..2a47eb78f69c9f2f9bd4e94e52d9fbc98a19aa16 100644
--- a/modules/node/node.test
+++ b/modules/node/node.test
@@ -31,53 +31,53 @@ class NodeLoadMultipleUnitTest extends DrupalWebTestCase {
// Confirm that promoted nodes appear in the default node listing.
$this->drupalGet('node');
- $this->assertText($node1->title, t('Node title appears on the default listing.'));
- $this->assertText($node2->title, t('Node title appears on the default listing.'));
- $this->assertNoText($node3->title, t('Node title does not appear in the default listing.'));
- $this->assertNoText($node4->title, t('Node title does not appear in the default listing.'));
+ $this->assertText($node1->title, 'Node title appears on the default listing.');
+ $this->assertText($node2->title, 'Node title appears on the default listing.');
+ $this->assertNoText($node3->title, 'Node title does not appear in the default listing.');
+ $this->assertNoText($node4->title, 'Node title does not appear in the default listing.');
// Load nodes with only a condition. Nodes 3 and 4 will be loaded.
$nodes = node_load_multiple(NULL, array('promote' => 0));
- $this->assertEqual($node3->title, $nodes[$node3->nid]->title, t('Node was loaded.'));
- $this->assertEqual($node4->title, $nodes[$node4->nid]->title, t('Node was loaded.'));
+ $this->assertEqual($node3->title, $nodes[$node3->nid]->title, 'Node was loaded.');
+ $this->assertEqual($node4->title, $nodes[$node4->nid]->title, 'Node was loaded.');
$count = count($nodes);
- $this->assertTrue($count == 2, t('@count nodes loaded.', array('@count' => $count)));
+ $this->assertTrue($count == 2, $count . ' nodes loaded.');
// Load nodes by nid. Nodes 1, 2 and 4 will be loaded.
$nodes = node_load_multiple(array(1, 2, 4));
$count = count($nodes);
- $this->assertTrue(count($nodes) == 3, t('@count nodes loaded', array('@count' => $count)));
- $this->assertTrue(isset($nodes[$node1->nid]), t('Node is correctly keyed in the array'));
- $this->assertTrue(isset($nodes[$node2->nid]), t('Node is correctly keyed in the array'));
- $this->assertTrue(isset($nodes[$node4->nid]), t('Node is correctly keyed in the array'));
+ $this->assertTrue(count($nodes) == 3, $count . ' nodes loaded');
+ $this->assertTrue(isset($nodes[$node1->nid]), 'Node is correctly keyed in the array');
+ $this->assertTrue(isset($nodes[$node2->nid]), 'Node is correctly keyed in the array');
+ $this->assertTrue(isset($nodes[$node4->nid]), 'Node is correctly keyed in the array');
foreach ($nodes as $node) {
- $this->assertTrue(is_object($node), t('Node is an object'));
+ $this->assertTrue(is_object($node), 'Node is an object');
}
// Load nodes by nid, where type = article. Nodes 1, 2 and 3 will be loaded.
$nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article'));
$count = count($nodes);
- $this->assertTrue($count == 3, t('@count nodes loaded', array('@count' => $count)));
- $this->assertEqual($nodes[$node1->nid]->title, $node1->title, t('Node successfully loaded.'));
- $this->assertEqual($nodes[$node2->nid]->title, $node2->title, t('Node successfully loaded.'));
- $this->assertEqual($nodes[$node3->nid]->title, $node3->title, t('Node successfully loaded.'));
+ $this->assertTrue($count == 3, $count . ' nodes loaded');
+ $this->assertEqual($nodes[$node1->nid]->title, $node1->title, 'Node successfully loaded.');
+ $this->assertEqual($nodes[$node2->nid]->title, $node2->title, 'Node successfully loaded.');
+ $this->assertEqual($nodes[$node3->nid]->title, $node3->title, 'Node successfully loaded.');
$this->assertFalse(isset($nodes[$node4->nid]));
// Now that all nodes have been loaded into the static cache, ensure that
// they are loaded correctly again when a condition is passed.
$nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article'));
$count = count($nodes);
- $this->assertTrue($count == 3, t('@count nodes loaded.', array('@count' => $count)));
- $this->assertEqual($nodes[$node1->nid]->title, $node1->title, t('Node successfully loaded'));
- $this->assertEqual($nodes[$node2->nid]->title, $node2->title, t('Node successfully loaded'));
- $this->assertEqual($nodes[$node3->nid]->title, $node3->title, t('Node successfully loaded'));
- $this->assertFalse(isset($nodes[$node4->nid]), t('Node was not loaded'));
+ $this->assertTrue($count == 3, $count . ' nodes loaded.');
+ $this->assertEqual($nodes[$node1->nid]->title, $node1->title, 'Node successfully loaded');
+ $this->assertEqual($nodes[$node2->nid]->title, $node2->title, 'Node successfully loaded');
+ $this->assertEqual($nodes[$node3->nid]->title, $node3->title, 'Node successfully loaded');
+ $this->assertFalse(isset($nodes[$node4->nid]), 'Node was not loaded');
// Load nodes by nid, where type = article and promote = 0.
$nodes = node_load_multiple(array(1, 2, 3, 4), array('type' => 'article', 'promote' => 0));
$count = count($nodes);
- $this->assertTrue($count == 1, t('@count node loaded', array('@count' => $count)));
- $this->assertEqual($nodes[$node3->nid]->title, $node3->title, t('Node successfully loaded.'));
+ $this->assertTrue($count == 1, $count . ' node loaded');
+ $this->assertEqual($nodes[$node3->nid]->title, $node3->title, 'Node successfully loaded.');
}
}
@@ -141,28 +141,28 @@ class NodeRevisionsTestCase extends DrupalWebTestCase {
// Confirm the correct revision text appears on "view revisions" page.
$this->drupalGet("node/$node->nid/revisions/$node->vid/view");
- $this->assertText($node->body[LANGUAGE_NONE][0]['value'], t('Correct text displays for version.'));
+ $this->assertText($node->body[LANGUAGE_NONE][0]['value'], 'Correct text displays for version.');
// Confirm the correct log message appears on "revisions overview" page.
$this->drupalGet("node/$node->nid/revisions");
foreach ($logs as $log) {
- $this->assertText($log, t('Log message found.'));
+ $this->assertText($log, 'Log message found.');
}
// Confirm that revisions revert properly.
$this->drupalPost("node/$node->nid/revisions/{$nodes[1]->vid}/revert", array(), t('Revert'));
$this->assertRaw(t('@type %title has been reverted back to the revision from %revision-date.',
array('@type' => 'Basic page', '%title' => $nodes[1]->title,
- '%revision-date' => format_date($nodes[1]->revision_timestamp))), t('Revision reverted.'));
+ '%revision-date' => format_date($nodes[1]->revision_timestamp))), 'Revision reverted.');
$reverted_node = node_load($node->nid);
- $this->assertTrue(($nodes[1]->body[LANGUAGE_NONE][0]['value'] == $reverted_node->body[LANGUAGE_NONE][0]['value']), t('Node reverted correctly.'));
+ $this->assertTrue(($nodes[1]->body[LANGUAGE_NONE][0]['value'] == $reverted_node->body[LANGUAGE_NONE][0]['value']), 'Node reverted correctly.');
// Confirm revisions delete properly.
$this->drupalPost("node/$node->nid/revisions/{$nodes[1]->vid}/delete", array(), t('Delete'));
$this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.',
array('%revision-date' => format_date($nodes[1]->revision_timestamp),
- '@type' => 'Basic page', '%title' => $nodes[1]->title)), t('Revision deleted.'));
- $this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid and vid = :vid', array(':nid' => $node->nid, ':vid' => $nodes[1]->vid))->fetchField() == 0, t('Revision not found.'));
+ '@type' => 'Basic page', '%title' => $nodes[1]->title)), 'Revision deleted.');
+ $this->assertTrue(db_query('SELECT COUNT(vid) FROM {node_revision} WHERE nid = :nid and vid = :vid', array(':nid' => $node->nid, ':vid' => $nodes[1]->vid))->fetchField() == 0, 'Revision not found.');
}
/**
@@ -188,9 +188,9 @@ class NodeRevisionsTestCase extends DrupalWebTestCase {
);
node_save($updated_node);
$this->drupalGet('node/' . $node->nid);
- $this->assertText($new_title, t('New node title appears on the page.'));
+ $this->assertText($new_title, 'New node title appears on the page.');
$node_revision = node_load($node->nid, NULL, TRUE);
- $this->assertEqual($node_revision->log, $log, t('After an existing node revision is re-saved without a log message, the original log message is preserved.'));
+ $this->assertEqual($node_revision->log, $log, 'After an existing node revision is re-saved without a log message, the original log message is preserved.');
// Create another node with an initial log message.
$node = $this->drupalCreateNode(array('log' => $log));
@@ -250,20 +250,20 @@ class PageEditTestCase extends DrupalWebTestCase {
// Check that the node exists in the database.
$node = $this->drupalGetNodeByTitle($edit[$title_key]);
- $this->assertTrue($node, t('Node found in database.'));
+ $this->assertTrue($node, 'Node found in database.');
// Check that "edit" link points to correct page.
$this->clickLink(t('Edit'));
$edit_url = url("node/$node->nid/edit", array('absolute' => TRUE));
$actual_url = $this->getURL();
- $this->assertEqual($edit_url, $actual_url, t('On edit page.'));
+ $this->assertEqual($edit_url, $actual_url, 'On edit page.');
// Check that the title and body fields are displayed with the correct values.
$active = '' . t('(active tab)') . '';
$link_text = t('!local-task-title!active', array('!local-task-title' => t('Edit'), '!active' => $active));
- $this->assertText(strip_tags($link_text), 0, t('Edit tab found and marked active.'));
- $this->assertFieldByName($title_key, $edit[$title_key], t('Title field displayed.'));
- $this->assertFieldByName($body_key, $edit[$body_key], t('Body field displayed.'));
+ $this->assertText(strip_tags($link_text), 0, 'Edit tab found and marked active.');
+ $this->assertFieldByName($title_key, $edit[$title_key], 'Title field displayed.');
+ $this->assertFieldByName($body_key, $edit[$body_key], 'Body field displayed.');
// Edit the content of the node.
$edit = array();
@@ -273,8 +273,8 @@ class PageEditTestCase extends DrupalWebTestCase {
$this->drupalPost(NULL, $edit, t('Save'));
// Check that the title and body fields are displayed with the updated values.
- $this->assertText($edit[$title_key], t('Title displayed.'));
- $this->assertText($edit[$body_key], t('Body displayed.'));
+ $this->assertText($edit[$title_key], 'Title displayed.');
+ $this->assertText($edit[$body_key], 'Body displayed.');
// Login as a second administrator user.
$second_web_user = $this->drupalCreateUser(array('administer nodes', 'edit any page content'));
@@ -377,13 +377,13 @@ class PagePreviewTestCase extends DrupalWebTestCase {
$this->drupalPost('node/add/page', $edit, t('Preview'));
// Check that the preview is displaying the title and body.
- $this->assertTitle(t('Preview | Drupal'), t('Basic page title is preview.'));
- $this->assertText($edit[$title_key], t('Title displayed.'));
- $this->assertText($edit[$body_key], t('Body displayed.'));
+ $this->assertTitle(t('Preview | Drupal'), 'Basic page title is preview.');
+ $this->assertText($edit[$title_key], 'Title displayed.');
+ $this->assertText($edit[$body_key], 'Body displayed.');
// Check that the title and body fields are displayed with the correct values.
- $this->assertFieldByName($title_key, $edit[$title_key], t('Title field displayed.'));
- $this->assertFieldByName($body_key, $edit[$body_key], t('Body field displayed.'));
+ $this->assertFieldByName($title_key, $edit[$title_key], 'Title field displayed.');
+ $this->assertFieldByName($body_key, $edit[$body_key], 'Body field displayed.');
}
/**
@@ -404,16 +404,16 @@ class PagePreviewTestCase extends DrupalWebTestCase {
$this->drupalPost('node/add/page', $edit, t('Preview'));
// Check that the preview is displaying the title and body.
- $this->assertTitle(t('Preview | Drupal'), t('Basic page title is preview.'));
- $this->assertText($edit[$title_key], t('Title displayed.'));
- $this->assertText($edit[$body_key], t('Body displayed.'));
+ $this->assertTitle(t('Preview | Drupal'), 'Basic page title is preview.');
+ $this->assertText($edit[$title_key], 'Title displayed.');
+ $this->assertText($edit[$body_key], 'Body displayed.');
// Check that the title and body fields are displayed with the correct values.
- $this->assertFieldByName($title_key, $edit[$title_key], t('Title field displayed.'));
- $this->assertFieldByName($body_key, $edit[$body_key], t('Body field displayed.'));
+ $this->assertFieldByName($title_key, $edit[$title_key], 'Title field displayed.');
+ $this->assertFieldByName($body_key, $edit[$body_key], 'Body field displayed.');
// Check that the log field has the correct value.
- $this->assertFieldByName('log', $edit['log'], t('Log field displayed.'));
+ $this->assertFieldByName('log', $edit['log'], 'Log field displayed.');
}
}
@@ -446,11 +446,11 @@ class NodeCreationTestCase extends DrupalWebTestCase {
$this->drupalPost('node/add/page', $edit, t('Save'));
// Check that the Basic page has been created.
- $this->assertRaw(t('!post %title has been created.', array('!post' => 'Basic page', '%title' => $edit["title"])), t('Basic page created.'));
+ $this->assertRaw(t('!post %title has been created.', array('!post' => 'Basic page', '%title' => $edit["title"])), 'Basic page created.');
// Check that the node exists in the database.
$node = $this->drupalGetNodeByTitle($edit["title"]);
- $this->assertTrue($node, t('Node found in database.'));
+ $this->assertTrue($node, 'Node found in database.');
}
/**
@@ -468,30 +468,30 @@ class NodeCreationTestCase extends DrupalWebTestCase {
try {
node_save((object) $edit);
- $this->fail(t('Expected exception has not been thrown.'));
+ $this->fail('Expected exception has not been thrown.');
}
catch (Exception $e) {
- $this->pass(t('Expected exception has been thrown.'));
+ $this->pass('Expected exception has been thrown.');
}
if (Database::getConnection()->supportsTransactions()) {
// Check that the node does not exist in the database.
$node = $this->drupalGetNodeByTitle($edit['title']);
- $this->assertFalse($node, t('Transactions supported, and node not found in database.'));
+ $this->assertFalse($node, 'Transactions supported, and node not found in database.');
}
else {
// Check that the node exists in the database.
$node = $this->drupalGetNodeByTitle($edit['title']);
- $this->assertTrue($node, t('Transactions not supported, and node found in database.'));
+ $this->assertTrue($node, 'Transactions not supported, and node found in database.');
// Check that the failed rollback was logged.
$records = db_query("SELECT wid FROM {watchdog} WHERE message LIKE 'Explicit rollback failed%'")->fetchAll();
- $this->assertTrue(count($records) > 0, t('Transactions not supported, and rollback error logged to watchdog.'));
+ $this->assertTrue(count($records) > 0, 'Transactions not supported, and rollback error logged to watchdog.');
}
// Check that the rollback error was logged.
$records = db_query("SELECT wid FROM {watchdog} WHERE variables LIKE '%Test exception for rollback.%'")->fetchAll();
- $this->assertTrue(count($records) > 0, t('Rollback explanatory error logged to watchdog.'));
+ $this->assertTrue(count($records) > 0, 'Rollback explanatory error logged to watchdog.');
}
}
@@ -510,7 +510,7 @@ class PageViewTestCase extends DrupalWebTestCase {
function testPageView() {
// Create a node to view.
$node = $this->drupalCreateNode();
- $this->assertTrue(node_load($node->nid), t('Node created.'));
+ $this->assertTrue(node_load($node->nid), 'Node created.');
// Try to edit with anonymous user.
$html = $this->drupalGet("node/$node->nid/edit");
@@ -553,7 +553,7 @@ class SummaryLengthTestCase extends DrupalWebTestCase {
'promote' => 1,
);
$node = $this->drupalCreateNode($settings);
- $this->assertTrue(node_load($node->nid), t('Node created.'));
+ $this->assertTrue(node_load($node->nid), 'Node created.');
// Create user with permission to view the node.
$web_user = $this->drupalCreateUser(array('access content', 'administer content types'));
@@ -563,16 +563,16 @@ class SummaryLengthTestCase extends DrupalWebTestCase {
$this->drupalGet("node");
// The node teaser when it has 600 characters in length
$expected = 'What is a Drupalism?';
- $this->assertRaw($expected, t('Check that the summary is 600 characters in length'), 'Node');
+ $this->assertRaw($expected, 'Check that the summary is 600 characters in length', 'Node');
// Edit the teaser length for "Basic page" content type
- $edit = array (
+ $edit = array(
'teaser_length' => 200,
);
$this->drupalPost('admin/structure/types/manage/page', $edit, t('Save content type'));
// Attempt to access the front page again and check if the summary is now only 200 characters in length.
$this->drupalGet("node");
- $this->assertNoRaw($expected, t('Check that the summary is not longer than 200 characters'), 'Node');
+ $this->assertNoRaw($expected, 'Check that the summary is not longer than 200 characters', 'Node');
}
}
@@ -595,18 +595,18 @@ class NodeTitleXSSTestCase extends DrupalWebTestCase {
$edit = array("title" => $title);
$this->drupalPost('node/add/page', $edit, t('Preview'));
- $this->assertNoRaw($xss, t('Harmful tags are escaped when previewing a node.'));
+ $this->assertNoRaw($xss, 'Harmful tags are escaped when previewing a node.');
$settings = array('title' => $title);
$node = $this->drupalCreateNode($settings);
$this->drupalGet('node/' . $node->nid);
// assertTitle() decodes HTML-entities inside the element.
- $this->assertTitle($edit["title"] . ' | Drupal', t('Title is diplayed when viewing a node.'));
- $this->assertNoRaw($xss, t('Harmful tags are escaped when viewing a node.'));
+ $this->assertTitle($edit["title"] . ' | Drupal', 'Title is diplayed when viewing a node.');
+ $this->assertNoRaw($xss, 'Harmful tags are escaped when viewing a node.');
$this->drupalGet('node/' . $node->nid . '/edit');
- $this->assertNoRaw($xss, t('Harmful tags are escaped when editing a node.'));
+ $this->assertNoRaw($xss, 'Harmful tags are escaped when editing a node.');
}
}
@@ -630,13 +630,13 @@ class NodeBlockTestCase extends DrupalWebTestCase {
function testSearchFormBlock() {
// Set block title to confirm that the interface is available.
$this->drupalPost('admin/structure/block/manage/node/syndicate/configure', array('title' => $this->randomName(8)), t('Save block'));
- $this->assertText(t('The block configuration has been saved.'), t('Block configuration set.'));
+ $this->assertText(t('The block configuration has been saved.'), 'Block configuration set.');
// Set the block to a region to confirm block is available.
$edit = array();
$edit['node_syndicate[region]'] = 'footer';
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
- $this->assertText(t('The block settings have been updated.'), t('Block successfully move to footer region.'));
+ $this->assertText(t('The block settings have been updated.'), 'Block successfully move to footer region.');
}
}
@@ -679,7 +679,7 @@ class NodePostSettingsTestCase extends DrupalWebTestCase {
// Check that the post information is displayed.
$node = $this->drupalGetNodeByTitle($edit["title"]);
$elements = $this->xpath('//div[contains(@class,:class)]', array(':class' => 'submitted'));
- $this->assertEqual(count($elements), 1, t('Post information is displayed.'));
+ $this->assertEqual(count($elements), 1, 'Post information is displayed.');
}
/**
@@ -701,7 +701,7 @@ class NodePostSettingsTestCase extends DrupalWebTestCase {
// Check that the post information is displayed.
$node = $this->drupalGetNodeByTitle($edit["title"]);
- $this->assertNoRaw('', t('Post information is not displayed.'));
+ $this->assertNoRaw('', 'Post information is not displayed.');
}
}
@@ -744,12 +744,12 @@ class NodeRSSContentTestCase extends DrupalWebTestCase {
// Check that content added in 'rss' view mode appear in RSS feed.
$rss_only_content = t('Extra data that should appear only in the RSS feed for node !nid.', array('!nid' => $node->nid));
- $this->assertText($rss_only_content, t('Node content designated for RSS appear in RSS feed.'));
+ $this->assertText($rss_only_content, 'Node content designated for RSS appear in RSS feed.');
// Check that content added in view modes other than 'rss' doesn't
// appear in RSS feed.
$non_rss_content = t('Extra data that should appear everywhere except the RSS feed for node !nid.', array('!nid' => $node->nid));
- $this->assertNoText($non_rss_content, t('Node content not designed for RSS doesn\'t appear in RSS feed.'));
+ $this->assertNoText($non_rss_content, 'Node content not designed for RSS doesn\'t appear in RSS feed.');
// Check that extra RSS elements and namespaces are added to RSS feed.
$test_element = array(
@@ -757,13 +757,13 @@ class NodeRSSContentTestCase extends DrupalWebTestCase {
'value' => t('Value of testElement RSS element for node !nid.', array('!nid' => $node->nid)),
);
$test_ns = 'xmlns:drupaltest="http://example.com/test-namespace"';
- $this->assertRaw(format_xml_elements(array($test_element)), t('Extra RSS elements appear in RSS feed.'));
- $this->assertRaw($test_ns, t('Extra namespaces appear in RSS feed.'));
+ $this->assertRaw(format_xml_elements(array($test_element)), 'Extra RSS elements appear in RSS feed.');
+ $this->assertRaw($test_ns, 'Extra namespaces appear in RSS feed.');
// Check that content added in 'rss' view mode doesn't appear when
// viewing node.
$this->drupalGet("node/$node->nid");
- $this->assertNoText($rss_only_content, t('Node content designed for RSS doesn\'t appear when viewing node.'));
+ $this->assertNoText($rss_only_content, 'Node content designed for RSS doesn\'t appear when viewing node.');
}
}
@@ -860,44 +860,44 @@ class NodeAccessRecordsUnitTest extends DrupalWebTestCase {
function testNodeAccessRecords() {
// Create an article node.
$node1 = $this->drupalCreateNode(array('type' => 'article'));
- $this->assertTrue(node_load($node1->nid), t('Article node created.'));
+ $this->assertTrue(node_load($node1->nid), 'Article node created.');
// Check to see if grants added by node_test_node_access_records made it in.
$records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node1->nid))->fetchAll();
- $this->assertEqual(count($records), 1, t('Returned the correct number of rows.'));
- $this->assertEqual($records[0]->realm, 'test_article_realm', t('Grant with article_realm acquired for node without alteration.'));
- $this->assertEqual($records[0]->gid, 1, t('Grant with gid = 1 acquired for node without alteration.'));
+ $this->assertEqual(count($records), 1, 'Returned the correct number of rows.');
+ $this->assertEqual($records[0]->realm, 'test_article_realm', 'Grant with article_realm acquired for node without alteration.');
+ $this->assertEqual($records[0]->gid, 1, 'Grant with gid = 1 acquired for node without alteration.');
// Create an unpromoted "Basic page" node.
$node2 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 0));
- $this->assertTrue(node_load($node1->nid), t('Unpromoted basic page node created.'));
+ $this->assertTrue(node_load($node1->nid), 'Unpromoted basic page node created.');
// Check to see if grants added by node_test_node_access_records made it in.
$records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node2->nid))->fetchAll();
- $this->assertEqual(count($records), 1, t('Returned the correct number of rows.'));
- $this->assertEqual($records[0]->realm, 'test_page_realm', t('Grant with page_realm acquired for node without alteration.'));
- $this->assertEqual($records[0]->gid, 1, t('Grant with gid = 1 acquired for node without alteration.'));
+ $this->assertEqual(count($records), 1, 'Returned the correct number of rows.');
+ $this->assertEqual($records[0]->realm, 'test_page_realm', 'Grant with page_realm acquired for node without alteration.');
+ $this->assertEqual($records[0]->gid, 1, 'Grant with gid = 1 acquired for node without alteration.');
// Create an unpromoted, unpublished "Basic page" node.
$node3 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 0, 'status' => 0));
- $this->assertTrue(node_load($node3->nid), t('Unpromoted, unpublished basic page node created.'));
+ $this->assertTrue(node_load($node3->nid), 'Unpromoted, unpublished basic page node created.');
// Check to see if grants added by node_test_node_access_records made it in.
$records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node3->nid))->fetchAll();
- $this->assertEqual(count($records), 1, t('Returned the correct number of rows.'));
- $this->assertEqual($records[0]->realm, 'test_page_realm', t('Grant with page_realm acquired for node without alteration.'));
- $this->assertEqual($records[0]->gid, 1, t('Grant with gid = 1 acquired for node without alteration.'));
+ $this->assertEqual(count($records), 1, 'Returned the correct number of rows.');
+ $this->assertEqual($records[0]->realm, 'test_page_realm', 'Grant with page_realm acquired for node without alteration.');
+ $this->assertEqual($records[0]->gid, 1, 'Grant with gid = 1 acquired for node without alteration.');
// Create a promoted "Basic page" node.
$node4 = $this->drupalCreateNode(array('type' => 'page', 'promote' => 1));
- $this->assertTrue(node_load($node4->nid), t('Promoted basic page node created.'));
+ $this->assertTrue(node_load($node4->nid), 'Promoted basic page node created.');
// Check to see if grant added by node_test_node_access_records was altered
// by node_test_node_access_records_alter.
$records = db_query('SELECT realm, gid FROM {node_access} WHERE nid = :nid', array(':nid' => $node4->nid))->fetchAll();
- $this->assertEqual(count($records), 1, t('Returned the correct number of rows.'));
- $this->assertEqual($records[0]->realm, 'test_alter_realm', t('Altered grant with alter_realm acquired for node.'));
- $this->assertEqual($records[0]->gid, 2, t('Altered grant with gid = 2 acquired for node.'));
+ $this->assertEqual(count($records), 1, 'Returned the correct number of rows.');
+ $this->assertEqual($records[0]->realm, 'test_alter_realm', 'Altered grant with alter_realm acquired for node.');
+ $this->assertEqual($records[0]->gid, 2, 'Altered grant with gid = 2 acquired for node.');
// Check to see if we can alter grants with hook_node_grants_alter().
$operations = array('view', 'update', 'delete');
@@ -907,7 +907,7 @@ class NodeAccessRecordsUnitTest extends DrupalWebTestCase {
$grants = node_test_node_grants($op, $web_user);
$altered_grants = $grants;
drupal_alter('node_grants', $altered_grants, $web_user, $op);
- $this->assertNotEqual($grants, $altered_grants, t('Altered the %op grant for a user.', array('%op' => $op)));
+ $this->assertNotEqual($grants, $altered_grants, 'Altered the ' . $op . ' grant for a user.');
}
}
}
@@ -956,15 +956,15 @@ class NodeSaveTestCase extends DrupalWebTestCase {
$node = node_submit((object) $node);
// Verify that node_submit did not overwrite the user ID.
- $this->assertEqual($node->uid, $this->web_user->uid, t('Function node_submit() preserves user ID'));
+ $this->assertEqual($node->uid, $this->web_user->uid, 'Function node_submit() preserves user ID');
node_save($node);
// Test the import.
$node_by_nid = node_load($test_nid);
- $this->assertTrue($node_by_nid, t('Node load by node ID.'));
+ $this->assertTrue($node_by_nid, 'Node load by node ID.');
$node_by_title = $this->drupalGetNodeByTitle($title);
- $this->assertTrue($node_by_title, t('Node load by node title.'));
+ $this->assertTrue($node_by_title, 'Node load by node title.');
}
/**
@@ -981,8 +981,8 @@ class NodeSaveTestCase extends DrupalWebTestCase {
node_save((object) $edit);
$node = $this->drupalGetNodeByTitle($edit['title']);
- $this->assertEqual($node->created, REQUEST_TIME, t('Creating a node sets default "created" timestamp.'));
- $this->assertEqual($node->changed, REQUEST_TIME, t('Creating a node sets default "changed" timestamp.'));
+ $this->assertEqual($node->created, REQUEST_TIME, 'Creating a node sets default "created" timestamp.');
+ $this->assertEqual($node->changed, REQUEST_TIME, 'Creating a node sets default "changed" timestamp.');
// Store the timestamps.
$created = $node->created;
@@ -990,15 +990,15 @@ class NodeSaveTestCase extends DrupalWebTestCase {
node_save($node);
$node = $this->drupalGetNodeByTitle($edit['title']);
- $this->assertEqual($node->created, $created, t('Updating a node preserves "created" timestamp.'));
+ $this->assertEqual($node->created, $created, 'Updating a node preserves "created" timestamp.');
// Programmatically set the timestamps using hook_node_presave.
$node->title = 'testing_node_presave';
node_save($node);
$node = $this->drupalGetNodeByTitle('testing_node_presave');
- $this->assertEqual($node->created, 280299600, t('Saving a node uses "created" timestamp set in presave hook.'));
- $this->assertEqual($node->changed, 979534800, t('Saving a node uses "changed" timestamp set in presave hook.'));
+ $this->assertEqual($node->created, 280299600, 'Saving a node uses "created" timestamp set in presave hook.');
+ $this->assertEqual($node->changed, 979534800, 'Saving a node uses "changed" timestamp set in presave hook.');
// Programmatically set the timestamps on the node.
$edit = array(
@@ -1011,8 +1011,8 @@ class NodeSaveTestCase extends DrupalWebTestCase {
node_save((object) $edit);
$node = $this->drupalGetNodeByTitle($edit['title']);
- $this->assertEqual($node->created, 280299600, t('Creating a node uses user-set "created" timestamp.'));
- $this->assertNotEqual($node->changed, 979534800, t('Creating a node doesn\'t use user-set "changed" timestamp.'));
+ $this->assertEqual($node->created, 280299600, 'Creating a node uses user-set "created" timestamp.');
+ $this->assertNotEqual($node->changed, 979534800, 'Creating a node doesn\'t use user-set "changed" timestamp.');
// Update the timestamps.
$node->created = 979534800;
@@ -1020,8 +1020,8 @@ class NodeSaveTestCase extends DrupalWebTestCase {
node_save($node);
$node = $this->drupalGetNodeByTitle($edit['title']);
- $this->assertEqual($node->created, 979534800, t('Updating a node uses user-set "created" timestamp.'));
- $this->assertNotEqual($node->changed, 280299600, t('Updating a node doesn\'t use user-set "changed" timestamp.'));
+ $this->assertEqual($node->created, 979534800, 'Updating a node uses user-set "created" timestamp.');
+ $this->assertNotEqual($node->changed, 280299600, 'Updating a node doesn\'t use user-set "changed" timestamp.');
}
}
@@ -1046,14 +1046,14 @@ class NodeTypeTestCase extends DrupalWebTestCase {
$node_types = node_type_get_types();
$node_names = node_type_get_names();
- $this->assertTrue(isset($node_types['article']), t('Node type article is available.'));
- $this->assertTrue(isset($node_types['page']), t('Node type basic page is available.'));
+ $this->assertTrue(isset($node_types['article']), 'Node type article is available.');
+ $this->assertTrue(isset($node_types['page']), 'Node type basic page is available.');
- $this->assertEqual($node_types['article']->name, $node_names['article'], t('Correct node type base has been returned.'));
+ $this->assertEqual($node_types['article']->name, $node_names['article'], 'Correct node type base has been returned.');
- $this->assertEqual($node_types['article'], node_type_get_type('article'), t('Correct node type has been returned.'));
- $this->assertEqual($node_types['article']->name, node_type_get_name('article'), t('Correct node type name has been returned.'));
- $this->assertEqual($node_types['page']->base, node_type_get_base('page'), t('Correct node type base has been returned.'));
+ $this->assertEqual($node_types['article'], node_type_get_type('article'), 'Correct node type has been returned.');
+ $this->assertEqual($node_types['article']->name, node_type_get_name('article'), 'Correct node type name has been returned.');
+ $this->assertEqual($node_types['page']->base, node_type_get_base('page'), 'Correct node type base has been returned.');
}
/**
@@ -1072,7 +1072,7 @@ class NodeTypeTestCase extends DrupalWebTestCase {
$this->drupalGet('node/add/' . str_replace('_', '-', $type->name));
$this->assertResponse(200, 'The new content type can be accessed at node/add.');
-
+
// Create a content type via the user interface.
$web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types'));
$this->drupalLogin($web_user);
@@ -1094,12 +1094,12 @@ class NodeTypeTestCase extends DrupalWebTestCase {
$this->drupalLogin($web_user);
$instance = field_info_instance('node', 'body', 'page');
- $this->assertEqual($instance['label'], 'Body', t('Body field was found.'));
+ $this->assertEqual($instance['label'], 'Body', 'Body field was found.');
// Verify that title and body fields are displayed.
$this->drupalGet('node/add/page');
- $this->assertRaw('Title', t('Title field was found.'));
- $this->assertRaw('Body', t('Body field was found.'));
+ $this->assertRaw('Title', 'Title field was found.');
+ $this->assertRaw('Body', 'Body field was found.');
// Rename the title field.
$edit = array(
@@ -1110,8 +1110,8 @@ class NodeTypeTestCase extends DrupalWebTestCase {
field_info_cache_clear();
$this->drupalGet('node/add/page');
- $this->assertRaw('Foo', t('New title label was displayed.'));
- $this->assertNoRaw('Title', t('Old title label was not displayed.'));
+ $this->assertRaw('Foo', 'New title label was displayed.');
+ $this->assertNoRaw('Title', 'Old title label was not displayed.');
// Change the name, machine name and description.
$edit = array(
@@ -1123,12 +1123,12 @@ class NodeTypeTestCase extends DrupalWebTestCase {
field_info_cache_clear();
$this->drupalGet('node/add');
- $this->assertRaw('Bar', t('New name was displayed.'));
- $this->assertRaw('Lorem ipsum', t('New description was displayed.'));
+ $this->assertRaw('Bar', 'New name was displayed.');
+ $this->assertRaw('Lorem ipsum', 'New description was displayed.');
$this->clickLink('Bar');
- $this->assertEqual(url('node/add/bar', array('absolute' => TRUE)), $this->getUrl(), t('New machine name was used in URL.'));
- $this->assertRaw('Foo', t('Title field was found.'));
- $this->assertRaw('Body', t('Body field was found.'));
+ $this->assertEqual(url('node/add/bar', array('absolute' => TRUE)), $this->getUrl(), 'New machine name was used in URL.');
+ $this->assertRaw('Foo', 'Title field was found.');
+ $this->assertRaw('Body', 'Body field was found.');
// Remove the body field.
$this->drupalPost('admin/structure/types/manage/bar/fields/body/delete', NULL, t('Delete'));
@@ -1136,7 +1136,7 @@ class NodeTypeTestCase extends DrupalWebTestCase {
$this->drupalPost('admin/structure/types/manage/bar', array(), t('Save content type'));
// Check that the body field doesn't exist.
$this->drupalGet('node/add/bar');
- $this->assertNoRaw('Body', t('Body field was not found.'));
+ $this->assertNoRaw('Body', 'Body field was not found.');
}
}
@@ -1216,7 +1216,7 @@ class NodeAdminTestCase extends DrupalWebTestCase {
$this->assertLinkByHref('node/' . $node->nid . '/edit');
$this->assertLinkByHref('node/' . $node->nid . '/delete');
// Verify tableselect.
- $this->assertFieldByName('nodes[' . $node->nid . ']', '', t('Tableselect found.'));
+ $this->assertFieldByName('nodes[' . $node->nid . ']', '', 'Tableselect found.');
}
// Verify filtering by publishing status.
@@ -1224,7 +1224,7 @@ class NodeAdminTestCase extends DrupalWebTestCase {
'status' => 'status-1',
);
$this->drupalPost(NULL, $edit, t('Filter'));
- $this->assertRaw(t('%type is %value', array('%type' => t('status'), '%value' => t('published'))), t('Content list is filtered by status.'));
+ $this->assertRaw(t('%type is %value', array('%type' => t('status'), '%value' => t('published'))), 'Content list is filtered by status.');
$this->assertLinkByHref('node/' . $nodes['published_page']->nid . '/edit');
$this->assertLinkByHref('node/' . $nodes['published_article']->nid . '/edit');
$this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid . '/edit');
@@ -1234,8 +1234,8 @@ class NodeAdminTestCase extends DrupalWebTestCase {
'type' => 'page',
);
$this->drupalPost(NULL, $edit, t('Refine'));
- $this->assertRaw(t('%type is %value', array('%type' => t('status'), '%value' => t('published'))), t('Content list is filtered by status.'));
- $this->assertRaw(t('%type is %value', array('%type' => t('type'), '%value' => 'Basic page')), t('Content list is filtered by content type.'));
+ $this->assertRaw(t('%type is %value', array('%type' => t('status'), '%value' => t('published'))), 'Content list is filtered by status.');
+ $this->assertRaw(t('%type is %value', array('%type' => t('type'), '%value' => 'Basic page')), 'Content list is filtered by content type.');
$this->assertLinkByHref('node/' . $nodes['published_page']->nid . '/edit');
$this->assertNoLinkByHref('node/' . $nodes['published_article']->nid . '/edit');
@@ -1257,7 +1257,7 @@ class NodeAdminTestCase extends DrupalWebTestCase {
$this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid . '/delete');
// Verify no tableselect.
- $this->assertNoFieldByName('nodes[' . $nodes['published_page']->nid . ']', '', t('No tableselect found.'));
+ $this->assertNoFieldByName('nodes[' . $nodes['published_page']->nid . ']', '', 'No tableselect found.');
// Verify unpublished content is displayed with permission.
$this->drupalLogout();
@@ -1275,7 +1275,7 @@ class NodeAdminTestCase extends DrupalWebTestCase {
$this->assertNoLinkByHref('node/' . $nodes['unpublished_page_1']->nid . '/delete');
// Verify no tableselect.
- $this->assertNoFieldByName('nodes[' . $nodes['unpublished_page_2']->nid . ']', '', t('No tableselect found.'));
+ $this->assertNoFieldByName('nodes[' . $nodes['unpublished_page_2']->nid . ']', '', 'No tableselect found.');
// Verify node access can be bypassed.
$this->drupalLogout();
@@ -1325,7 +1325,7 @@ class NodeTitleTestCase extends DrupalWebTestCase {
// Test tag.
$this->drupalGet("node/$node->nid");
$xpath = '//title';
- $this->assertEqual(current($this->xpath($xpath)), $node->title .' | Drupal', 'Page title is equal to node title.', 'Node');
+ $this->assertEqual(current($this->xpath($xpath)), $node->title . ' | Drupal', 'Page title is equal to node title.', 'Node');
// Test breadcrumb in comment preview.
$this->drupalGet("comment/reply/$node->nid");
@@ -1401,7 +1401,7 @@ class NodeBlockFunctionalTest extends DrupalWebTestCase {
'node_recent[region]' => 'sidebar_first',
);
$this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
- $this->assertText(t('The block settings have been updated.'), t('Block saved to first sidebar region.'));
+ $this->assertText(t('The block settings have been updated.'), 'Block saved to first sidebar region.');
// Set block title and variables.
$block = array(
@@ -1409,11 +1409,11 @@ class NodeBlockFunctionalTest extends DrupalWebTestCase {
'node_recent_block_count' => 2,
);
$this->drupalPost('admin/structure/block/manage/node/recent/configure', $block, t('Save block'));
- $this->assertText(t('The block configuration has been saved.'), t('Block saved.'));
+ $this->assertText(t('The block configuration has been saved.'), 'Block saved.');
// Test that block is not visible without nodes
$this->drupalGet('');
- $this->assertText(t('No content available.'), t('Block with "No content available." found.'));
+ $this->assertText(t('No content available.'), 'Block with "No content available." found.');
// Add some test nodes.
$default_settings = array('uid' => $this->web_user->uid, 'type' => 'article');
@@ -1439,16 +1439,16 @@ class NodeBlockFunctionalTest extends DrupalWebTestCase {
// see the block.
$this->drupalLogout();
$this->drupalGet('');
- $this->assertNoText($block['title'], t('Block was not found.'));
+ $this->assertNoText($block['title'], 'Block was not found.');
// Test that only the 2 latest nodes are shown.
$this->drupalLogin($this->web_user);
- $this->assertNoText($node1->title, t('Node not found in block.'));
- $this->assertText($node2->title, t('Node found in block.'));
- $this->assertText($node3->title, t('Node found in block.'));
+ $this->assertNoText($node1->title, 'Node not found in block.');
+ $this->assertText($node2->title, 'Node found in block.');
+ $this->assertText($node3->title, 'Node found in block.');
// Check to make sure nodes are in the right order.
- $this->assertTrue($this->xpath('//div[@id="block-node-recent"]/div/table/tbody/tr[position() = 1]/td/div/a[text() = "' . $node3->title . '"]'), t('Nodes were ordered correctly in block.'));
+ $this->assertTrue($this->xpath('//div[@id="block-node-recent"]/div/table/tbody/tr[position() = 1]/td/div/a[text() = "' . $node3->title . '"]'), 'Nodes were ordered correctly in block.');
// Set the number of recent nodes to show to 10.
$this->drupalLogout();
@@ -1457,17 +1457,17 @@ class NodeBlockFunctionalTest extends DrupalWebTestCase {
'node_recent_block_count' => 10,
);
$this->drupalPost('admin/structure/block/manage/node/recent/configure', $block, t('Save block'));
- $this->assertText(t('The block configuration has been saved.'), t('Block saved.'));
+ $this->assertText(t('The block configuration has been saved.'), 'Block saved.');
// Post an additional node.
$node4 = $this->drupalCreateNode($default_settings);
// Test that all four nodes are shown.
$this->drupalGet('');
- $this->assertText($node1->title, t('Node found in block.'));
- $this->assertText($node2->title, t('Node found in block.'));
- $this->assertText($node3->title, t('Node found in block.'));
- $this->assertText($node4->title, t('Node found in block.'));
+ $this->assertText($node1->title, 'Node found in block.');
+ $this->assertText($node2->title, 'Node found in block.');
+ $this->assertText($node3->title, 'Node found in block.');
+ $this->assertText($node4->title, 'Node found in block.');
// Create the custom block.
$custom_block = array();
@@ -1482,20 +1482,20 @@ class NodeBlockFunctionalTest extends DrupalWebTestCase {
$this->drupalPost('admin/structure/block/add', $custom_block, t('Save block'));
$bid = db_query("SELECT bid FROM {block_custom} WHERE info = :info", array(':info' => $custom_block['info']))->fetchField();
- $this->assertTrue($bid, t('Custom block with visibility rule was created.'));
+ $this->assertTrue($bid, 'Custom block with visibility rule was created.');
// Verify visibility rules.
$this->drupalGet('');
- $this->assertNoText($custom_block['title'], t('Block was displayed on the front page.'));
+ $this->assertNoText($custom_block['title'], 'Block was displayed on the front page.');
$this->drupalGet('node/add/article');
- $this->assertText($custom_block['title'], t('Block was displayed on the node/add/article page.'));
+ $this->assertText($custom_block['title'], 'Block was displayed on the node/add/article page.');
$this->drupalGet('node/' . $node1->nid);
- $this->assertText($custom_block['title'], t('Block was displayed on the node/N.'));
+ $this->assertText($custom_block['title'], 'Block was displayed on the node/N.');
// Delete the created custom block & verify that it's been deleted.
$this->drupalPost('admin/structure/block/manage/block/' . $bid . '/delete', array(), t('Delete'));
$bid = db_query("SELECT 1 FROM {block_node_type} WHERE module = 'block' AND delta = :delta", array(':delta' => $bid))->fetchField();
- $this->assertFalse($bid, t('Custom block was deleted.'));
+ $this->assertFalse($bid, 'Custom block was deleted.');
}
}
/**
@@ -1548,9 +1548,9 @@ class NodeBuildContent extends DrupalWebTestCase {
);
}
- /**
- * Test to ensure that a node's content array is rebuilt on every call to node_build_content().
- */
+ /**
+ * Test to ensure that a node's content array is rebuilt on every call to node_build_content().
+ */
function testNodeRebuildContent() {
$node = $this->drupalCreateNode();
@@ -1559,7 +1559,7 @@ class NodeBuildContent extends DrupalWebTestCase {
$content = node_build_content($node);
// If the property doesn't exist it means the node->content was rebuilt.
- $this->assertFalse(isset($content['test_content_property']), t('Node content was emptied prior to being built.'));
+ $this->assertFalse(isset($content['test_content_property']), 'Node content was emptied prior to being built.');
}
}
@@ -1636,10 +1636,10 @@ class NodeQueryAlter extends DrupalWebTestCase {
$query->addMetaData('account', $this->accessUser);
$result = $query->execute()->fetchAll();
- $this->assertEqual(count($result), 4, t('User with access can see correct nodes'));
+ $this->assertEqual(count($result), 4, 'User with access can see correct nodes');
}
catch (Exception $e) {
- $this->fail(t('Altered query is malformed'));
+ $this->fail('Altered query is malformed');
}
}
@@ -1659,10 +1659,10 @@ class NodeQueryAlter extends DrupalWebTestCase {
$query->addMetaData('account', $this->noAccessUser);
$result = $query->execute()->fetchAll();
- $this->assertEqual(count($result), 0, t('User with no access cannot see nodes'));
+ $this->assertEqual(count($result), 0, 'User with no access cannot see nodes');
}
catch (Exception $e) {
- $this->fail(t('Altered query is malformed'));
+ $this->fail('Altered query is malformed');
}
}
@@ -1682,12 +1682,12 @@ class NodeQueryAlter extends DrupalWebTestCase {
$query->addMetaData('account', $this->accessUser);
$result = $query->execute()->fetchAll();
- $this->assertEqual(count($result), 0, t('User with view-only access cannot edit nodes'));
+ $this->assertEqual(count($result), 0, 'User with view-only access cannot edit nodes');
}
catch (Exception $e) {
$this->fail($e->getMessage());
$this->fail((string) $query);
- $this->fail(t('Altered query is malformed'));
+ $this->fail('Altered query is malformed');
}
}
}
@@ -1747,11 +1747,11 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase {
$tests['[node:changed:since]'] = format_interval(REQUEST_TIME - $node->changed, 2, $language->language);
// 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('node' => $node), array('language' => $language));
- $this->assertFalse(strcmp($output, $expected), t('Sanitized node token %token replaced.', array('%token' => $input)));
+ $this->assertFalse(strcmp($output, $expected), 'Sanitized node token ' . $input . ' replaced.');
}
// Generate and test unsanitized tokens.
@@ -1763,7 +1763,7 @@ class NodeTokenReplaceTestCase extends DrupalWebTestCase {
foreach ($tests as $input => $expected) {
$output = token_replace($input, array('node' => $node), array('language' => $language, 'sanitize' => FALSE));
- $this->assertFalse(strcmp($output, $expected), t('Unsanitized node token %token replaced.', array('%token' => $input)));
+ $this->assertFalse(strcmp($output, $expected), 'Unsanitized node token ' . $input . ' replaced.');
}
}
}
diff --git a/modules/openid/openid.test b/modules/openid/openid.test
index 68313ae7ea920e12ea2bbe56cdba9e6d5ff94338..36d65f2342b6f6b811208cbf2cd20a0dc72df601 100644
--- a/modules/openid/openid.test
+++ b/modules/openid/openid.test
@@ -15,7 +15,7 @@ abstract class OpenIDWebTestCase extends DrupalWebTestCase {
$this->drupalPost('', $edit, t('Log in'));
// Check we are on the OpenID redirect form.
- $this->assertTitle(t('OpenID redirect'), t('OpenID redirect page was displayed.'));
+ $this->assertTitle(t('OpenID redirect'), 'OpenID redirect page was displayed.');
// Submit form to the OpenID Provider Endpoint.
$this->drupalPost(NULL, array(), t('Send'));
@@ -126,7 +126,7 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase {
// Test logging in via the login block on the front page.
$this->submitLoginForm($identity);
- $this->assertLink($this->web_user->name, 0, t('User was logged in.'));
+ $this->assertLink($this->web_user->name, 0, 'User was logged in.');
$this->drupalLogout();
@@ -135,12 +135,12 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase {
$this->drupalPost('user/login', $edit, t('Log in'));
// Check we are on the OpenID redirect form.
- $this->assertTitle(t('OpenID redirect'), t('OpenID redirect page was displayed.'));
+ $this->assertTitle(t('OpenID redirect'), 'OpenID redirect page was displayed.');
// Submit form to the OpenID Provider Endpoint.
$this->drupalPost(NULL, array(), t('Send'));
- $this->assertLink($this->web_user->name, 0, t('User was logged in.'));
+ $this->assertLink($this->web_user->name, 0, 'User was logged in.');
// Verify user was redirected away from user/login to an accessible page.
$this->assertResponse(200);
@@ -166,12 +166,12 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase {
$this->drupalPost('user/login', $edit, t('Log in'));
// Check we are on the OpenID redirect form.
- $this->assertTitle(t('OpenID redirect'), t('OpenID redirect page was displayed.'));
+ $this->assertTitle(t('OpenID redirect'), 'OpenID redirect page was displayed.');
// Submit form to the OpenID Provider Endpoint.
$this->drupalPost(NULL, array(), t('Send'));
- $this->assertLink($this->web_user->name, 0, t('User was logged in.'));
+ $this->assertLink($this->web_user->name, 0, 'User was logged in.');
// Verify user was redirected away from user/login to an accessible page.
$this->assertText(t('Operating in maintenance mode.'));
@@ -187,14 +187,14 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase {
// Add identity to user's profile.
$identity = url('openid-test/yadis/xrds', array('absolute' => TRUE));
$this->addIdentity($identity);
- $this->assertText($identity, t('Identity appears in list.'));
+ $this->assertText($identity, 'Identity appears in list.');
// Delete the newly added identity.
$this->clickLink(t('Delete'));
$this->drupalPost(NULL, array(), t('Confirm'));
- $this->assertText(t('OpenID deleted.'), t('Identity deleted'));
- $this->assertNoText($identity, t('Identity no longer appears in list.'));
+ $this->assertText(t('OpenID deleted.'), 'Identity deleted');
+ $this->assertNoText($identity, 'Identity no longer appears in list.');
}
/**
@@ -218,11 +218,11 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase {
'accounts[' . $this->web_user->uid . ']' => TRUE,
);
$this->drupalPost('admin/people', $edit, t('Update'));
- $this->assertRaw('The update has been performed.', t('Account was blocked.'));
+ $this->assertRaw('The update has been performed.', 'Account was blocked.');
$this->drupalLogout();
$this->submitLoginForm($identity);
- $this->assertRaw(t('The username %name has not been activated or is blocked.', array('%name' => $this->web_user->name)), t('User login was blocked.'));
+ $this->assertRaw(t('The username %name has not been activated or is blocked.', array('%name' => $this->web_user->name)), 'User login was blocked.');
}
/**
@@ -246,14 +246,14 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase {
$this->drupalPost('user/' . $this->web_user->uid . '/openid', $edit, t('Add an OpenID'));
if ($claimed_id === FALSE) {
- $this->assertRaw(t('Sorry, that is not a valid OpenID. Ensure you have spelled your ID correctly.'), t('Invalid identity was rejected.'));
+ $this->assertRaw(t('Sorry, that is not a valid OpenID. Ensure you have spelled your ID correctly.'), 'Invalid identity was rejected.');
return;
}
// OpenID 1 used a HTTP redirect, OpenID 2 uses a HTML form that is submitted automatically using JavaScript.
if ($version == 2) {
// Check we are on the OpenID redirect form.
- $this->assertTitle(t('OpenID redirect'), t('OpenID redirect page was displayed.'));
+ $this->assertTitle(t('OpenID redirect'), 'OpenID redirect page was displayed.');
// Submit form to the OpenID Provider Endpoint.
$this->drupalPost(NULL, array(), t('Send'));
@@ -262,7 +262,7 @@ class OpenIDFunctionalTestCase extends OpenIDWebTestCase {
if (!isset($claimed_id)) {
$claimed_id = $identity;
}
- $this->assertRaw(t('Successfully added %identity', array('%identity' => $claimed_id)), t('Identity %identity was added.', array('%identity' => $identity)));
+ $this->assertRaw(t('Successfully added %identity', array('%identity' => $claimed_id)), 'Identity ' . $identity . ' was added.');
}
}
@@ -295,13 +295,13 @@ class OpenIDRegistrationTestCase extends OpenIDWebTestCase {
// Use a User-supplied Identity that is the URL of an XRDS document.
$identity = url('openid-test/yadis/xrds', array('absolute' => TRUE));
$this->submitLoginForm($identity);
- $this->assertRaw(t('Once you have verified your e-mail address, you may log in via OpenID.'), t('User was asked to verify e-mail address.'));
- $this->assertRaw(t('A welcome message with further instructions has been sent to your e-mail address.'), t('A welcome message was sent to the user.'));
+ $this->assertRaw(t('Once you have verified your e-mail address, you may log in via OpenID.'), 'User was asked to verify e-mail address.');
+ $this->assertRaw(t('A welcome message with further instructions has been sent to your e-mail address.'), 'A welcome message was sent to the user.');
$user = user_load_by_name('john');
- $this->assertTrue($user, t('User was registered with right username.'));
- $this->assertEqual($user->mail, 'john@example.com', t('User was registered with right email address.'));
- $this->assertFalse($user->data, t('No additional user info was saved.'));
+ $this->assertTrue($user, 'User was registered with right username.');
+ $this->assertEqual($user->mail, 'john@example.com', 'User was registered with right email address.');
+ $this->assertFalse($user->data, 'No additional user info was saved.');
$this->submitLoginForm($identity);
$this->assertRaw(t('You must validate your email address for this account before logging in via OpenID.'));
@@ -314,7 +314,7 @@ class OpenIDRegistrationTestCase extends OpenIDWebTestCase {
// Verify that the account was activated.
$this->submitLoginForm($identity);
- $this->assertLink('john', 0, t('User was logged in.'));
+ $this->assertLink('john', 0, 'User was logged in.');
}
/**
@@ -329,17 +329,17 @@ class OpenIDRegistrationTestCase extends OpenIDWebTestCase {
// Use a User-supplied Identity that is the URL of an XRDS document.
$identity = url('openid-test/yadis/xrds', array('absolute' => TRUE));
$this->submitLoginForm($identity);
- $this->assertLink('john', 0, t('User was logged in.'));
+ $this->assertLink('john', 0, 'User was logged in.');
$user = user_load_by_name('john');
- $this->assertTrue($user, t('User was registered with right username.'));
- $this->assertEqual($user->mail, 'john@example.com', t('User was registered with right email address.'));
- $this->assertFalse($user->data, t('No additional user info was saved.'));
+ $this->assertTrue($user, 'User was registered with right username.');
+ $this->assertEqual($user->mail, 'john@example.com', 'User was registered with right email address.');
+ $this->assertFalse($user->data, 'No additional user info was saved.');
$this->drupalLogout();
$this->submitLoginForm($identity);
- $this->assertLink('john', 0, t('User was logged in.'));
+ $this->assertLink('john', 0, 'User was logged in.');
}
/**
@@ -355,28 +355,28 @@ class OpenIDRegistrationTestCase extends OpenIDWebTestCase {
$identity = url('openid-test/yadis/xrds', array('absolute' => TRUE));
$this->submitLoginForm($identity);
- $this->assertRaw(t('Account registration using the information provided by your OpenID provider failed due to the reasons listed below. Complete the registration by filling out the form below. If you already have an account, you can log in now and add your OpenID under "My account".', array('@login' => url('user/login'))), t('User was asked to complete the registration process manually.'));
- $this->assertRaw(t('The name %name is already taken.', array('%name' => $web_user->name)), t('Form validation error for username was displayed.'));
- $this->assertRaw(t('The e-mail address %mail is not valid.', array('%mail' => 'mail@invalid#')), t('Form validation error for e-mail address was displayed.'));
+ $this->assertRaw(t('Account registration using the information provided by your OpenID provider failed due to the reasons listed below. Complete the registration by filling out the form below. If you already have an account, you can log in now and add your OpenID under "My account".', array('@login' => url('user/login'))), 'User was asked to complete the registration process manually.');
+ $this->assertRaw(t('The name %name is already taken.', array('%name' => $web_user->name)), 'Form validation error for username was displayed.');
+ $this->assertRaw(t('The e-mail address %mail is not valid.', array('%mail' => 'mail@invalid#')), 'Form validation error for e-mail address was displayed.');
// Enter username and e-mail address manually.
$edit = array('name' => 'john', 'mail' => 'john@example.com');
$this->drupalPost(NULL, $edit, t('Create new account'));
- $this->assertRaw(t('Once you have verified your e-mail address, you may log in via OpenID.'), t('User was asked to verify e-mail address.'));
+ $this->assertRaw(t('Once you have verified your e-mail address, you may log in via OpenID.'), 'User was asked to verify e-mail address.');
$user = user_load_by_name('john');
- $this->assertTrue($user, t('User was registered with right username.'));
- $this->assertFalse($user->data, t('No additional user info was saved.'));
+ $this->assertTrue($user, 'User was registered with right username.');
+ $this->assertFalse($user->data, 'No additional user info was saved.');
// Follow the one-time login that was sent in the welcome e-mail.
$this->drupalGet(user_pass_reset_url($user));
$this->drupalPost(NULL, array(), t('Log in'));
// The user is taken to user/%uid/edit.
- $this->assertFieldByName('mail', 'john@example.com', t('User was registered with right e-mail address.'));
+ $this->assertFieldByName('mail', 'john@example.com', 'User was registered with right e-mail address.');
$this->clickLink(t('OpenID identities'));
- $this->assertRaw($identity, t('OpenID identity was registered.'));
+ $this->assertRaw($identity, 'OpenID identity was registered.');
}
/**
@@ -390,28 +390,28 @@ class OpenIDRegistrationTestCase extends OpenIDWebTestCase {
// Use a User-supplied Identity that is the URL of an XRDS document.
$identity = url('openid-test/yadis/xrds', array('absolute' => TRUE));
$this->submitLoginForm($identity);
- $this->assertRaw(t('Complete the registration by filling out the form below. If you already have an account, you can log in now and add your OpenID under "My account".', array('@login' => url('user/login'))), t('User was asked to complete the registration process manually.'));
- $this->assertNoRaw(t('You must enter a username.'), t('Form validation error for username was not displayed.'));
- $this->assertNoRaw(t('You must enter an e-mail address.'), t('Form validation error for e-mail address was not displayed.'));
+ $this->assertRaw(t('Complete the registration by filling out the form below. If you already have an account, you can log in now and add your OpenID under "My account".', array('@login' => url('user/login'))), 'User was asked to complete the registration process manually.');
+ $this->assertNoRaw(t('You must enter a username.'), 'Form validation error for username was not displayed.');
+ $this->assertNoRaw(t('You must enter an e-mail address.'), 'Form validation error for e-mail address was not displayed.');
// Enter username and e-mail address manually.
$edit = array('name' => 'john', 'mail' => 'john@example.com');
$this->drupalPost(NULL, $edit, t('Create new account'));
- $this->assertRaw(t('Once you have verified your e-mail address, you may log in via OpenID.'), t('User was asked to verify e-mail address.'));
+ $this->assertRaw(t('Once you have verified your e-mail address, you may log in via OpenID.'), 'User was asked to verify e-mail address.');
$user = user_load_by_name('john');
- $this->assertTrue($user, t('User was registered with right username.'));
- $this->assertFalse($user->data, t('No additional user info was saved.'));
+ $this->assertTrue($user, 'User was registered with right username.');
+ $this->assertFalse($user->data, 'No additional user info was saved.');
// Follow the one-time login that was sent in the welcome e-mail.
$this->drupalGet(user_pass_reset_url($user));
$this->drupalPost(NULL, array(), t('Log in'));
// The user is taken to user/%uid/edit.
- $this->assertFieldByName('mail', 'john@example.com', t('User was registered with right e-mail address.'));
+ $this->assertFieldByName('mail', 'john@example.com', 'User was registered with right e-mail address.');
$this->clickLink(t('OpenID identities'));
- $this->assertRaw($identity, t('OpenID identity was registered.'));
+ $this->assertRaw($identity, 'OpenID identity was registered.');
}
/**
@@ -434,11 +434,11 @@ class OpenIDRegistrationTestCase extends OpenIDWebTestCase {
// Use a User-supplied Identity that is the URL of an XRDS document.
$identity = url('openid-test/yadis/xrds', array('absolute' => TRUE));
$this->submitLoginForm($identity);
- $this->assertLink('john', 0, t('User was logged in.'));
+ $this->assertLink('john', 0, 'User was logged in.');
$user = user_load_by_name('john');
- $this->assertTrue($user, t('User was registered with right username.'));
- $this->assertEqual($user->mail, 'john@example.com', t('User was registered with right email address.'));
+ $this->assertTrue($user, 'User was registered with right username.');
+ $this->assertEqual($user->mail, 'john@example.com', 'User was registered with right email address.');
}
}
@@ -463,25 +463,25 @@ class OpenIDUnitTest extends DrupalWebTestCase {
* Test _openid_dh_XXX_to_XXX() functions.
*/
function testConversion() {
- $this->assertEqual(_openid_dh_long_to_base64('12345678901234567890123456789012345678901234567890'), 'CHJ/Y2mq+DyhUCZ0evjH8ZbOPwrS', t('_openid_dh_long_to_base64() returned expected result.'));
- $this->assertEqual(_openid_dh_base64_to_long('BsH/g8Nrpn2dtBSdu/sr1y8hxwyx'), '09876543210987654321098765432109876543210987654321', t('_openid_dh_base64_to_long() returned expected result.'));
+ $this->assertEqual(_openid_dh_long_to_base64('12345678901234567890123456789012345678901234567890'), 'CHJ/Y2mq+DyhUCZ0evjH8ZbOPwrS', '_openid_dh_long_to_base64() returned expected result.');
+ $this->assertEqual(_openid_dh_base64_to_long('BsH/g8Nrpn2dtBSdu/sr1y8hxwyx'), '09876543210987654321098765432109876543210987654321', '_openid_dh_base64_to_long() returned expected result.');
- $this->assertEqual(_openid_dh_long_to_binary('12345678901234567890123456789012345678901234567890'), "\x08r\x7fci\xaa\xf8<\xa1P&tz\xf8\xc7\xf1\x96\xce?\x0a\xd2", t('_openid_dh_long_to_binary() returned expected result.'));
- $this->assertEqual(_openid_dh_binary_to_long("\x06\xc1\xff\x83\xc3k\xa6}\x9d\xb4\x14\x9d\xbb\xfb+\xd7/!\xc7\x0c\xb1"), '09876543210987654321098765432109876543210987654321', t('_openid_dh_binary_to_long() returned expected result.'));
+ $this->assertEqual(_openid_dh_long_to_binary('12345678901234567890123456789012345678901234567890'), "\x08r\x7fci\xaa\xf8<\xa1P&tz\xf8\xc7\xf1\x96\xce?\x0a\xd2", '_openid_dh_long_to_binary() returned expected result.');
+ $this->assertEqual(_openid_dh_binary_to_long("\x06\xc1\xff\x83\xc3k\xa6}\x9d\xb4\x14\x9d\xbb\xfb+\xd7/!\xc7\x0c\xb1"), '09876543210987654321098765432109876543210987654321', '_openid_dh_binary_to_long() returned expected result.');
}
/**
* Test _openid_dh_xorsecret().
*/
function testOpenidDhXorsecret() {
- $this->assertEqual(_openid_dh_xorsecret('123456790123456790123456790', "abc123ABC\x00\xFF"), "\xa4'\x06\xbe\xf1.\x00y\xff\xc2\xc1", t('_openid_dh_xorsecret() returned expected result.'));
+ $this->assertEqual(_openid_dh_xorsecret('123456790123456790123456790', "abc123ABC\x00\xFF"), "\xa4'\x06\xbe\xf1.\x00y\xff\xc2\xc1", '_openid_dh_xorsecret() returned expected result.');
}
/**
* Test _openid_get_bytes().
*/
function testOpenidGetBytes() {
- $this->assertEqual(strlen(_openid_get_bytes(20)), 20, t('_openid_get_bytes() returned expected result.'));
+ $this->assertEqual(strlen(_openid_get_bytes(20)), 20, '_openid_get_bytes() returned expected result.');
}
/**
@@ -501,7 +501,7 @@ class OpenIDUnitTest extends DrupalWebTestCase {
);
$association = new stdClass();
$association->mac_key = "1234567890abcdefghij\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9";
- $this->assertEqual(_openid_signature($association, $response, array('foo', 'bar')), 'QnKZQzSFstT+GNiJDFOptdcZjrc=', t('Expected signature calculated.'));
+ $this->assertEqual(_openid_signature($association, $response, array('foo', 'bar')), 'QnKZQzSFstT+GNiJDFOptdcZjrc=', 'Expected signature calculated.');
}
/**
@@ -512,26 +512,26 @@ class OpenIDUnitTest extends DrupalWebTestCase {
// section 7.2. If the user-supplied string starts with xri:// it should be
// stripped and the resulting string should be treated as an XRI when it
// starts with "=", "@", "+", "$", "!" or "(".
- $this->assertTrue(_openid_is_xri('xri://=foo'), t('_openid_is_xri() returned expected result for an xri identifier with xri scheme.'));
- $this->assertTrue(_openid_is_xri('xri://@foo'), t('_openid_is_xri() returned expected result for an xri identifier with xri scheme.'));
- $this->assertTrue(_openid_is_xri('xri://+foo'), t('_openid_is_xri() returned expected result for an xri identifier with xri scheme.'));
- $this->assertTrue(_openid_is_xri('xri://$foo'), t('_openid_is_xri() returned expected result for an xri identifier with xri scheme.'));
- $this->assertTrue(_openid_is_xri('xri://!foo'), t('_openid_is_xri() returned expected result for an xri identifier with xri scheme..'));
- $this->assertTrue(_openid_is_xri('xri://(foo'), t('_openid_is_xri() returned expected result for an xri identifier with xri scheme..'));
-
- $this->assertTrue(_openid_is_xri('=foo'), t('_openid_is_xri() returned expected result for an xri identifier.'));
- $this->assertTrue(_openid_is_xri('@foo'), t('_openid_is_xri() returned expected result for an xri identifier.'));
- $this->assertTrue(_openid_is_xri('+foo'), t('_openid_is_xri() returned expected result for an xri identifier.'));
- $this->assertTrue(_openid_is_xri('$foo'), t('_openid_is_xri() returned expected result for an xri identifier.'));
- $this->assertTrue(_openid_is_xri('!foo'), t('_openid_is_xri() returned expected result for an xri identifier.'));
- $this->assertTrue(_openid_is_xri('(foo'), t('_openid_is_xri() returned expected result for an xri identifier.'));
-
- $this->assertFalse(_openid_is_xri('foo'), t('_openid_is_xri() returned expected result for an http URL.'));
- $this->assertFalse(_openid_is_xri('xri://foo'), t('_openid_is_xri() returned expected result for an http URL.'));
- $this->assertFalse(_openid_is_xri('http://foo/'), t('_openid_is_xri() returned expected result for an http URL.'));
- $this->assertFalse(_openid_is_xri('http://example.com/'), t('_openid_is_xri() returned expected result for an http URL.'));
- $this->assertFalse(_openid_is_xri('user@example.com/'), t('_openid_is_xri() returned expected result for an http URL.'));
- $this->assertFalse(_openid_is_xri('http://user@example.com/'), t('_openid_is_xri() returned expected result for an http URL.'));
+ $this->assertTrue(_openid_is_xri('xri://=foo'), '_openid_is_xri() returned expected result for an xri identifier with xri scheme.');
+ $this->assertTrue(_openid_is_xri('xri://@foo'), '_openid_is_xri() returned expected result for an xri identifier with xri scheme.');
+ $this->assertTrue(_openid_is_xri('xri://+foo'), '_openid_is_xri() returned expected result for an xri identifier with xri scheme.');
+ $this->assertTrue(_openid_is_xri('xri://$foo'), '_openid_is_xri() returned expected result for an xri identifier with xri scheme.');
+ $this->assertTrue(_openid_is_xri('xri://!foo'), '_openid_is_xri() returned expected result for an xri identifier with xri scheme..');
+ $this->assertTrue(_openid_is_xri('xri://(foo'), '_openid_is_xri() returned expected result for an xri identifier with xri scheme..');
+
+ $this->assertTrue(_openid_is_xri('=foo'), '_openid_is_xri() returned expected result for an xri identifier.');
+ $this->assertTrue(_openid_is_xri('@foo'), '_openid_is_xri() returned expected result for an xri identifier.');
+ $this->assertTrue(_openid_is_xri('+foo'), '_openid_is_xri() returned expected result for an xri identifier.');
+ $this->assertTrue(_openid_is_xri('$foo'), '_openid_is_xri() returned expected result for an xri identifier.');
+ $this->assertTrue(_openid_is_xri('!foo'), '_openid_is_xri() returned expected result for an xri identifier.');
+ $this->assertTrue(_openid_is_xri('(foo'), '_openid_is_xri() returned expected result for an xri identifier.');
+
+ $this->assertFalse(_openid_is_xri('foo'), '_openid_is_xri() returned expected result for an http URL.');
+ $this->assertFalse(_openid_is_xri('xri://foo'), '_openid_is_xri() returned expected result for an http URL.');
+ $this->assertFalse(_openid_is_xri('http://foo/'), '_openid_is_xri() returned expected result for an http URL.');
+ $this->assertFalse(_openid_is_xri('http://example.com/'), '_openid_is_xri() returned expected result for an http URL.');
+ $this->assertFalse(_openid_is_xri('user@example.com/'), '_openid_is_xri() returned expected result for an http URL.');
+ $this->assertFalse(_openid_is_xri('http://user@example.com/'), '_openid_is_xri() returned expected result for an http URL.');
}
/**
@@ -541,15 +541,15 @@ class OpenIDUnitTest extends DrupalWebTestCase {
// Test that the normalization is according to OpenID Authentication 2.0,
// section 7.2 and 11.5.2.
- $this->assertEqual(openid_normalize('$foo'), '$foo', t('openid_normalize() correctly normalized an XRI.'));
- $this->assertEqual(openid_normalize('xri://$foo'), '$foo', t('openid_normalize() correctly normalized an XRI with an xri:// scheme.'));
+ $this->assertEqual(openid_normalize('$foo'), '$foo', 'openid_normalize() correctly normalized an XRI.');
+ $this->assertEqual(openid_normalize('xri://$foo'), '$foo', 'openid_normalize() correctly normalized an XRI with an xri:// scheme.');
- $this->assertEqual(openid_normalize('example.com/'), 'http://example.com/', t('openid_normalize() correctly normalized a URL with a missing scheme.'));
- $this->assertEqual(openid_normalize('example.com'), 'http://example.com/', t('openid_normalize() correctly normalized a URL with a missing scheme and empty path.'));
- $this->assertEqual(openid_normalize('http://example.com'), 'http://example.com/', t('openid_normalize() correctly normalized a URL with an empty path.'));
+ $this->assertEqual(openid_normalize('example.com/'), 'http://example.com/', 'openid_normalize() correctly normalized a URL with a missing scheme.');
+ $this->assertEqual(openid_normalize('example.com'), 'http://example.com/', 'openid_normalize() correctly normalized a URL with a missing scheme and empty path.');
+ $this->assertEqual(openid_normalize('http://example.com'), 'http://example.com/', 'openid_normalize() correctly normalized a URL with an empty path.');
- $this->assertEqual(openid_normalize('http://example.com/path'), 'http://example.com/path', t('openid_normalize() correctly normalized a URL with a path.'));
+ $this->assertEqual(openid_normalize('http://example.com/path'), 'http://example.com/path', 'openid_normalize() correctly normalized a URL with a path.');
- $this->assertEqual(openid_normalize('http://example.com/path#fragment'), 'http://example.com/path', t('openid_normalize() correctly normalized a URL with a fragment.'));
+ $this->assertEqual(openid_normalize('http://example.com/path#fragment'), 'http://example.com/path', 'openid_normalize() correctly normalized a URL with a fragment.');
}
}
diff --git a/modules/path/path.test b/modules/path/path.test
index cca5fd9727945f002b4065e7178104063485d387..8d48c712d6f9608b86044e447de761d4f05cb02c 100644
--- a/modules/path/path.test
+++ b/modules/path/path.test
@@ -40,12 +40,12 @@ class PathTestCase extends DrupalWebTestCase {
// created.
cache_clear_all('*', 'cache_path', TRUE);
$this->drupalGet($edit['source']);
- $this->assertTrue(cache_get($edit['source'], 'cache_path'), t('Cache entry was created.'));
+ $this->assertTrue(cache_get($edit['source'], 'cache_path'), 'Cache entry was created.');
// Visit the alias for the node and confirm a cache entry is created.
cache_clear_all('*', 'cache_path', TRUE);
$this->drupalGet($edit['alias']);
- $this->assertTrue(cache_get($edit['source'], 'cache_path'), t('Cache entry was created.'));
+ $this->assertTrue(cache_get($edit['source'], 'cache_path'), 'Cache entry was created.');
}
/**
@@ -191,7 +191,7 @@ class PathTaxonomyTermTestCase extends DrupalWebTestCase {
function testTermAlias() {
// Create a term in the default 'Tags' vocabulary with URL alias.
$vocabulary = taxonomy_vocabulary_load(1);
- $description = $this->randomName();;
+ $description = $this->randomName();
$edit = array();
$edit['name'] = $this->randomName();
$edit['description[value]'] = $description;
@@ -301,7 +301,7 @@ class PathLanguageTestCase extends DrupalWebTestCase {
drupal_static_reset('language_list');
$languages = language_list();
$url = url('node/' . $french_node->nid, array('language' => $languages[$french_node->language]));
- $this->assertTrue(strpos($url, $edit['path[alias]']), t('URL contains the path alias.'));
+ $this->assertTrue(strpos($url, $edit['path[alias]']), 'URL contains the path alias.');
// Confirm that the alias works even when changing language negotiation
// options. Enable User language detection and selection over URL one.
@@ -345,23 +345,23 @@ class PathLanguageTestCase extends DrupalWebTestCase {
// situation only aliases in the default language and language neutral ones
// should keep working.
$this->drupalGet($french_alias);
- $this->assertResponse(404, t('Alias for French translation is unavailable when URL language negotiation is disabled.'));
+ $this->assertResponse(404, 'Alias for French translation is unavailable when URL language negotiation is disabled.');
// drupal_lookup_path() has an internal static cache. Check to see that
// it has the appropriate contents at this point.
drupal_lookup_path('wipe');
$french_node_path = drupal_lookup_path('source', $french_alias, $french_node->language);
- $this->assertEqual($french_node_path, 'node/' . $french_node->nid, t('Normal path works.'));
+ $this->assertEqual($french_node_path, 'node/' . $french_node->nid, 'Normal path works.');
// Second call should return the same path.
$french_node_path = drupal_lookup_path('source', $french_alias, $french_node->language);
- $this->assertEqual($french_node_path, 'node/' . $french_node->nid, t('Normal path is the same.'));
+ $this->assertEqual($french_node_path, 'node/' . $french_node->nid, 'Normal path is the same.');
// Confirm that the alias works.
$french_node_alias = drupal_lookup_path('alias', 'node/' . $french_node->nid, $french_node->language);
- $this->assertEqual($french_node_alias, $french_alias, t('Alias works.'));
+ $this->assertEqual($french_node_alias, $french_alias, 'Alias works.');
// Second call should return the same alias.
$french_node_alias = drupal_lookup_path('alias', 'node/' . $french_node->nid, $french_node->language);
- $this->assertEqual($french_node_alias, $french_alias, t('Alias is the same.'));
+ $this->assertEqual($french_node_alias, $french_alias, 'Alias is the same.');
}
}
@@ -475,8 +475,8 @@ class PathMonolingualTestCase extends DrupalWebTestCase {
$this->drupalPost('admin/config/regional/language', $edit, t('Save configuration'));
// Verify that French is the only language.
- $this->assertFalse(drupal_multilingual(), t('Site is mono-lingual'));
- $this->assertEqual(language_default('language'), 'fr', t('French is the default language'));
+ $this->assertFalse(drupal_multilingual(), 'Site is mono-lingual');
+ $this->assertEqual(language_default('language'), 'fr', 'French is the default language');
// Set language detection to URL.
$edit = array('language[enabled][locale-url]' => TRUE);
diff --git a/modules/php/php.test b/modules/php/php.test
index 6f36e4f5f6f5e0d5cf8c1a500b8ce3a4dee7c3ae..703c36ec7ad6c76db46cb99d00b2d8c2729f86e9 100644
--- a/modules/php/php.test
+++ b/modules/php/php.test
@@ -17,20 +17,20 @@ class PHPTestCase extends DrupalWebTestCase {
// Verify that the PHP code text format was inserted.
$php_format_id = db_query_range('SELECT format FROM {filter_format} WHERE name = :name', 0, 1, array(':name' => 'PHP code'))->fetchField();
$php_format = filter_format_load($php_format_id);
- $this->assertEqual($php_format->name, 'PHP code', t('PHP code text format was created.'));
+ $this->assertEqual($php_format->name, 'PHP code', 'PHP code text format was created.');
// Verify that the format has the PHP code filter enabled.
$filters = filter_list_format($php_format_id);
- $this->assertTrue($filters['php_code']->status, t('PHP code filter is enabled.'));
+ $this->assertTrue($filters['php_code']->status, 'PHP code filter is enabled.');
// Verify that the format exists on the administration page.
$this->drupalGet('admin/config/content/formats');
- $this->assertText('PHP code', t('PHP code text format was created.'));
+ $this->assertText('PHP code', 'PHP code text format was created.');
// Verify that anonymous and authenticated user roles do not have access.
$this->drupalGet('admin/config/content/formats/' . $php_format_id);
- $this->assertFieldByName('roles[1]', FALSE, t('Anonymous users do not have access to PHP code format.'));
- $this->assertFieldByName('roles[2]', FALSE, t('Authenticated users do not have access to PHP code format.'));
+ $this->assertFieldByName('roles[1]', FALSE, 'Anonymous users do not have access to PHP code format.');
+ $this->assertFieldByName('roles[2]', FALSE, 'Authenticated users do not have access to PHP code format.');
// Store the format ID of the PHP code text format for later use.
$this->php_code_format = $php_format_id;
@@ -72,18 +72,18 @@ class PHPFilterTestCase extends PHPTestCase {
// Make sure that the PHP code shows up as text.
$this->drupalGet('node/' . $node->nid);
- $this->assertText('print "SimpleTest PHP was executed!"', t('PHP code is displayed.'));
+ $this->assertText('print "SimpleTest PHP was executed!"', 'PHP code is displayed.');
// Change filter to PHP filter and see that PHP code is evaluated.
$edit = array();
$langcode = LANGUAGE_NONE;
$edit["body[$langcode][0][format]"] = $this->php_code_format;
$this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
- $this->assertRaw(t('Basic page %title has been updated.', array('%title' => $node->title)), t('PHP code filter turned on.'));
+ $this->assertRaw(t('Basic page %title has been updated.', array('%title' => $node->title)), 'PHP code filter turned on.');
// Make sure that the PHP code shows up as text.
- $this->assertNoText('print "SimpleTest PHP was executed!"', t("PHP code isn't displayed."));
- $this->assertText('SimpleTest PHP was executed!', t('PHP code has been evaluated.'));
+ $this->assertNoText('print "SimpleTest PHP was executed!"', "PHP code isn't displayed.");
+ $this->assertText('SimpleTest PHP was executed!', 'PHP code has been evaluated.');
}
}
@@ -110,10 +110,10 @@ class PHPAccessTestCase extends PHPTestCase {
// Make sure that the PHP code shows up as text.
$this->drupalGet('node/' . $node->nid);
- $this->assertText('print', t('PHP code was not evaluated.'));
+ $this->assertText('print', 'PHP code was not evaluated.');
// Make sure that user doesn't have access to filter.
$this->drupalGet('node/' . $node->nid . '/edit');
- $this->assertNoRaw('