This information is from the code coverage report (see http://coverage.cwgordon.com/coverage).

We need to test:

1) Loading users from various services (hook_info + hook_auth)
2) Changing a user's roles
3) Deleting a blocked user's session
4) Submitting a username with an invalid character
5) User searching
6) All the user blocks
7) Updating users from the old to the new hashing algorithm
8) Permissions, roles, multiple roles, etc.
9) Signatures
10) All user actions.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

bardaqani’s picture

Assigned: Unassigned » bardaqani

I will do my hardest best to complete this test within the next two weeks.

mdupont’s picture

Component: tests » user.module
Assigned: bardaqani » Unassigned

Is this issue still active? The above URL gives me an error. By the way, if it is, it would still need some testing.

Dave Reid’s picture

The user role and permissions tests are being added in #300993: User roles and permissions API.

TommyK’s picture

From the list in the initial issue:

4) Submitting a username with an invalid character

Coverage seems to have been started, but all illegal characters do not seem to be tested. It only seems that the forward slash is tested for.

rgon’s picture

9) Signatures in the issue list above:

There appears to be no tests for existence or validity of signature in user.test

A test might include:
1) enabling of signatures
2) creation of new user
3) creation of valid and invalid signatures for user
4) enable comment module if not so
5) create comment to check that signature appears
6) remove comment and created user

Chris Charlton’s picture

Missing "Who's New" block test. (#6 on the list above)

Chris Charlton’s picture

No user search test committed yet. (#5 on the list above)

Chris Charlton’s picture

Test missing for creating a new role (for example: "test" user role), and assigning user(s) to that role. Also, multiple role needs to be accounted for.

It would be expected that the following would be in the test:
- Create new user.
- Create new role(s).
- Apply core permission(s) to the new role.
- ...
- revoke role from user
- remove role from site

sun.core’s picture

Priority: Critical » Normal

Albeit really needed, this is not critical.

webchick’s picture

Issue tags: +Needs tests

Tagging.

bleen’s picture

subscribe

bleen’s picture

Status: Active » Needs review

the attached patch has tests for the "who's new" block and for signatures...

There is one weirdness on signatures: The test I'm using works (user with signature can leave a comment and the comment will have the correct sig), but for some (inexplicable) reason I cannot seem to verify that the user has properly created a signature when filling out the profile form. To see what I'm referring to, please see the @todo in this patch. Un commenting that chunk *should* work, but it does not.

Any ideas on that? Once I get past that roadblock I will try to make a few more user tests

bleen’s picture

FileSize
3.44 KB

ooops ... forgot patch

Status: Needs review » Needs work

The last submitted patch, user_test.patch, failed testing.

bleen’s picture

Status: Needs work » Needs review

obviously this will fail testing ... I still need someone to review though

bleen’s picture

Status: Needs review » Needs work

Ignore comment #15 .. clearly I was drunk (aka meant to post that on another "Tests" issue I was working on)

looking at this error

bleen’s picture

Status: Needs work » Needs review

Turns out that this test found an error when using signatures: #699594: Comments throw error when user has a signature

Once that issue is fixed, the test in #13 *should* be working

bleen’s picture

FileSize
3.56 KB

This patch adds one more small test for signatures ... again, #699594: Comments throw error when user has a signature needs to be fixed before this patch will pass

Status: Needs review » Needs work

The last submitted patch, user-test.patch, failed testing.

bleen’s picture

Ok ... patch in #18 is waiting for #520760: SA-CORE-2009-007 user signature format to land before testbot will be happy with it

aspilicious’s picture

sub

Brandonian’s picture

Added a SimpleTest that creates a user and role from the api using user_save and user_role save, as well as removing the role with user_role_delete. As far as I understand what's supposed to be happening, the code in the test should pass, but two of the tests fail. These tests relate to the Role ID being returned from the database not returning as an int, as expected from user_role_delete. Additional eyes are welcome.

caelon’s picture

Status: Needs work » Needs review
FileSize
2.78 KB

Had to modify the patch as it had git-styled dates and was messing up the patching process. When I run this test it passes all.

pcarman’s picture

subscribing

jhurst’s picture

Status: Needs review » Reviewed & tested by the community

passed all tests

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs tests

The last submitted patch, 276582-additionalusertests-v2.patch, failed testing.

paulmckibben’s picture

Status: Needs work » Needs review
Issue tags: +Needs tests
stupiddingo’s picture

Status: Needs review » Reviewed & tested by the community

All 924 user tests passed for 276582-additionalusertests-v2.patch.

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Hm. I can't get this to apply cleanly. Can someone give it a re-roll?

aspilicious’s picture

I could apply it, problem possible caused by the /no newline at the end of the file.
Anyway: reroll

aspilicious’s picture

Status: Needs work » Needs review
bleen’s picture

Status: Needs review » Needs work
+++ modules/user/user.test	23 Apr 2010 08:43:03 -0000
@@ -1585,3 +1585,67 @@
+    ¶

white space issues

+++ modules/user/user.test	23 Apr 2010 08:43:03 -0000
@@ -1585,3 +1585,67 @@
+    $this->assertFalse(user_access('administer nodes', $myTestUser), t('User does not have permission to administer content.'));   ¶

more white space

+++ modules/user/user.test	23 Apr 2010 08:43:03 -0000
@@ -1585,3 +1585,67 @@
+    $perm = db_query('SELECT rid FROM {role_permission} WHERE rid = :rid AND permission = :permission',

I'm sure this is just something that I'm unfamiliar with, but why are we using ":" here and not "%"?

95 critical left. Go review some!

Brandonian’s picture

The ':uid' markup is what's in the database abstraction layer documentation.

http://drupal.org/node/310072

I understand that's how it was in D6, and if % signs are the correct way to go, I'll modify the code.

bleen’s picture

dont change it ... I just hadnt seen that syntax before. Based on the link you posted, it certainly seems correct. Still have white space issues thought ;)

Brandonian’s picture

Details, details... ;-)

Patch takes care of the white space issues in the new test. I'd like to run it through code review, but it screams when I try to enable in on HEAD.

bleen’s picture

Status: Needs work » Needs review

here testbot ... here boy

Brandonian’s picture

bump, easy review for somebody...

pcarman’s picture

Status: Needs review » Needs work

Looked over the patch at comment #35. The patch logic seems fine to me and test passes. The patch line numbers did not match up for me but was able to put in the changes. Although the variable names are camel case when I think they should be lower case with underscores. See the Drupal coding standard:

http://drupal.org/coding-standards#naming

This is a little confusing since objects are camel case in SimpleTest. Should this be changed? Looks like other test are using lower case with underscores for variable names.

mdupont’s picture

Status: Needs work » Fixed

Stumbled upon this old issue. AFAICS, all the tests listed in the original post can be found in user.test in D7. I assume the work was done and committed somewhere else, so I set this issue fixed.

Status: Fixed » Closed (fixed)
Issue tags: -Needs tests

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