Commit c6c26b5e authored by Dries's avatar Dries

- Patch #247423 by boombatower: code style fixes for the tests.

parent bc5f69a3
......@@ -111,7 +111,7 @@ class RegistryParseFilesTestCase extends DrupalWebTestCase {
}
// Test that we have the right md5.
$md5 = db_result(db_query("SELECT md5 FROM {registry_file} WHERE filename = '%s'", './' . $this->$fileType->fileName));
$this->assertTrue(md5($this->$fileType->contents) == $md5, t('MD5 for "@filename" matched.'.$fileType.$md5, array('@filename' => $this->$fileType->fileName)));
$this->assertTrue(md5($this->$fileType->contents) == $md5, t('MD5 for "@filename" matched.' . $fileType . $md5, array('@filename' => $this->$fileType->fileName)));
}
}
......
......@@ -34,7 +34,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
* @param object $feed Feed object representing the feed.
*/
function deleteFeed($feed) {
$this->drupalPost('admin/content/aggregator/edit/feed/'. $feed->fid, array(), t('Delete'));
$this->drupalPost('admin/content/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.'));
}
......@@ -45,7 +45,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
*/
function getFeedEditArray() {
$feed_name = $this->randomName(10, self::$prefix);
$feed_url = url(NULL, array('absolute' => TRUE)) .'rss.xml?feed='. $feed_name;
$feed_url = url(NULL, array('absolute' => TRUE)) . 'rss.xml?feed=' . $feed_name;
$edit = array(
'title' => $feed_name,
'url' => $feed_url,
......@@ -69,7 +69,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
$feed_count = $feed_count > 10 ? 10 : $feed_count;
// Refresh the feed (simulated link click).
$this->drupalGet('admin/content/aggregator/update/'. $feed->fid);
$this->drupalGet('admin/content/aggregator/update/' . $feed->fid);
// Ensure we have the right number of items.
$result = db_query('SELECT iid FROM {aggregator_item} WHERE fid = %d', $feed->fid);
......@@ -141,7 +141,7 @@ class AddFeedTestCase extends AggregatorTestCase {
$this->assertTrue($this->uniqueFeed($feed->title, $feed->url), t('The feed is unique.'));
// Check feed source.
$this->drupalGet('aggregator/sources/'. $feed->fid);
$this->drupalGet('aggregator/sources/' . $feed->fid);
$this->assertResponse(200, t('Feed source exists.'));
$this->assertText($feed->title, t('Page title'));
......@@ -171,7 +171,7 @@ class UpdateFeedTestCase extends AggregatorTestCase {
// Get new feed data array and modify newly created feed.
$edit = $this->getFeedEditArray();
$edit['refresh'] = 1800; // Change refresh value.
$this->drupalPost('admin/content/aggregator/edit/feed/'. $feed->fid, $edit, t('Save'));
$this->drupalPost('admin/content/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'])));
// Check feed data.
......@@ -179,7 +179,7 @@ class UpdateFeedTestCase extends AggregatorTestCase {
$this->assertTrue($this->uniqueFeed($edit['title'], $edit['url']), t('The feed is unique.'));
// Check feed source.
$this->drupalGet('aggregator/sources/'. $feed->fid);
$this->drupalGet('aggregator/sources/' . $feed->fid);
$this->assertResponse(200, t('Feed source exists.'));
$this->assertText($edit['title'], t('Page title'));
......@@ -211,7 +211,7 @@ class RemoveFeedTestCase extends AggregatorTestCase {
$this->deleteFeed($feed);
// Check feed source.
$this->drupalGet('aggregator/sources/'. $feed->fid);
$this->drupalGet('aggregator/sources/' . $feed->fid);
$this->assertResponse(404, t('Deleted feed source does not exists.'));
// Check database for feed.
......
......@@ -45,7 +45,7 @@ class BlockTestCase extends DrupalWebTestCase {
// Set the created box to a specific region.
// TODO: Implement full region checking.
$edit = array();
$edit['block_'. $bid .'[region]'] = 'left';
$edit['block_' . $bid . '[region]'] = 'left';
$this->drupalPost('admin/build/block', $edit, t('Save blocks'));
// Confirm that the box was moved to the proper region.
......@@ -55,7 +55,7 @@ class BlockTestCase extends DrupalWebTestCase {
$this->assertText(t($box['title']), t('Box successfully being displayed on the page.'));
// Delete the created box & verify that it's been deleted and no longer appearing on the page.
$this->drupalPost('admin/build/block/delete/'. $bid, array(), t('Delete'));
$this->drupalPost('admin/build/block/delete/' . $bid, array(), t('Delete'));
$this->assertRaw(t('The block %title has been removed.', array('%title' => $box['info'])), t('Box successfully deleted.'));
$this->assertNoText(t($box['title']), t('Box no longer appears on page.'));
}
......@@ -71,7 +71,7 @@ class BlockTestCase extends DrupalWebTestCase {
$block['title'] = $this->randomName(8);
// Set block title to confirm that interface works and override any custom titles.
$this->drupalPost('admin/build/block/configure/'. $block['module'] .'/'. $block['delta'], array('title' => $block['title']), t('Save block'));
$this->drupalPost('admin/build/block/configure/' . $block['module'] . '/' . $block['delta'], array('title' => $block['title']), t('Save block'));
$this->assertText(t('The block configuration has been saved.'), t('Block title set.'));
$bid = db_result(db_query("SELECT bid FROM {blocks} WHERE module = '%s' AND delta = %d", array($block['module'], $block['delta'])));
......@@ -80,7 +80,7 @@ class BlockTestCase extends DrupalWebTestCase {
// Set the created block to a specific region.
$edit = array();
$edit[$block['module'] .'_'. $block['delta'] .'[region]'] = 'left';
$edit[$block['module'] . '_' . $block['delta'] . '[region]'] = 'left';
$this->drupalPost('admin/build/block', $edit, t('Save blocks'));
// Confirm that the block was moved to the proper region.
......@@ -92,7 +92,7 @@ class BlockTestCase extends DrupalWebTestCase {
// Set the block to the disabled region.
$edit = array();
$edit[$block['module'] .'_'. $block['delta'] .'[region]'] = '-1';
$edit[$block['module'] . '_' . $block['delta'] . '[region]'] = '-1';
$this->drupalPost('admin/build/block', $edit, t('Save blocks'));
// Confirm that the block was moved to the proper region.
......@@ -101,11 +101,11 @@ class BlockTestCase extends DrupalWebTestCase {
// For convenience of developers, put the navigation block back.
$edit = array();
$edit[$block['module'] .'_'. $block['delta'] .'[region]'] = 'left';
$edit[$block['module'] . '_' . $block['delta'] . '[region]'] = 'left';
$this->drupalPost('admin/build/block', $edit, t('Save blocks'));
$this->assertText(t('The block settings have been updated.'), t('Block successfully move to disabled region.'));
$this->drupalPost('admin/build/block/configure/'. $block['module'] .'/'. $block['delta'], array('title' => 'Navigation'), t('Save block'));
$this->drupalPost('admin/build/block/configure/' . $block['module'] . '/' . $block['delta'], array('title' => 'Navigation'), t('Save block'));
$this->assertText(t('The block configuration has been saved.'), t('Block title set.'));
}
}
......@@ -100,7 +100,7 @@ class BlogTestCase extends DrupalWebTestCase {
if ($response2 == 200) {
$this->assertTitle(t('Blog | Drupal'), t('Blog help node was displayed'));
$this->assertText(t('Blog'), t('Blog help node was displayed'));
$this->assertText(t('Home '. $crumb .' Administer '. $crumb .' Help'), t('Breadcrumbs were displayed'));
$this->assertText(t('Home ' . $crumb . ' Administer ' . $crumb . ' Help'), t('Breadcrumbs were displayed'));
}
// Verify the blog block was displayed.
......@@ -109,17 +109,17 @@ class BlogTestCase extends DrupalWebTestCase {
$this->assertText(t('Recent blog posts'), t('Blog block was displayed'));
// View blog node.
$this->drupalGet('node/'. $node->nid);
$this->drupalGet('node/' . $node->nid);
$this->assertResponse(200);
$this->assertTitle($node->title. ' | Drupal', t('Blog node was displayed'));
$this->assertText(t('Home '. $crumb .' Blogs '. $crumb .' @name'. $quote .'s blog', array('@name' => $node_user->name)), t('Breadcrumbs were displayed'));
$this->assertText(t('Home ' . $crumb . ' Blogs ' . $crumb . ' @name' . $quote . 's blog', array('@name' => $node_user->name)), t('Breadcrumbs were displayed'));
// View blog edit node.
$this->drupalGet('node/'. $node->nid .'/edit');
$this->drupalGet('node/' . $node->nid . '/edit');
$this->assertResponse($response);
if ($response == 200) {
$this->assertTitle($node->title. ' | Drupal', t('Blog edit node was displayed'));
$this->assertText(t('Home '. $crumb .' @title', array('@title' => $node->title)), t('Breadcrumbs were displayed'));
$this->assertText(t('Home ' . $crumb . ' @title', array('@title' => $node->title)), t('Breadcrumbs were displayed'));
}
if ($response == 200) {
......@@ -127,11 +127,11 @@ class BlogTestCase extends DrupalWebTestCase {
$edit = array();
$edit['title'] = 'node/' . $node->nid;
$edit['body'] = $this->randomName(256);
$this->drupalPost('node/'. $node->nid .'/edit', $edit, t('Save'));
$this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
$this->assertRaw(t('Blog entry %title has been updated.', array('%title' => $edit['title'])), t('Blog node was edited'));
// Delete blog node.
$this->drupalPost('node/'. $node->nid .'/delete', array(), t('Delete'));
$this->drupalPost('node/' . $node->nid . '/delete', array(), t('Delete'));
$this->assertResponse($response);
$this->assertRaw(t('Blog entry %title has been deleted.', array('%title' => $edit['title'])), t('Blog node was deleted'));
}
......@@ -147,7 +147,7 @@ class BlogTestCase extends DrupalWebTestCase {
$crumb = '›';
// Confirm blog entries link exists on the user page.
$this->drupalGet('user/'. $user->uid);
$this->drupalGet('user/' . $user->uid);
$this->assertResponse(200);
$this->assertText(t('View recent blog entries'), t('View recent blog entries link was displayed'));
......@@ -162,16 +162,16 @@ class BlogTestCase extends DrupalWebTestCase {
$this->assertText(t('Home'), t('Breadcrumbs were displayed'));
// Confirm a blog page was displayed per user.
$this->drupalGet('blog/'. $user->uid);
$this->drupalGet('blog/' . $user->uid);
$this->assertTitle(t("@name's blog | Drupal", array('@name' => $user->name)), t('User blog node was displayed'));
$this->assertText(t('Home '. $crumb .' Blogs'), t('Breadcrumbs were displayed'));
$this->assertText(t('Home ' . $crumb . ' Blogs'), t('Breadcrumbs were displayed'));
// Confirm a blog feed was displayed.
$this->drupalGet('blog/feed');
$this->assertTitle(t('Drupal blogs'), t('Blog feed was displayed'));
// Confirm a blog feed was displayed per user.
$this->drupalGet('blog/'. $user->uid .'/feed');
$this->drupalGet('blog/' . $user->uid . '/feed');
$this->assertTitle(t("@name's blog", array('@name' => $user->name)), t('User blog feed was displayed'));
}
}
......@@ -75,7 +75,7 @@ class BlogAPITestCase extends DrupalWebTestCase {
$file = current($this->drupalGetTestFiles('text'));
$file_contents = file_get_contents($file->filename);
$file = array();
$file['name'] = $this->randomName() .'.txt';
$file['name'] = $this->randomName() . '.txt';
$file['type'] = 'text';
$file['bits'] = xmlrpc_base64($file_contents);
$result = xmlrpc($local, 'metaWeblog.newMediaObject', $blog_id, $web_user->name, $web_user->pass_raw, $file);
......@@ -146,7 +146,7 @@ class BlogAPITestCase extends DrupalWebTestCase {
function addTerm($vid, $term) {
$edit = array();
$edit['name'] = $term;
$this->drupalPost('admin/content/taxonomy/'. $vid .'/add/term', $edit, t('Save'));
$this->drupalPost('admin/content/taxonomy/' . $vid . '/add/term', $edit, t('Save'));
$this->assertRaw(t('Created new term %term.', array('%term' => $edit['name'])), t('Taxonomy term added.'));
$tree = taxonomy_get_tree($vid);
......
This diff is collapsed.
......@@ -44,7 +44,7 @@ class ContactTestCase extends DrupalWebTestCase {
$invalid_recipients = array('invalid', 'invalid@', /*'invalid@site', 'invalid@site.',*/ '@site.', '@site.com');
foreach ($invalid_recipients as $invalid_recipient) {
$this->addCategory($this->randomName(16), $invalid_recipient, '', FALSE);
$this->assertRaw(t('%recipient is an invalid e-mail address.', array('%recipient' => $invalid_recipient)), t('Caught invalid recipient ('. $invalid_recipient .').'));
$this->assertRaw(t('%recipient is an invalid e-mail address.', array('%recipient' => $invalid_recipient)), t('Caught invalid recipient (' . $invalid_recipient . ').'));
}
// Create valid categories.
......@@ -132,7 +132,7 @@ class ContactTestCase extends DrupalWebTestCase {
$this->drupalLogin($web_user1);
$this->drupalGet('user/'. $web_user2->uid .'/contact');
$this->drupalGet('user/' . $web_user2->uid . '/contact');
$this->assertResponse(200, t('Access to personal contact form granted.'));
$edit = array();
......@@ -160,7 +160,7 @@ class ContactTestCase extends DrupalWebTestCase {
$this->drupalLogin($web_user3);
$this->drupalGet('user/'. $web_user4->uid .'/contact');
$this->drupalGet('user/' . $web_user4->uid . '/contact');
$this->assertResponse(403, t('Access to personal contact form denied.'));
}
......@@ -207,7 +207,7 @@ class ContactTestCase extends DrupalWebTestCase {
$categories = $this->getCategories();
foreach ($categories as $category) {
$category_name = db_result(db_query('SELECT category FROM {contact} WHERE cid = %d', array($category)));
$this->drupalPost('admin/build/contact/delete/'. $category, array(), t('Delete'));
$this->drupalPost('admin/build/contact/delete/' . $category, array(), t('Delete'));
$this->assertRaw(t('Category %category has been deleted.', array('%category' => $category_name)), t('Category deleted sucessfully.'));
}
}
......@@ -236,13 +236,13 @@ class ContactTestCase extends DrupalWebTestCase {
// Get role id (rid) for specified role.
$rid = db_result(db_query("SELECT rid FROM {role} WHERE name = '%s'", array($role)));
if ($rid === FALSE) {
$this->fail(t(' [permission] Role "'. $role .'" not found.'));
$this->fail(t(' [permission] Role "' . $role . '" not found.'));
}
// Create edit array from permission.
$edit = array();
foreach ($permissions as $name => $value) {
$edit[$rid .'['. $name .']'] = $value;
$edit[$rid . '[' . $name . ']'] = $value;
}
$this->drupalPost('admin/user/permissions', $edit, t('Save permissions'));
......
......@@ -108,7 +108,7 @@ class DBLogTestCase extends DrupalWebTestCase {
);
$message = 'Log entry added to test the dblog row limit.';
for ($i = 0; $i < $count; $i++) {
$log['message'] = $i. ' => ' .$message;
$log['message'] = $i . ' => ' . $message;
dblog_watchdog($log);
}
}
......@@ -139,14 +139,14 @@ class DBLogTestCase extends DrupalWebTestCase {
$this->drupalGet('admin/reports/page-not-found');
$this->assertResponse($response);
if ($response == 200) {
$this->assertText(t('Top '. $quote .'page not found'. $quote .' errors'), t('DBLog page-not-found report was displayed'));
$this->assertText(t('Top ' . $quote . 'page not found' . $quote . ' errors'), t('DBLog page-not-found report was displayed'));
}
// View dblog access-denied report node.
$this->drupalGet('admin/reports/access-denied');
$this->assertResponse($response);
if ($response == 200) {
$this->assertText(t('Top '. $quote .'access denied'. $quote .' errors'), t('DBLog access-denied report was displayed'));
$this->assertText(t('Top ' . $quote . 'access denied' . $quote . ' errors'), t('DBLog access-denied report was displayed'));
}
// View dblog event node.
......@@ -184,7 +184,7 @@ class DBLogTestCase extends DrupalWebTestCase {
// Add user using form to generate add user event (which is not triggered by drupalCreateUser).
$edit = array();
$edit['name'] = $name;
$edit['mail'] = $name .'@example.com';
$edit['mail'] = $name . '@example.com';
$edit['pass[pass1]'] = $pass;
$edit['pass[pass2]'] = $pass;
$edit['status'] = 1;
......@@ -252,7 +252,7 @@ class DBLogTestCase extends DrupalWebTestCase {
*/
private function doNode($type) {
// Create user.
$perm = array('create '. $type .' content', 'edit own '. $type .' content', 'delete own '. $type .' content');
$perm = array('create ' . $type . ' content', 'edit own ' . $type . ' content', 'delete own ' . $type . ' content');
$user = $this->drupalCreateUser($perm);
// Login user.
$this->drupalLogin($user);
......@@ -260,20 +260,20 @@ class DBLogTestCase extends DrupalWebTestCase {
// Create node using form to generate add content event (which is not triggered by drupalCreateNode).
$edit = $this->getContent($type);
$title = $edit['title'];
$this->drupalPost('node/add/'. $type, $edit, t('Save'));
$this->drupalPost('node/add/' . $type, $edit, t('Save'));
$this->assertResponse(200);
// Retrieve node object.
$node = node_load(array('title' => $title));
$this->assertTrue($node != null, t('Node @title was loaded', array('@title' => $title)));
// Edit node.
$edit = $this->getContentUpdate($type);
$this->drupalPost('node/'. $node->nid .'/edit', $edit, t('Save'));
$this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
$this->assertResponse(200);
// Delete node.
$this->drupalPost('node/'. $node->nid .'/delete', array(), t('Delete'));
$this->drupalPost('node/' . $node->nid . '/delete', array(), t('Delete'));
$this->assertResponse(200);
// View node (to generate page not found event).
$this->drupalGet('node/'. $node->nid);
$this->drupalGet('node/' . $node->nid);
$this->assertResponse(404);
// View the dblog report (to generate access denied event).
$this->drupalGet('admin/reports/dblog');
......
......@@ -39,7 +39,7 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Add an additional tag.
$edit = array();
$edit['allowed_html_1'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>' . ' <quote>'; // Adding <quote> tag.
$this->drupalPost('admin/settings/filters/' . $filtered .'/configure', $edit, t('Save configuration'));
$this->drupalPost('admin/settings/filters/' . $filtered . '/configure', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'), t('Allowed HTML tag added.'));
$this->assertRaw(htmlentities($edit['allowed_html_1']), t('Tag displayed.'));
......@@ -49,8 +49,8 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Reorder filters.
$edit = array();
$edit['weights[filter/' . $second_filter .']'] = 1;
$edit['weights[filter/' . $first_filter .']'] = 2;
$edit['weights[filter/' . $second_filter . ']'] = 1;
$edit['weights[filter/' . $first_filter . ']'] = 2;
$this->drupalPost('admin/settings/filters/' . $filtered . '/order', $edit, t('Save configuration'));
$this->assertText(t('The filter ordering has been saved.'), t('Order saved successfully.'));
......@@ -131,7 +131,7 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Allowed tags.
$edit = array();
$edit['allowed_html_1'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>';
$this->drupalPost('admin/settings/filters/' . $filtered .'/configure', $edit, t('Save configuration'));
$this->drupalPost('admin/settings/filters/' . $filtered . '/configure', $edit, t('Save configuration'));
$this->assertText(t('The configuration options have been saved.'), t('Changes reverted.'));
// Full HTML.
......@@ -142,9 +142,9 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Filter order.
$edit = array();
$edit['weights[filter/' . $second_filter .']'] = 2;
$edit['weights[filter/' . $first_filter .']'] = 1;
$this->drupalPost('admin/settings/filters/' . $filtered .'/order', $edit, t('Save configuration'));
$edit['weights[filter/' . $second_filter . ']'] = 2;
$edit['weights[filter/' . $first_filter . ']'] = 1;
$this->drupalPost('admin/settings/filters/' . $filtered . '/order', $edit, t('Save configuration'));
$this->assertText(t('The filter ordering has been saved.'), t('Order successfully reverted.'));
}
......@@ -269,7 +269,7 @@ END;
$edit['type'] = 'page';
$page = $this->drupalCreateNode($edit);
$this->drupalGet('node/' .$page->nid);
$this->drupalGet('node/' . $page->nid);
$this->assertRaw('href="http://www.test1.com"', t('Parse simple www-string but not the end-of-sentence period.'));
$this->assertRaw('href="mailto:person@test2.com"', t('Parse simple email string but not the end-of-sentence period.'));
$this->assertRaw('href="http://www.test3.com"', t('Parse simple HTTP URL but not the end-of-sentence period.'));
......
......@@ -96,7 +96,7 @@ class ForumTestCase extends DrupalWebTestCase {
// Add forum to navigation menu.
$edit = array();
$edit['mlid:'. $mlid .'[hidden]'] = TRUE;
$edit['mlid:' . $mlid . '[hidden]'] = TRUE;
$this->drupalPost('admin/build/menu-customize/navigation', $edit, t('Save configuration'));
$this->assertResponse(200);
......@@ -134,7 +134,7 @@ class ForumTestCase extends DrupalWebTestCase {
);
// Edit the vocabulary.
$this->drupalPost('admin/content/taxonomy/edit/vocabulary/'. $vid, $edit, t('Save'));
$this->drupalPost('admin/content/taxonomy/edit/vocabulary/' . $vid, $edit, t('Save'));
$this->assertResponse(200);
$this->assertRaw(t('Updated vocabulary %name.', array('%name' => $title)), t('Vocabulary was edited'));
......@@ -158,7 +158,7 @@ class ForumTestCase extends DrupalWebTestCase {
);
// Edit the vocabulary.
$this->drupalPost('admin/content/taxonomy/edit/vocabulary/'. $vid, $edit, t('Save'));
$this->drupalPost('admin/content/taxonomy/edit/vocabulary/' . $vid, $edit, t('Save'));
$this->assertResponse(200);
$this->assertRaw(t('Updated vocabulary %name.', array('%name' => $title)), t('Vocabulary was edited'));
/*
......@@ -191,19 +191,19 @@ class ForumTestCase extends DrupalWebTestCase {
);
// Create forum.
$this->drupalPost('admin/content/forum/add/'. $type, $edit, t('Save'));
$this->drupalPost('admin/content/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))), t(ucfirst($type) . ' was created'));
// Verify forum.
$term = db_fetch_array(db_query("SELECT * FROM {term_data} t WHERE t.vid = %d AND t.name = '%s' AND t.description = '%s'", variable_get('forum_nav_vocabulary', ''), $name, $description));
$this->assertTrue(!empty($term), 'The '. $type .' exists in the database');
$this->assertTrue(!empty($term), 'The ' . $type . ' exists in the database');
// Verify forum hierarchy.
$tid = $term['tid'];
$parent_tid = db_result(db_query("SELECT t.parent FROM {term_hierarchy} t WHERE t.tid = %d", $tid));
$this->assertTrue($parent == $parent_tid, 'The '. $type .' is linked to its container');
$this->assertTrue($parent == $parent_tid, 'The ' . $type . ' is linked to its container');
return $term;
}
......@@ -249,7 +249,7 @@ class ForumTestCase extends DrupalWebTestCase {
// Instead, the post variables seem to pick up the first non-blank value in the select list.
// Create forum topic.
// $this->drupalPost('node/add/forum/'. $forum['tid'], $edit, t('Save'));
// $this->drupalPost('node/add/forum/' . $forum['tid'], $edit, t('Save'));
$this->drupalPost('node/add/forum/', $edit, t('Save'));
$type = t('Forum topic');
if ($container) {
......@@ -267,7 +267,7 @@ class ForumTestCase extends DrupalWebTestCase {
$this->assertTrue($node != null, t('Node @title was loaded', array('@title' => $title)));
// View forum topic.
$this->drupalGet('node/'. $node->nid);
$this->drupalGet('node/' . $node->nid);
$this->assertRaw($title, t('Subject was found'));
$this->assertRaw($body, t('Body was found'));
......@@ -294,7 +294,7 @@ class ForumTestCase extends DrupalWebTestCase {
if ($response2 == 200) {
$this->assertTitle(t('Forum | Drupal'), t('Forum help node was displayed'));
$this->assertText(t('Forum'), t('Forum help node was displayed'));
$this->assertText(t('Home '. $crumb .' Administer '. $crumb .' Help'), t('Breadcrumbs were displayed'));
$this->assertText(t('Home ' . $crumb . ' Administer ' . $crumb . ' Help'), t('Breadcrumbs were displayed'));
}
// Verify the forum blocks were displayed.
......@@ -312,17 +312,17 @@ class ForumTestCase extends DrupalWebTestCase {
$this->verifyForumView($this->root_forum);
// View forum node.
$this->drupalGet('node/'. $node->nid);
$this->drupalGet('node/' . $node->nid);
$this->assertResponse(200);
$this->assertTitle($node->title .' | Drupal', t('Forum node was displayed'));
$this->assertText(t('Home '. $crumb .' Forums '. $crumb .' @container '. $crumb .' @forum', array('@container' => $this->container['name'], '@forum' => $this->forum['name'])), t('Breadcrumbs were displayed'));
$this->assertTitle($node->title . ' | Drupal', t('Forum node was displayed'));
$this->assertText(t('Home ' . $crumb . ' Forums ' . $crumb . ' @container ' . $crumb . ' @forum', array('@container' => $this->container['name'], '@forum' => $this->forum['name'])), t('Breadcrumbs were displayed'));
// View forum edit node.
$this->drupalGet('node/'. $node->nid .'/edit');
$this->drupalGet('node/' . $node->nid . '/edit');
$this->assertResponse($response);
if ($response == 200) {
$this->assertTitle($node->title .' | Drupal', t('Forum edit node was displayed'));
$this->assertText(t('Home '. $crumb .' @title', array('@title' => $node->title)), t('Breadcrumbs were displayed'));
$this->assertTitle($node->title . ' | Drupal', t('Forum edit node was displayed'));
$this->assertText(t('Home ' . $crumb . ' @title', array('@title' => $node->title)), t('Breadcrumbs were displayed'));
}
if ($response == 200) {
......@@ -332,7 +332,7 @@ class ForumTestCase extends DrupalWebTestCase {
$edit['body'] = $this->randomName(256);
$edit['taxonomy[1]'] = $this->root_forum['tid']; // Assumes the topic is initially associated with $forum.
$edit['shadow'] = TRUE;
$this->drupalPost('node/'. $node->nid .'/edit', $edit, t('Save'));
$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'));
// Verify topic was moved to a different forum.
......@@ -340,7 +340,7 @@ class ForumTestCase extends DrupalWebTestCase {
$this->assertTrue($forum_tid == $this->root_forum['tid'], 'The forum topic is linked to a different forum');
// Delete forum node.
$this->drupalPost('node/'. $node->nid .'/delete', array(), t('Delete'));
$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'));
}
......@@ -355,14 +355,14 @@ class ForumTestCase extends DrupalWebTestCase {
$crumb = '›';
// View forum page.
$this->drupalGet('forum/'. $forum['tid']);
$this->drupalGet('forum/' . $forum['tid']);
$this->assertResponse(200);
$this->assertTitle($forum['name'] .' | Drupal', t('Forum node was displayed'));
$this->assertTitle($forum['name'] . ' | Drupal', t('Forum node was displayed'));
if (isset($parent)) {
$this->assertText(t('Home '. $crumb .' Forums '. $crumb .' @name', array('@name' => $parent['name'])), t('Breadcrumbs were displayed'));
$this->assertText(t('Home ' . $crumb . ' Forums ' . $crumb . ' @name', array('@name' => $parent['name'])), t('Breadcrumbs were displayed'));
}
else {
$this->assertText(t('Home '. $crumb .' Forums'), t('Breadcrumbs were displayed'));
$this->assertText(t('Home ' . $crumb . ' Forums'), t('Breadcrumbs were displayed'));
}
}
......@@ -389,9 +389,9 @@ class ForumTestCase extends DrupalWebTestCase {
for ($i = 0; $i < 2; $i++) {
foreach ($nids as $nid) {
$this->drupalGet('node/'. $nid);
$this->drupalGet('node/'. $nid);
$this->drupalGet('node/'. $nid);
$this->drupalGet('node/' . $nid);
$this->drupalGet('node/' . $nid);
$this->drupalGet('node/' . $nid);
}
}
}
......
......@@ -55,16 +55,16 @@ class HelpTestCase extends DrupalWebTestCase {
foreach ($this->modules as $module => $name) {
// View module help node.
$this->drupalGet('admin/help/'. $module);
$this->drupalGet('admin/help/' . $module);
$this->assertResponse($response);
if ($response == 200) {
// NOTE: The asserts fail on blog and poll because the get returns the 'admin/help' node instead of the indicated node???
// if ($module == 'blog' || $module == 'poll') {
// continue;
// }
$this->assertTitle($name. ' | Drupal', t('['. $module .'] Title was displayed'));
$this->assertRaw('<h2>'. t($name) .'</h2>', t('['. $module .'] Heading was displayed'));
$this->assertText(t('Home '. $crumb .' Administer '. $crumb .' Help'), t('['. $module .'] Breadcrumbs were displayed'));
$this->assertTitle($name . ' | Drupal', t('[' . $module . '] Title was displayed'));
$this->assertRaw('<h2>' . t($name) . '</h2>', t('[' . $module . '] Heading was displayed'));
$this->assertText(t('Home ' . $crumb . ' Administer ' . $crumb . ' Help'), t('[' . $module . '] Breadcrumbs were displayed'));
}
}
}
......
......@@ -94,7 +94,7 @@ class LocaleTestCase extends DrupalWebTestCase {
// Delete the language.
$this->drupalLogin($admin_user);
$path = 'admin/settings/language/delete/'. $langcode;
$path = 'admin/settings/language/delete/' . $langcode;
// 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.
......@@ -108,7 +108,7 @@ class LocaleTestCase extends DrupalWebTestCase {
// Delete the name string.
$this->drupalLogin($translate_user);
$this->drupalGet('admin/build/translate/delete/'. $lid);
$this->drupalGet('admin/build/translate/delete/' . $lid);
$this->assertText(t('The string has been removed.'), 'The string has been removed message.');
$this->drupalPost('admin/build/translate/search', $search, t('Search'));
$this->assertNoText($name, 'Search now can not find the name');
......
......@@ -111,9 +111,9 @@ class MenuTestCase extends DrupalWebTestCase {
$this->assertText($title, 'Menu created');
// Enable the custom menu block.
$menu_name = 'menu-'. $menu_name; // Drupal prepends the name with 'menu-'.
$menu_name = 'menu-' . $menu_name; // Drupal prepends the name with 'menu-'.
$edit = array();
$edit['menu_'. $menu_name .'[region]'] = 'left';
$edit['menu_' . $menu_name . '[region]'] = 'left';
$this->drupalPost('admin/build/block', $edit, t('Save blocks'));
$this->assertResponse(200);
$this->assertText(t('The block settings have been updated.'), t('Custom menu block was enabled'));
......@@ -147,8 +147,8 @@ class MenuTestCase extends DrupalWebTestCase {
$node2 = $this->drupalCreateNode(array('type' => 'article', 'uid' => $this->big_user->uid));
// Add menu items.
$item1 = $this->addMenuItem(0, 'node/'. $node1->nid, $menu_name);
$item2 = $this->addMenuItem($item1['mlid'], 'node/'. $node2->nid, $menu_name);
$item1 = $this->addMenuItem(0, 'node/' . $node1->nid, $menu_name);
$item2 = $this->addMenuItem($item1['mlid'], 'node/' . $node2->nid, $menu_name);
// Verify menu items.
$this->verifyMenuItem($item1, $node1);
......@@ -180,14 +180,14 @@ class MenuTestCase extends DrupalWebTestCase {
$this->drupalGet("admin/build/menu-customize/$menu_name/add");
$this->assertResponse(200);
$title = '!link_'. $this->randomName(16);
$title = '!link_' . $this->randomName(16);
$edit = array (
'menu[link_path]' => $link,
'menu[link_title]' => $title,
'menu[description]' => '',
'menu[enabled]' => TRUE, // Use this to disable the menu and test.
'menu[expanded]' => TRUE, // Setting this to true should test whether it works when we do the std_user tests.
'menu[parent]' => $menu_name .':'. $plid,
'menu[parent]' => $menu_name . ':' . $plid,
'menu[weight]' => '0',
);
......@@ -202,8 +202,8 @@ class MenuTestCase extends DrupalWebTestCase {
$item = db_fetch_array(db_query("SELECT * FROM {menu_links} WHERE link_title = '%s'", $title));
// Check the structure in the DB of the two menu items.
// In general, if $n = $item['depth'] then $item['p'. $n] == $item['mlid'] and $item['p'. ($n - 1)] == $item['plid'] (unless depth == 0).
// All $item['p'. $n] for $n > depth must be 0.
// In general, if $n = $item['depth'] then $item['p'. $n] == $item['mlid'] and $item['p' . ($n - 1)] == $item['plid'] (unless depth == 0).
// All $item['p' . $n] for $n > depth must be 0.
// We know link1 is at the top level, so $item1['deptj'] == 1 and $item1['plid'] == 0.
// We know that the parent of link2 is link1, so $item2['plid'] == $item1['mlid'].
// Both menu items were created in the navigation menu.
......@@ -289,7 +289,7 @@ class MenuTestCase extends DrupalWebTestCase {
// $this->assertRaw(t('The menu item %title has been updated.', array('%title' => $title)), t('Menu item was edited'));
// Verify menu item.
$this->drupalGet('admin/build/menu-customize/'. $item['menu_name']);
$this->drupalGet('admin/build/menu-customize/' . $item['menu_name']);
$this->assertText($title, 'Menu item was edited');
}
......@@ -412,7 +412,7 @@ class MenuTestCase extends DrupalWebTestCase {
// View menu edit node.