summaryrefslogtreecommitdiff
path: root/modules/poll/poll.test
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-04-26 16:31:23 +0000
committerDries Buytaert <dries@buytaert.net>2009-04-26 16:31:23 +0000
commitf2cbf55033d0ed891df839d412547d6b28aeb35e (patch)
treed868efd67d7063bd844cc9954d6dfe0f9dc7d784 /modules/poll/poll.test
parent2a7c00bc4ae154d51a01bc0f1f59ce7d70126181 (diff)
downloadbrdo-f2cbf55033d0ed891df839d412547d6b28aeb35e.tar.gz
brdo-f2cbf55033d0ed891df839d412547d6b28aeb35e.tar.bz2
- Patch #440894 by brianV: code style and documentation clean-up.
Diffstat (limited to 'modules/poll/poll.test')
-rw-r--r--modules/poll/poll.test19
1 files changed, 12 insertions, 7 deletions
diff --git a/modules/poll/poll.test b/modules/poll/poll.test
index 6ff2a7825..a9bdea6cc 100644
--- a/modules/poll/poll.test
+++ b/modules/poll/poll.test
@@ -1,6 +1,11 @@
<?php
// $Id$
+/**
+ * @file
+ * Tests for the poll module.
+ */
+
class PollTestCase extends DrupalWebTestCase {
/**
@@ -25,7 +30,7 @@ class PollTestCase extends DrupalWebTestCase {
if (count($choices) > 2) {
// Re-submit the form while the choices are all in
- while($index < count($choices)) {
+ while ($index < count($choices)) {
$this->drupalPost(NULL, $edit, t('More choices'));
list($edit, $index) = $this->_pollGenerateEdit($title, $choices, $index);
}
@@ -33,7 +38,7 @@ class PollTestCase extends DrupalWebTestCase {
if ($test_preview) {
$this->drupalPost(NULL, $edit, t('Preview'));
- foreach($choices as $k => $choice_text) {
+ foreach ($choices as $k => $choice_text) {
$this->assertRaw($choice_text, t('Choice @choice found was in preview.', array('@choice' => $k)));
}
list($edit, $index) = $this->_pollGenerateEdit($title, $choices, $index);
@@ -55,10 +60,10 @@ class PollTestCase extends DrupalWebTestCase {
$edit = array(
'title' => $title
);
- foreach($already_submitted_choices as $k => $text) {
+ foreach ($already_submitted_choices as $k => $text) {
$edit['choice[chid:' . $k . '][chtext]'] = $text;
}
- foreach($new_choices as $k => $text) {
+ foreach ($new_choices as $k => $text) {
$edit['choice[new:' . $k . '][chtext]'] = $text;
}
return array($edit, count($already_submitted_choices) + count($new_choices));
@@ -66,7 +71,7 @@ class PollTestCase extends DrupalWebTestCase {
function _generateChoices($count = 7) {
$choices = array();
- for($i = 1; $i <= $count; $i++) {
+ for ($i = 1; $i <= $count; $i++) {
$choices[] = $this->randomName();
}
return $choices;
@@ -112,10 +117,10 @@ class PollVoteTestCase extends PollTestCase {
$this->drupalLogin($web_user);
// Record a vote for the first choice.
- $edit = array (
+ $edit = array(
'choice' => '1',
);
- $this->drupalPost('node/'. $poll_nid, $edit, t('Vote'));
+ $this->drupalPost('node/' . $poll_nid, $edit, t('Vote'));
$this->assertText('Your vote was recorded.', 'Your vote was recorded.');
$this->drupalGet("node/$poll_nid/votes");