We need to test the automatic closing of polls after a certain specified date/time.

Suggested assertions:
- Poll is initially active.
- Poll is still active after cron runs when it has not reached expiry point.
- Poll is inactive after cron runs after it has reached expiry point.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

r.villetet’s picture

Assigned: Unassigned » r.villetet

I'm interested in testing this testcase

mr.baileys’s picture

Component: tests » poll.module
Assigned: r.villetet » Unassigned
mr.baileys’s picture

Status: Active » Needs review
FileSize
3.71 KB

Attached is a test case for the poll auto-expire functionality. There's a slight bit of hacking required to change the "created" timestamp on the poll node so we can test expiration.

catch’s picture

Status: Needs review » Needs work

This looks great, the hack is entirely necessary, but some comments don't wrap at 80 characters.

mr.baileys’s picture

Status: Needs work » Needs review
FileSize
3.73 KB

Thanks, I've changed the comments so they don't exceed 80 characters, new patch attached...

catch’s picture

Status: Needs review » Reviewed & tested by the community

Looks great.

Status: Reviewed & tested by the community » Needs work

The last submitted patch failed testing.

lilou’s picture

Status: Needs work » Needs review

Setting to 'needs review' - testbot was broken.

lilou’s picture

FileSize
4.02 KB

Reroll now t() is removed in getinfo() : #500866: [META] remove t() from assert message

nbluto’s picture

Assigned: Unassigned » nbluto
nbluto’s picture

Status: Needs review » Reviewed & tested by the community

Updated Head at 1400 Pacific time. Applied patch and patch application was successful. Simple tests all passed on poll module in MAMP environment php 5.2.5 with fresh copy of Drupal 7 head. Functional test of Suggested assertions:
- Poll is initially active.
- Poll is still active after cron runs when it has not reached expiry point.
- Poll is inactive after cron runs after it has reached expiry point.

also worked.

TommyK’s picture

Reporting same as comment #11.

With patch from comment #9, MAMP, PHP 2.5.6, Drupal 7 HEAD.

Requirements from initial issue work great!

nbluto’s picture

Assigned: nbluto » Unassigned
bangalos’s picture

Status: Reviewed & tested by the community » Needs review

SimpleTest on Patch is failing - unreliably. First time, I got 53 errors. Second time, I got 1 error. Third time I got 4 errors. Each time, the error was different.

My Environment: Linux (Fedora) - Apache - Mysql(5.0.45) - Php(5.2.4). I did a fresh install of drupalHEAD at 1500 Hrs - pacific time, installed the patch and applied.

Note: Actual functionality works! So, I was able to create a poll, populate it, see the poll get populated, expire it and see the poll get expired. - So, the functionality being patched is working but Simpletest is failing sporadically.

nbluto’s picture

Assigned: Unassigned » nbluto
Status: Needs review » Reviewed & tested by the community

Updated Head at 1400 Pacific time. Applied patch and patch application was successful. Simple tests all passed on poll module in MAMP environment php 5.2.5 with fresh copy of Drupal 7 head. Functional test of Suggested assertions:
- Poll is initially active.
- Poll is still active after cron runs when it has not reached expiry point.
- Poll is inactive after cron runs after it has reached expiry point.

also worked.

cwgordon7’s picture

Status: Reviewed & tested by the community » Needs work
+++ modules/poll/poll.test	19 Jul 2009 13:11:44 -0000
@@ -359,3 +359,65 @@ class PollJSAddChoice extends DrupalWebT
+    $this->assertTrue(isset($elements[0]) && !empty($elements[0]['checked']), t('Poll has expired.'), t('Poll'));  }

The closing bracket should go on its own line.

mr.baileys’s picture

Assigned: nbluto » Unassigned
Status: Needs work » Needs review
FileSize
3.75 KB

Fixed coding style issue indentified in #16.

Status: Needs review » Needs work

The last submitted patch failed testing.

sun.core’s picture

Status: Needs work » Needs review
webchick’s picture

Sorry. :\

Status: Needs review » Needs work

The last submitted patch failed testing.

Status: Needs work » Needs review

grndlvl requested that failed test be re-tested.

mr.baileys’s picture

bump

Re-test of 295990_poll_expiration.patch from comment #17 was requested by aspilicious.

Status: Needs review » Needs work

The last submitted patch, 295990_poll_expiration.patch, failed testing.

Status: Needs work » Needs review

Re-test of 295990_poll_expiration.patch from comment #17 was requested by mr.baileys.

aspilicious’s picture

Green again...
Strange patch/bot issues

sun.core’s picture

Priority: Critical » Normal

Sorry, but tests don't qualify as critical anymore.

Stevel’s picture

#17: 295990_poll_expiration.patch queued for re-testing.

Lets see if this patch still applies and works. If so, this is ready for rtbc to me.

Stevel’s picture

Status: Needs review » Reviewed & tested by the community

Still good, rtbc after almost a year :)

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Looks good. Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.