function ShoutboxUserAccessTest::setUp in Shoutbox 5
Same name and namespace in other branches
- 6 tests/shoutbox_user_access.test \ShoutboxUserAccessTest::setUp()
File
- tests/
shoutbox_user_access.test, line 48 - shoutbox unit test for shoutbox_user_access and shoutbox_is_user_owned
Class
- ShoutboxUserAccessTest
- @file shoutbox unit test for shoutbox_user_access and shoutbox_is_user_owned
Code
function setUp() {
// TODO: Put your code here.
// enable module
$this
->drupalModuleEnable('shoutbox');
// enable nickname field
$this
->drupalVariableSet('shoutbox_shownamefield', 1);
$permissions = array(
'post shouts',
'delete own shouts',
'edit own shouts',
);
$basic_user = $this
->drupalCreateUserRolePerm($permissions);
// unmoderated permission
$permissions[] = 'post shouts without approval';
$unmoderated_user = $this
->drupalCreateUserRolePerm($permissions);
$permissions = array(
'administer shoutbox',
);
$admin_user = $this
->drupalCreateUserRolePerm($permissions);
$permissions = array(
'moderate shoutbox',
);
$moderator = $this
->drupalCreateUserRolePerm($permissions);
// Assign users to their test suite-wide properties.
$this->basic_user = $basic_user;
$this->unmoderated_user = $unmoderated_user;
$this->admin_user = $admin_user;
$this->moderator = $moderator;
// Always call the setUp() function from the parent class.
parent::setUp();
}