## Class mr_fixture_role_assignment

Description

MR Fixture Group Member

- author: Mark Nielsen

Located in /fixture/role/assignment.php (line 37)

    mr_fixture_abstract
       |
       --mr_fixture_role_assignment

Variable Summary
context|mr_fixture_user|mr_fixture_course $context
array $options
mr_fixture_role $role
mr_fixture_user $user
Method Summary
mr_fixture_role_assignment __construct (mr_fixture_role $role, mr_fixture_user $user, context|mr_fixture_user|mr_fixture_course $context, [array|object $options = array()])
void build ()
void destroy ()
boolean exists ()
\context|mr_fixture_user|mr_fixture_course get_context ()
int get_contextid ()
mixed get_option ($name $name, [mixed $default = null])
array get_options ()
\mr_fixture_role get_role ()
\mr_fixture_user get_user ()
mr_fixture_role_assignment set_context (\context|mr_fixture_user|mr_fixture_course $context)
mr_fixture_role_assignment set_options (array|object $options)
mr_fixture_role_assignment set_role (\mr_fixture_role $role)
mr_fixture_role_assignment set_user (\mr_fixture_user $user)
Variables
context|mr_fixture_user|mr_fixture_course $context (line 51)

- access: protected

array $options = array() (line 58)

Properties to use for the role assignment

- access: protected

mr_fixture_role $role (line 46)

- access: protected

mr_fixture_user $user (line 41)

- access: protected

#### Inherited Variables

Inherited from mr_fixture_abstract

> mr_fixture_abstract::$results

Methods
Constructor __construct (line 66)

- access: public

mr_fixture_role_assignment __construct (mr_fixture_role $role, mr_fixture_user $user, context|mr_fixture_user|mr_fixture_course $context, [array|object $options = array()])

- mr_fixture_role $role: The role to assign
- mr_fixture_user $user: The user to use for the role assignment
- context|mr_fixture_user|mr_fixture_course $context: The context to use for the role assignment
- array|object $options: The options

Redefinition of:

mr_fixture_abstract::__construct()

build (line 82)

Create the fixture

This method must be safe to call multiple times.

- throws: moodle_exception
- access: public

void build ()
destroy (line 110)

Delete the fixture

This method must be safe to call multiple times.

- throws: moodle_exception
- access: public

void destroy ()
exists (line 128)

Determine if the fixture exists

- access: public

boolean exists ()
get_context (line 150)

- access: public

\context|mr_fixture_user|mr_fixture_course get_context ()
get_contextid (line 160)

Derive the context ID from the context varaible

- throws: coding_exception
- access: public

int get_contextid ()
get_option (line 205)

- access: public

mixed get_option ($name $name, [mixed $default = null])

- mixed $default
- $name $name

get_options (line 196)

Get the properties used for the role assignment

- access: public

array get_options ()
get_role (line 224)

- access: public

\mr_fixture_role get_role ()
get_user (line 240)

- access: public

\mr_fixture_user get_user ()
set_context (line 142)

- access: public

mr_fixture_role_assignment set_context (\context|mr_fixture_user|mr_fixture_course $context)

- \context|mr_fixture_user|mr_fixture_course $context

set_options (line 186)

Set properties to use for the role assignment

- access: public

mr_fixture_role_assignment set_options (array|object $options)

- array|object $options

set_role (line 216)

- access: public

mr_fixture_role_assignment set_role (\mr_fixture_role $role)

- \mr_fixture_role $role

set_user (line 232)

- access: public

mr_fixture_role_assignment set_user (\mr_fixture_user $user)

- \mr_fixture_user $user

#### Inherited Methods

Inherited From mr_fixture_abstract

> mr_fixture_abstract::__construct()
> mr_fixture_abstract::get()
> mr_fixture_abstract::get_results()
> mr_fixture_abstract::set_results()

Documentation generated on Thu, 28 Jun 2012 16:33:46 -0700 by phpDocumentor 1.4.3