Poll functionality testing

chx - December 31, 2007 - 01:37
Project:SimpleTest
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed
Description

This is what I have so far. Works but there are two artefacts a) more choices do not work because of the way simpletest gets the page before posting it b) for some reason when testing poll votes, seems the system gets so happy over the relative success that it runs testPollCreate again. Fixing either is beyond me, so I hope Rok will take this over. Note this a Drupal-friendly test so some core bugs have been harmed while writing this :D

AttachmentSize
poll_module.test2.9 KB

#1

Rok Žlender - December 31, 2007 - 09:36

I fixed a . Will take a look at b later.
There is no need to delete poll at the end as tearDown cleans up.

AttachmentSize
poll_module.test2.59 KB

#2

Rok Žlender - December 31, 2007 - 09:38
Status:patch (code needs review)» patch (code needs work)

#3

chx - December 31, 2007 - 10:16

I thought tearDown cleans up users and roles but not nodes.

#4

chx - December 31, 2007 - 10:42

Your solution is simply ugly. Now I know how, I have a much better way: reusable and of course properly documented.

AttachmentSize
poll_test.patch4.65 KB

#5

chx - December 31, 2007 - 11:40

After http://drupal.org/node/204996#comment-674432 will get in, the create test will work.

AttachmentSize
poll_test.patch4.87 KB

#6

chx - December 31, 2007 - 12:21
Status:patch (code needs work)» patch (code needs review)

Though B) remains now this is rather complete and I see nodes deleted created by the users to be cleaned up. Great. But then why are there two node_delete calls and with wrong arguments?

AttachmentSize
poll_test.patch5.62 KB

#7

chx - December 31, 2007 - 14:19

Debug stuff removed.

AttachmentSize
poll_test.patch5.42 KB

#8

chx - January 1, 2008 - 18:20
Version:5.x-1.x-dev» 6.x-1.x-dev

#9

Rok Žlender - January 3, 2008 - 11:28

I made some changes to simpletest http://drupal.org/node/205892 which would help this test. First apply patch in http://drupal.org/node/205892 and then run this one.

AttachmentSize
poll_module.test_.patch3.27 KB

#10

Rok Žlender - January 5, 2008 - 10:26
Status:patch (code needs review)» fixed

Committed by accident in http://drupal.org/cvs?commit=94254 but it was good to go anyway.

#11

Anonymous - January 19, 2008 - 10:31
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.