Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We need to test anonymous users voting on polls.
Suggested assertions:
- Votes by anonymous users are recorded if they are allowed.
- Anonymous users may not vote more than once.
Comment | File | Size | Author |
---|---|---|---|
#3 | anonymous_user_poll_test_v2.patch | 5.62 KB | sasconsul |
#1 | anonymous_user_poll_test.patch | 5.21 KB | frega |
Comments
Comment #1
frega CreditAttribution: frega commentedPatch testing anonymous voting attached. It's perhaps a bit verbose, feel free to cull :) - feedback appreciated.
Comment #2
sasconsul CreditAttribution: sasconsul commentedAll 153 passes ran in my install running in XAMPP with PHP 5.2.6 .
Comment #3
sasconsul CreditAttribution: sasconsul commentedFolks,
I looked into adding some tests to poll and came up with a way to complete one of the @todo tests for the anonymous poll.
I have also made a new function to assert the vote count of the first poll item.
I hope this helps,
Stuart
Comment #4
jhedstromCode formatting needs some work (text and variables concatenated should have spaces between the ' and the ".", associative array declarations need spaces on either side of the "=>"). Comments should be capitalized-sentences ending with punctuation.
In this section:
You don't need to call drupalGet() again after asserting the response.
Also, if this patch goes in after #300993: User roles and permissions API then the section for granting the permission can be reduced to
Doxygen comments probably shouldn't be self-referencing:
Instead, a simple explanation of the types of tests contained in the function would suffice.
Comment #5
Dave ReidComment #6
catchMoving this out of the critical bugs queue - see #607038: Meta issue: fix gaps in code coverage.
Comment #7
amateescu CreditAttribution: amateescu commentedAnonymous voting seems to be tested quite extensively now.. closing this old issue :)