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 { ...@@ -111,7 +111,7 @@ class RegistryParseFilesTestCase extends DrupalWebTestCase {
} }
// Test that we have the right md5. // Test that we have the right md5.
$md5 = db_result(db_query("SELECT md5 FROM {registry_file} WHERE filename = '%s'", './' . $this->$fileType->fileName)); $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 { ...@@ -34,7 +34,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
* @param object $feed Feed object representing the feed. * @param object $feed Feed object representing the feed.
*/ */
function deleteFeed($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.')); $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 { ...@@ -45,7 +45,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
*/ */
function getFeedEditArray() { function getFeedEditArray() {
$feed_name = $this->randomName(10, self::$prefix); $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( $edit = array(
'title' => $feed_name, 'title' => $feed_name,
'url' => $feed_url, 'url' => $feed_url,
...@@ -69,7 +69,7 @@ class AggregatorTestCase extends DrupalWebTestCase { ...@@ -69,7 +69,7 @@ class AggregatorTestCase extends DrupalWebTestCase {
$feed_count = $feed_count > 10 ? 10 : $feed_count; $feed_count = $feed_count > 10 ? 10 : $feed_count;
// Refresh the feed (simulated link click). // 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. // Ensure we have the right number of items.
$result = db_query('SELECT iid FROM {aggregator_item} WHERE fid = %d', $feed->fid); $result = db_query('SELECT iid FROM {aggregator_item} WHERE fid = %d', $feed->fid);
...@@ -141,7 +141,7 @@ class AddFeedTestCase extends AggregatorTestCase { ...@@ -141,7 +141,7 @@ class AddFeedTestCase extends AggregatorTestCase {
$this->assertTrue($this->uniqueFeed($feed->title, $feed->url), t('The feed is unique.')); $this->assertTrue($this->uniqueFeed($feed->title, $feed->url), t('The feed is unique.'));
// Check feed source. // Check feed source.
$this->drupalGet('aggregator/sources/'. $feed->fid); $this->drupalGet('aggregator/sources/' . $feed->fid);
$this->assertResponse(200, t('Feed source exists.')); $this->assertResponse(200, t('Feed source exists.'));
$this->assertText($feed->title, t('Page title')); $this->assertText($feed->title, t('Page title'));
...@@ -171,7 +171,7 @@ class UpdateFeedTestCase extends AggregatorTestCase { ...@@ -171,7 +171,7 @@ class UpdateFeedTestCase extends AggregatorTestCase {
// Get new feed data array and modify newly created feed. // Get new feed data array and modify newly created feed.
$edit = $this->getFeedEditArray(); $edit = $this->getFeedEditArray();
$edit['refresh'] = 1800; // Change refresh value. $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']))); $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. // Check feed data.
...@@ -179,7 +179,7 @@ class UpdateFeedTestCase extends AggregatorTestCase { ...@@ -179,7 +179,7 @@ class UpdateFeedTestCase extends AggregatorTestCase {
$this->assertTrue($this->uniqueFeed($edit['title'], $edit['url']), t('The feed is unique.')); $this->assertTrue($this->uniqueFeed($edit['title'], $edit['url']), t('The feed is unique.'));
// Check feed source. // Check feed source.
$this->drupalGet('aggregator/sources/'. $feed->fid); $this->drupalGet('aggregator/sources/' . $feed->fid);
$this->assertResponse(200, t('Feed source exists.')); $this->assertResponse(200, t('Feed source exists.'));
$this->assertText($edit['title'], t('Page title')); $this->assertText($edit['title'], t('Page title'));
...@@ -211,7 +211,7 @@ class RemoveFeedTestCase extends AggregatorTestCase { ...@@ -211,7 +211,7 @@ class RemoveFeedTestCase extends AggregatorTestCase {
$this->deleteFeed($feed); $this->deleteFeed($feed);
// Check feed source. // 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.')); $this->assertResponse(404, t('Deleted feed source does not exists.'));
// Check database for feed. // Check database for feed.
......
...@@ -45,7 +45,7 @@ class BlockTestCase extends DrupalWebTestCase { ...@@ -45,7 +45,7 @@ class BlockTestCase extends DrupalWebTestCase {
// Set the created box to a specific region. // Set the created box to a specific region.
// TODO: Implement full region checking. // TODO: Implement full region checking.
$edit = array(); $edit = array();
$edit['block_'. $bid .'[region]'] = 'left'; $edit['block_' . $bid . '[region]'] = 'left';
$this->drupalPost('admin/build/block', $edit, t('Save blocks')); $this->drupalPost('admin/build/block', $edit, t('Save blocks'));
// Confirm that the box was moved to the proper region. // Confirm that the box was moved to the proper region.
...@@ -55,7 +55,7 @@ class BlockTestCase extends DrupalWebTestCase { ...@@ -55,7 +55,7 @@ class BlockTestCase extends DrupalWebTestCase {
$this->assertText(t($box['title']), t('Box successfully being displayed on the page.')); $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. // 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->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.')); $this->assertNoText(t($box['title']), t('Box no longer appears on page.'));
} }
...@@ -71,7 +71,7 @@ class BlockTestCase extends DrupalWebTestCase { ...@@ -71,7 +71,7 @@ class BlockTestCase extends DrupalWebTestCase {
$block['title'] = $this->randomName(8); $block['title'] = $this->randomName(8);
// Set block title to confirm that interface works and override any custom titles. // 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.')); $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']))); $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 { ...@@ -80,7 +80,7 @@ class BlockTestCase extends DrupalWebTestCase {
// Set the created block to a specific region. // Set the created block to a specific region.
$edit = array(); $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->drupalPost('admin/build/block', $edit, t('Save blocks'));
// Confirm that the block was moved to the proper region. // Confirm that the block was moved to the proper region.
...@@ -92,7 +92,7 @@ class BlockTestCase extends DrupalWebTestCase { ...@@ -92,7 +92,7 @@ class BlockTestCase extends DrupalWebTestCase {
// Set the block to the disabled region. // Set the block to the disabled region.
$edit = array(); $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')); $this->drupalPost('admin/build/block', $edit, t('Save blocks'));
// Confirm that the block was moved to the proper region. // Confirm that the block was moved to the proper region.
...@@ -101,11 +101,11 @@ class BlockTestCase extends DrupalWebTestCase { ...@@ -101,11 +101,11 @@ class BlockTestCase extends DrupalWebTestCase {
// For convenience of developers, put the navigation block back. // For convenience of developers, put the navigation block back.
$edit = array(); $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->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->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.')); $this->assertText(t('The block configuration has been saved.'), t('Block title set.'));
} }
} }
...@@ -100,7 +100,7 @@ class BlogTestCase extends DrupalWebTestCase { ...@@ -100,7 +100,7 @@ class BlogTestCase extends DrupalWebTestCase {
if ($response2 == 200) { if ($response2 == 200) {
$this->assertTitle(t('Blog | Drupal'), t('Blog help node was displayed')); $this->assertTitle(t('Blog | Drupal'), t('Blog help node was displayed'));
$this->assertText(t('Blog'), 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. // Verify the blog block was displayed.
...@@ -109,17 +109,17 @@ class BlogTestCase extends DrupalWebTestCase { ...@@ -109,17 +109,17 @@ class BlogTestCase extends DrupalWebTestCase {
$this->assertText(t('Recent blog posts'), t('Blog block was displayed')); $this->assertText(t('Recent blog posts'), t('Blog block was displayed'));
// View blog node. // View blog node.
$this->drupalGet('node/'. $node->nid); $this->drupalGet('node/' . $node->nid);
$this->assertResponse(200); $this->assertResponse(200);
$this->assertTitle($node->title. ' | Drupal', t('Blog node was displayed')); $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. // View blog edit node.
$this->drupalGet('node/'. $node->nid .'/edit'); $this->drupalGet('node/' . $node->nid . '/edit');
$this->assertResponse($response); $this->assertResponse($response);
if ($response == 200) { if ($response == 200) {
$this->assertTitle($node->title. ' | Drupal', t('Blog edit node was displayed')); $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) { if ($response == 200) {
...@@ -127,11 +127,11 @@ class BlogTestCase extends DrupalWebTestCase { ...@@ -127,11 +127,11 @@ class BlogTestCase extends DrupalWebTestCase {
$edit = array(); $edit = array();
$edit['title'] = 'node/' . $node->nid; $edit['title'] = 'node/' . $node->nid;
$edit['body'] = $this->randomName(256); $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')); $this->assertRaw(t('Blog entry %title has been updated.', array('%title' => $edit['title'])), t('Blog node was edited'));
// Delete blog node. // 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->assertResponse($response);
$this->assertRaw(t('Blog entry %title has been deleted.', array('%title' => $edit['title'])), t('Blog node was deleted')); $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 { ...@@ -147,7 +147,7 @@ class BlogTestCase extends DrupalWebTestCase {
$crumb = '›'; $crumb = '›';
// Confirm blog entries link exists on the user page. // Confirm blog entries link exists on the user page.
$this->drupalGet('user/'. $user->uid); $this->drupalGet('user/' . $user->uid);
$this->assertResponse(200); $this->assertResponse(200);
$this->assertText(t('View recent blog entries'), t('View recent blog entries link was displayed')); $this->assertText(t('View recent blog entries'), t('View recent blog entries link was displayed'));
...@@ -162,16 +162,16 @@ class BlogTestCase extends DrupalWebTestCase { ...@@ -162,16 +162,16 @@ class BlogTestCase extends DrupalWebTestCase {
$this->assertText(t('Home'), t('Breadcrumbs were displayed')); $this->assertText(t('Home'), t('Breadcrumbs were displayed'));
// Confirm a blog page was displayed per user. // 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->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. // Confirm a blog feed was displayed.
$this->drupalGet('blog/feed'); $this->drupalGet('blog/feed');
$this->assertTitle(t('Drupal blogs'), t('Blog feed was displayed')); $this->assertTitle(t('Drupal blogs'), t('Blog feed was displayed'));
// Confirm a blog feed was displayed per user. // 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')); $this->assertTitle(t("@name's blog", array('@name' => $user->name)), t('User blog feed was displayed'));
} }
} }
...@@ -75,7 +75,7 @@ class BlogAPITestCase extends DrupalWebTestCase { ...@@ -75,7 +75,7 @@ class BlogAPITestCase extends DrupalWebTestCase {
$file = current($this->drupalGetTestFiles('text')); $file = current($this->drupalGetTestFiles('text'));
$file_contents = file_get_contents($file->filename); $file_contents = file_get_contents($file->filename);
$file = array(); $file = array();
$file['name'] = $this->randomName() .'.txt'; $file['name'] = $this->randomName() . '.txt';
$file['type'] = 'text'; $file['type'] = 'text';
$file['bits'] = xmlrpc_base64($file_contents); $file['bits'] = xmlrpc_base64($file_contents);
$result = xmlrpc($local, 'metaWeblog.newMediaObject', $blog_id, $web_user->name, $web_user->pass_raw, $file); $result = xmlrpc($local, 'metaWeblog.newMediaObject', $blog_id, $web_user->name, $web_user->pass_raw, $file);
...@@ -146,7 +146,7 @@ class BlogAPITestCase extends DrupalWebTestCase { ...@@ -146,7 +146,7 @@ class BlogAPITestCase extends DrupalWebTestCase {
function addTerm($vid, $term) { function addTerm($vid, $term) {
$edit = array(); $edit = array();
$edit['name'] = $term; $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.')); $this->assertRaw(t('Created new term %term.', array('%term' => $edit['name'])), t('Taxonomy term added.'));
$tree = taxonomy_get_tree($vid); $tree = taxonomy_get_tree($vid);
......
This diff is collapsed.
...@@ -44,7 +44,7 @@ class ContactTestCase extends DrupalWebTestCase { ...@@ -44,7 +44,7 @@ class ContactTestCase extends DrupalWebTestCase {
$invalid_recipients = array('invalid', 'invalid@', /*'invalid@site', 'invalid@site.',*/ '@site.', '@site.com'); $invalid_recipients = array('invalid', 'invalid@', /*'invalid@site', 'invalid@site.',*/ '@site.', '@site.com');
foreach ($invalid_recipients as $invalid_recipient) { foreach ($invalid_recipients as $invalid_recipient) {
$this->addCategory($this->randomName(16), $invalid_recipient, '', FALSE); $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. // Create valid categories.
...@@ -132,7 +132,7 @@ class ContactTestCase extends DrupalWebTestCase { ...@@ -132,7 +132,7 @@ class ContactTestCase extends DrupalWebTestCase {
$this->drupalLogin($web_user1); $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.')); $this->assertResponse(200, t('Access to personal contact form granted.'));
$edit = array(); $edit = array();
...@@ -160,7 +160,7 @@ class ContactTestCase extends DrupalWebTestCase { ...@@ -160,7 +160,7 @@ class ContactTestCase extends DrupalWebTestCase {
$this->drupalLogin($web_user3); $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.')); $this->assertResponse(403, t('Access to personal contact form denied.'));
} }
...@@ -207,7 +207,7 @@ class ContactTestCase extends DrupalWebTestCase { ...@@ -207,7 +207,7 @@ class ContactTestCase extends DrupalWebTestCase {
$categories = $this->getCategories(); $categories = $this->getCategories();
foreach ($categories as $category) { foreach ($categories as $category) {
$category_name = db_result(db_query('SELECT category FROM {contact} WHERE cid = %d', array($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.')); $this->assertRaw(t('Category %category has been deleted.', array('%category' => $category_name)), t('Category deleted sucessfully.'));
} }
} }
...@@ -236,13 +236,13 @@ class ContactTestCase extends DrupalWebTestCase { ...@@ -236,13 +236,13 @@ class ContactTestCase extends DrupalWebTestCase {
// Get role id (rid) for specified role. // Get role id (rid) for specified role.
$rid = db_result(db_query("SELECT rid FROM {role} WHERE name = '%s'", array($role))); $rid = db_result(db_query("SELECT rid FROM {role} WHERE name = '%s'", array($role)));
if ($rid === FALSE) { if ($rid === FALSE) {
$this->fail(t(' [permission] Role "'. $role .'" not found.')); $this->fail(t(' [permission] Role "' . $role . '" not found.'));
} }
// Create edit array from permission. // Create edit array from permission.
$edit = array(); $edit = array();
foreach ($permissions as $name => $value) { foreach ($permissions as $name => $value) {
$edit[$rid .'['. $name .']'] = $value; $edit[$rid . '[' . $name . ']'] = $value;
} }
$this->drupalPost('admin/user/permissions', $edit, t('Save permissions')); $this->drupalPost('admin/user/permissions', $edit, t('Save permissions'));
......
...@@ -108,7 +108,7 @@ class DBLogTestCase extends DrupalWebTestCase { ...@@ -108,7 +108,7 @@ class DBLogTestCase extends DrupalWebTestCase {
); );
$message = 'Log entry added to test the dblog row limit.'; $message = 'Log entry added to test the dblog row limit.';
for ($i = 0; $i < $count; $i++) { for ($i = 0; $i < $count; $i++) {
$log['message'] = $i. ' => ' .$message; $log['message'] = $i . ' => ' . $message;
dblog_watchdog($log); dblog_watchdog($log);
} }
} }
...@@ -139,14 +139,14 @@ class DBLogTestCase extends DrupalWebTestCase { ...@@ -139,14 +139,14 @@ class DBLogTestCase extends DrupalWebTestCase {
$this->drupalGet('admin/reports/page-not-found'); $this->drupalGet('admin/reports/page-not-found');
$this->assertResponse($response); $this->assertResponse($response);
if ($response == 200) { 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. // View dblog access-denied report node.
$this->drupalGet('admin/reports/access-denied'); $this->drupalGet('admin/reports/access-denied');
$this->assertResponse($response); $this->assertResponse($response);
if ($response == 200) { 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. // View dblog event node.
...@@ -184,7 +184,7 @@ class DBLogTestCase extends DrupalWebTestCase { ...@@ -184,7 +184,7 @@ class DBLogTestCase extends DrupalWebTestCase {
// Add user using form to generate add user event (which is not triggered by drupalCreateUser). // Add user using form to generate add user event (which is not triggered by drupalCreateUser).
$edit = array(); $edit = array();
$edit['name'] = $name; $edit['name'] = $name;
$edit['mail'] = $name .'@example.com'; $edit['mail'] = $name . '@example.com';
$edit['pass[pass1]'] = $pass; $edit['pass[pass1]'] = $pass;
$edit['pass[pass2]'] = $pass; $edit['pass[pass2]'] = $pass;
$edit['status'] = 1; $edit['status'] = 1;
...@@ -252,7 +252,7 @@ class DBLogTestCase extends DrupalWebTestCase { ...@@ -252,7 +252,7 @@ class DBLogTestCase extends DrupalWebTestCase {
*/ */
private function doNode($type) { private function doNode($type) {
// Create user. // 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); $user = $this->drupalCreateUser($perm);
// Login user. // Login user.
$this->drupalLogin($user); $this->drupalLogin($user);
...@@ -260,20 +260,20 @@ class DBLogTestCase extends DrupalWebTestCase { ...@@ -260,20 +260,20 @@ class DBLogTestCase extends DrupalWebTestCase {
// Create node using form to generate add content event (which is not triggered by drupalCreateNode). // Create node using form to generate add content event (which is not triggered by drupalCreateNode).
$edit = $this->getContent($type); $edit = $this->getContent($type);
$title = $edit['title']; $title = $edit['title'];
$this->drupalPost('node/add/'. $type, $edit, t('Save')); $this->drupalPost('node/add/' . $type, $edit, t('Save'));
$this->assertResponse(200); $this->assertResponse(200);
// Retrieve node object. // Retrieve node object.
$node = node_load(array('title' => $title)); $node = node_load(array('title' => $title));
$this->assertTrue($node != null, t('Node @title was loaded', array('@title' => $title))); $this->assertTrue($node != null, t('Node @title was loaded', array('@title' => $title)));
// Edit node. // Edit node.
$edit = $this->getContentUpdate($type); $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); $this->assertResponse(200);
// Delete node. // Delete node.
$this->drupalPost('node/'. $node->nid .'/delete', array(), t('Delete')); $this->drupalPost('node/' . $node->nid . '/delete', array(), t('Delete'));
$this->assertResponse(200); $this->assertResponse(200);
// View node (to generate page not found event). // View node (to generate page not found event).
$this->drupalGet('node/'. $node->nid); $this->drupalGet('node/' . $node->nid);
$this->assertResponse(404); $this->assertResponse(404);
// View the dblog report (to generate access denied event). // View the dblog report (to generate access denied event).
$this->drupalGet('admin/reports/dblog'); $this->drupalGet('admin/reports/dblog');
......
...@@ -39,7 +39,7 @@ class FilterAdminTestCase extends DrupalWebTestCase { ...@@ -39,7 +39,7 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Add an additional tag. // Add an additional tag.
$edit = array(); $edit = array();
$edit['allowed_html_1'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>' . ' <quote>'; // Adding <quote> tag. $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->assertText(t('The configuration options have been saved.'), t('Allowed HTML tag added.'));
$this->assertRaw(htmlentities($edit['allowed_html_1']), t('Tag displayed.')); $this->assertRaw(htmlentities($edit['allowed_html_1']), t('Tag displayed.'));
...@@ -49,8 +49,8 @@ class FilterAdminTestCase extends DrupalWebTestCase { ...@@ -49,8 +49,8 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Reorder filters. // Reorder filters.
$edit = array(); $edit = array();
$edit['weights[filter/' . $second_filter .']'] = 1; $edit['weights[filter/' . $second_filter . ']'] = 1;
$edit['weights[filter/' . $first_filter .']'] = 2; $edit['weights[filter/' . $first_filter . ']'] = 2;
$this->drupalPost('admin/settings/filters/' . $filtered . '/order', $edit, t('Save configuration')); $this->drupalPost('admin/settings/filters/' . $filtered . '/order', $edit, t('Save configuration'));
$this->assertText(t('The filter ordering has been saved.'), t('Order saved successfully.')); $this->assertText(t('The filter ordering has been saved.'), t('Order saved successfully.'));
...@@ -131,7 +131,7 @@ class FilterAdminTestCase extends DrupalWebTestCase { ...@@ -131,7 +131,7 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Allowed tags. // Allowed tags.
$edit = array(); $edit = array();
$edit['allowed_html_1'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>'; $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.')); $this->assertText(t('The configuration options have been saved.'), t('Changes reverted.'));
// Full HTML. // Full HTML.
...@@ -142,9 +142,9 @@ class FilterAdminTestCase extends DrupalWebTestCase { ...@@ -142,9 +142,9 @@ class FilterAdminTestCase extends DrupalWebTestCase {
// Filter order. // Filter order.
$edit = array(); $edit = array();
$edit['weights[filter/' . $second_filter .']'] = 2; $edit['weights[filter/' . $second_filter . ']'] = 2;
$edit['weights[filter/' . $first_filter .']'] = 1; $edit['weights[filter/' . $first_filter . ']'] = 1;
$this->drupalPost('admin/settings/filters/' . $filtered .'/order', $edit, t('Save configuration')); $this->drupalPost('admin/settings/filters/' . $filtered . '/order', $edit, t('Save configuration'));
$this->assertText(t('The filter ordering has been saved.'), t('Order successfully reverted.')); $this->assertText(t('The filter ordering has been saved.'), t('Order successfully reverted.'));
} }
...@@ -269,7 +269,7 @@ END; ...@@ -269,7 +269,7 @@ END;
$edit['type'] = 'page'; $edit['type'] = 'page';
$page = $this->drupalCreateNode($edit); $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="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="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.')); $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 { ...@@ -96,7 +96,7 @@ class ForumTestCase extends DrupalWebTestCase {
// Add forum to navigation menu. // Add forum to navigation menu.
$edit = array(); $edit = array();
$edit['mlid:'. $mlid .'[hidden]'] = TRUE; $edit['mlid:' . $mlid . '[hidden]'] = TRUE;
$this->drupalPost('admin/build/menu-customize/navigation', $edit, t('Save configuration')); $this->drupalPost('admin/build/menu-customize/navigation', $edit, t('Save configuration'));
$this->assertResponse(200); $this->assertResponse(200);
...@@ -134,7 +134,7 @@ class ForumTestCase extends DrupalWebTestCase { ...@@ -134,7 +134,7 @@ class ForumTestCase extends DrupalWebTestCase {
); );
// Edit the vocabulary. // 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->assertResponse(200);
$this->assertRaw(t('Updated vocabulary %name.', array('%name' => $title)), t('Vocabulary was edited')); $this->assertRaw(t('Updated vocabulary %name.', array('%name' => $title)), t('Vocabulary was edited'));
...@@ -158,7 +158,7 @@ class ForumTestCase extends DrupalWebTestCase { ...@@ -158,7 +158,7 @@ class ForumTestCase extends DrupalWebTestCase {
); );
// Edit the vocabulary. // 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->assertResponse(200);
$this->assertRaw(t('Updated vocabulary %name.', array('%name' => $title)), t('Vocabulary was edited')); $this->assertRaw(t('Updated vocabulary %name.', array('%name' => $title)), t('Vocabulary was edited'));
/* /*
...@@ -191,19 +191,19 @@ class ForumTestCase extends DrupalWebTestCase { ...@@ -191,19 +191,19 @@ class ForumTestCase extends DrupalWebTestCase {
); );
// Create forum. // 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); $this->assertResponse(200);
$type = ($type == 'container') ? 'forum container' : 'forum'; $type = ($type == 'container') ? 'forum container' : 'forum';