Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
933be163
Commit
933be163
authored
Sep 09, 2009
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Patch
#550210
by boombatower: added test for admin/people/create.
parent
e85ba397
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
modules/user/user.test
modules/user/user.test
+46
-0
No files found.
modules/user/user.test
View file @
933be163
...
...
@@ -1208,6 +1208,52 @@ class UserSaveTestCase extends DrupalWebTestCase {
}
}
/**
* Test the create user administration page.
*/
class
UserCreateTestCase
extends
DrupalWebTestCase
{
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'User create'
,
'description'
=>
'Test the creat user administration page.'
,
'group'
=>
'User'
,
);
}
/**
* Create a user through the administration interface and ensure that it
* displays in the user list.
*/
protected
function
testUserAdd
()
{
$user
=
$this
->
drupalCreateUser
(
array
(
'administer users'
));
$this
->
drupalLogin
(
$user
);
foreach
(
array
(
FALSE
,
TRUE
)
as
$notify
)
{
$edit
=
array
(
'name'
=>
$this
->
randomName
(),
'mail'
=>
$this
->
randomName
()
.
'@example.com'
,
'pass[pass1]'
=>
$pass
=
$this
->
randomString
(),
'pass[pass2]'
=>
$pass
,
'notify'
=>
$notify
,
);
$this
->
drupalPost
(
'admin/people/create'
,
$edit
,
t
(
'Create new account'
));
if
(
$notify
)
{
$this
->
assertText
(
t
(
'Password and further instructions have been e-mailed to the new user @name.'
,
array
(
'@name'
=>
$edit
[
'name'
])),
'User created'
);
$this
->
assertEqual
(
count
(
$this
->
drupalGetMails
()),
1
,
'Notification e-mail sent'
);
}
else
{
$this
->
assertText
(
t
(
'Created a new user account for @name. No e-mail has been sent.'
,
array
(
'@name'
=>
$edit
[
'name'
])),
'User created'
);
$this
->
assertEqual
(
count
(
$this
->
drupalGetMails
()),
0
,
'Notification e-mail not sent'
);
}
$this
->
drupalGet
(
'admin/people'
);
$this
->
assertText
(
$edit
[
'name'
],
'User found in list of users'
);
}
}
}
/**
* Test case to test user_save() behaviour.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment