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);
......
......@@ -44,7 +44,7 @@ class CommentTestCase extends DrupalWebTestCase {
// Post comment without subject.
$this->drupalLogin($this->web_user);
$this->drupalGet('comment/reply/'. $this->node->nid);
$this->drupalGet('comment/reply/' . $this->node->nid);
$this->assertNoFieldByName('subject', '', t('Subject field not found.'));
// Set comments to have subject and preview to required.
......@@ -60,12 +60,12 @@ class CommentTestCase extends DrupalWebTestCase {
$this->assertTrue($this->commentExists($comment), t('Comment found.'));
// Reply to comment.
$this->drupalGet('comment/reply/'. $this->node->nid .'/'. $comment->id);
$this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
$reply = $this->postComment(NULL, $this->randomName(), $this->randomName());
$this->assertTrue($this->commentExists($reply, TRUE), t('Reply found.'));
// Edit reply.
$this->drupalGet('comment/edit/'. $reply->id);
$this->drupalGet('comment/edit/' . $reply->id);
$reply = $this->postComment(NULL, $this->randomName(), $this->randomName());
$this->assertTrue($this->commentExists($reply, TRUE), t('Modified reply found.'));
......@@ -74,7 +74,7 @@ class CommentTestCase extends DrupalWebTestCase {
$this->drupalLogin($this->admin_user);
$this->deleteComment($comment);
$this->drupalGet('node/'. $this->node->nid);
$this->drupalGet('node/' . $this->node->nid);
$this->assertFalse($this->commentExists($comment), t('Comment not found.'));
$this->assertFalse($this->commentExists($reply, TRUE), t('Reply not found.'));
}
......@@ -90,7 +90,7 @@ class CommentTestCase extends DrupalWebTestCase {
// Submit comment through node form.
$this->drupalLogin($this->web_user);
$this->drupalGet('node/'. $this->node->nid);
$this->drupalGet('node/' . $this->node->nid);
$form_comment = $this->postComment(NULL, $this->randomName(), $this->randomName());
$this->assertTrue($this->commentExists($form_comment), t('Form comment found.'));
......@@ -120,7 +120,7 @@ class CommentTestCase extends DrupalWebTestCase {
$this->drupalLogout();
// Post anonymous comment with contact info (optional).
$this->drupalGet('comment/reply/'. $this->node->nid);
$this->drupalGet('comment/reply/' . $this->node->nid);
$this->assertTrue($this->commentContactInfoAvailable(), t('Contact information available.'));
$anonymous_comment2 = $this->postComment($this->node, $this->randomName(), $this->randomName());
......@@ -132,7 +132,7 @@ class CommentTestCase extends DrupalWebTestCase {
$this->drupalLogout();
// Try to post comment with contact info (required).
$this->drupalGet('comment/reply/'. $this->node->nid);
$this->drupalGet('comment/reply/' . $this->node->nid);
$this->assertTrue($this->commentContactInfoAvailable(), t('Contact information available.'));
$anonymous_comment3 = $this->postComment($this->node, $this->randomName(), $this->randomName(), TRUE, TRUE);
......@@ -148,19 +148,19 @@ class CommentTestCase extends DrupalWebTestCase {
$this->performCommentOperation($anonymous_comment3, 'unpublish');
$this->drupalGet('admin/content/comment/approval');
$this->assertRaw('comments['. $anonymous_comment3->id .']', t('Comment was unpublished.'));
$this->assertRaw('comments[' . $anonymous_comment3->id . ']', t('Comment was unpublished.'));
// Publish comment.
$this->performCommentOperation($anonymous_comment3, 'publish', TRUE);
$this->drupalGet('admin/content/comment');
$this->assertRaw('comments['. $anonymous_comment3->id .']', t('Comment was published.'));
$this->assertRaw('comments[' . $anonymous_comment3->id . ']', t('Comment was published.'));
// Delete comment.
$this->performCommentOperation($anonymous_comment3, 'delete');
$this->drupalGet('admin/content/comment');
$this->assertNoRaw('comments['. $anonymous_comment3->id .']', t('Comment was deleted.'));
$this->assertNoRaw('comments[' . $anonymous_comment3->id . ']', t('Comment was deleted.'));
// Set anonymouse comments to require approval.
$this->setAnonymousUserComment(TRUE, FALSE);
......@@ -186,7 +186,7 @@ class CommentTestCase extends DrupalWebTestCase {
$this->performCommentOperation($anonymous_comment4, 'publish', TRUE);
$this->drupalLogout();
$this->drupalGet('node/'. $this->node->nid);
$this->drupalGet('node/' . $this->node->nid);
$this->assertTrue($this->commentExists($anonymous_comment4), t('Anonymous comment visible.'));
// Reset.
......@@ -213,7 +213,7 @@ class CommentTestCase extends DrupalWebTestCase {
}
if ($node !== NULL) {
$this->drupalGet('comment/reply/'. $node->nid);
$this->drupalGet('comment/reply/' . $node->nid);
}
if ($preview) {
......@@ -245,11 +245,11 @@ class CommentTestCase extends DrupalWebTestCase {
*/
function commentExists($comment, $reply = FALSE) {
if ($comment && is_object($comment)) {
$regex = '/'. ($reply ? '<div class="indented">(.*?)' : '');
$regex .= '<a id="comment-'. $comment->id .'"(.*?)'; // Comment anchor.
$regex = '/' . ($reply ? '<div class="indented">(.*?)' : '');
$regex .= '<a id="comment-' . $comment->id . '"(.*?)'; // Comment anchor.
$regex .= '<div(.*?)'; // Begin in comment div.
$regex .= $comment->subject .'(.*?)'; // Match subject.
$regex .= $comment->comment .'(.*?)'; // Match comment.
$regex .= $comment->subject . '(.*?)'; // Match subject.
$regex .= $comment->comment . '(.*?)'; // Match comment.
$regex .= '<\/div>/s'; // Dot matches newlines and ensure that match doesn't bleed outside comment div.
return preg_match($regex, $this->drupalGetContent());
......@@ -266,7 +266,7 @@ class CommentTestCase extends DrupalWebTestCase {
* Comment to delete.
*/
function deleteComment($comment) {
$this->drupalPost('comment/delete/'. $comment->id, array(), t('Delete'));
$this->drupalPost('comment/delete/' . $comment->id, array(), t('Delete'));
$this->assertText(t('The comment and all its replies have been deleted.'), t('Comment deleted.'));
}
......@@ -277,7 +277,7 @@ class CommentTestCase extends DrupalWebTestCase {
* Subject value.
*/
function setCommentSubject($enabled) {
$this->setCommentSettings('comment_subject_field', ($enabled ? '1' : '0'), 'Comment subject '. ($enabled ? 'enabled' : 'disabled') .'.');
$this->setCommentSettings('comment_subject_field', ($enabled ? '1' : '0'), 'Comment subject ' . ($enabled ? 'enabled' : 'disabled') . '.');
}
/**
......@@ -287,7 +287,7 @@ class CommentTestCase extends DrupalWebTestCase {
* Preview value.
*/
function setCommentPreview($required) {
$this->setCommentSettings('comment_preview', ($required ? '1' : '0'), 'Comment preview '. ($required ? 'required' : 'optional') .'.');
$this->setCommentSettings('comment_preview', ($required ? '1' : '0'), 'Comment preview ' . ($required ? 'required' : 'optional') . '.');
}
/**
......@@ -297,7 +297,7 @@ class CommentTestCase extends DrupalWebTestCase {
* Form value.
*/
function setCommentForm($enabled) {
$this->setCommentSettings('comment_form_location', ($enabled ? '1' : '3'), 'Comment controls '. ($enabled ? 'enabled' : 'disabled') .'.');
$this->setCommentSettings('comment_form_location', ($enabled ? '1' : '3'), 'Comment controls ' . ($enabled ? 'enabled' : 'disabled') . '.');
}
/**
......@@ -307,7 +307,7 @@ class CommentTestCase extends DrupalWebTestCase {
* Anonymous level.
*/
function setCommentAnonymous($level) {
$this->setCommentSettings('comment_anonymous', $level, 'Anonymous commenting set to level '. $level .'.');
$this->setCommentSettings('comment_anonymous', $level, 'Anonymous commenting set to level ' . $level . '.');
}
/**
......@@ -321,7 +321,7 @@ class CommentTestCase extends DrupalWebTestCase {
* Status message to display.
*/
function setCommentSettings($name, $value, $message) {
variable_set($name .'_story', $value);
variable_set($name . '_story', $value);
$this->assertTrue(TRUE, t($message)); // Display status message.
}
......@@ -339,7 +339,7 @@ class CommentTestCase extends DrupalWebTestCase {
$edit['1[post comments]'] = $enabled;
$edit['1[post comments without approval]'] = $without_approval;
$this->drupalPost('admin/user/permissions', $edit, t('Save permissions'));
$this->assertText(t('The changes have been saved.'), t('Anonymous user comments '. ($enabled ? 'enabled' : 'disabled') .'.'));
$this->assertText(t('The changes have been saved.'), t('Anonymous user comments ' . ($enabled ? 'enabled' : 'disabled') . '.'));
}
/**
......@@ -364,15 +364,15 @@ class CommentTestCase extends DrupalWebTestCase {
function performCommentOperation($comment, $operation, $approval = FALSE) {
$edit = array();
$edit['operation'] = $operation;
$edit['comments['. $comment->id .']'] = TRUE;
$this->drupalPost('admin/content/comment'. ($approval ? '/approval' : ''), $edit, t('Update'));
$edit['comments[' . $comment->id . ']'] = TRUE;
$this->drupalPost('admin/content/comment' . ($approval ? '/approval' : ''), $edit, t('Update'));
if ($operation == 'delete') {
$this->drupalPost(NULL, array(), t('Delete comments'));
$this->assertText(t('The comments have been deleted.'), t('Operation "'. $operation .'" was performed on comment.'));
$this->assertText(t('The comments have been deleted.'), t('Operation "' . $operation . '" was performed on comment.'));
}
else {
$this->assertText(t('The update has been performed.'), t('Operation "'. $operation .'" was performed on comment.'));
$this->assertText(t('The update has been performed.'), t('Operation "' . $operation . '" was performed on comment.'));
}
}
......@@ -386,7 +386,7 @@ class CommentTestCase extends DrupalWebTestCase {
*/
function getUnaprovedComment($subject) {
$this->drupalGet('admin/content/comment/approval');
preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>('. $subject .')/', $this->drupalGetContent(), $match);
preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->drupalGetContent(), $match);
return $match[2];
}
......
......@@ -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.