## Class mr_fixture_enrollment

Description

MR Fixture Enrollment

- author: Mark Nielsen

Located in /fixture/enrollment.php (line 37)

    mr_fixture_abstract
       |
       --mr_fixture_enrollment

Variable Summary
mr_fixture_course $course
enrol_plugin $enroll
array $options
mr_fixture_role|null $role
mr_fixture_user $user
Method Summary
mr_fixture_enrollment __construct (mr_fixture_course $course, mr_fixture_user $user, [ $enroll = null], [mr_fixture_role $role = null], [array|object $options = array()])
void build ()
void destroy ()
boolean exists ()
stdClass fetch_enrollment_instance ()
\mr_fixture_course get_course ()
\enrol_plugin get_enroll ()
mixed get_option ($name $name, [mixed $default = null])
array get_options ()
\mr_fixture_role|null get_role ()
\mr_fixture_user get_user ()
mr_fixture_enrollment set_course (\mr_fixture_course $course)
mr_fixture_enrollment set_enroll (\enrol_plugin $enroll)
mr_fixture_user set_options (array|object $options)
mr_fixture_enrollment set_role (\mr_fixture_role|null $role)
mr_fixture_enrollment set_user (\mr_fixture_user $user)
Variables
mr_fixture_course $course (line 41)

- access: protected

enrol_plugin $enroll (line 56)

- access: protected

array $options = array() (line 63)

Parameters to pass to the enrol_plugin->enrol_user()

- access: protected

mr_fixture_role|null $role = null (line 51)

- access: protected

mr_fixture_user $user (line 46)

- access: protected

#### Inherited Variables

Inherited from mr_fixture_abstract

> mr_fixture_abstract::$results

Methods
Constructor __construct (line 72)

- access: public

mr_fixture_enrollment __construct (mr_fixture_course $course, mr_fixture_user $user, [ $enroll = null], [mr_fixture_role $role = null], [array|object $options = array()])

- mr_fixture_course $course: The course to enroll the user into
- mr_fixture_user $user: The user to enroll
- enrol_plugin $enroll: The enrollment plugin to use, defaults to enrol_get_plugin('manual')
- mr_fixture_role|null $role: The role to use for the enrollment, optional
- array|object $options: Parameters to pass to the enrol_plugin->enrol_user()

Redefinition of:

mr_fixture_abstract::__construct()

build (line 93)

Create the fixture

This method must be safe to call multiple times.

- throws: moodle_exception
- access: public

void build ()
destroy (line 133)

Delete the fixture

This method must be safe to call multiple times.

- throws: moodle_exception
- access: public

void destroy ()
exists (line 148)

Determine if the fixture exists

- access: public

boolean exists ()
fetch_enrollment_instance (line 163)

Find or create an enrollment instance record

- access: protected

stdClass fetch_enrollment_instance ()
get_course (line 186)

- access: public

\mr_fixture_course get_course ()
get_enroll (line 218)

- access: public

\enrol_plugin get_enroll ()
get_option (line 247)

- access: public

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

- mixed $default
- $name $name

get_options (line 238)

Get the properties used for the enrollment

- access: public

array get_options ()
get_role (line 266)

- access: public

\mr_fixture_role|null get_role ()
get_user (line 202)

- access: public

\mr_fixture_user get_user ()
set_course (line 178)

- access: public

mr_fixture_enrollment set_course (\mr_fixture_course $course)

- \mr_fixture_course $course

set_enroll (line 210)

- access: public

mr_fixture_enrollment set_enroll (\enrol_plugin $enroll)

- \enrol_plugin $enroll

set_options (line 228)

Set properties to use for the enrollment

- access: public

mr_fixture_user set_options (array|object $options)

- array|object $options

set_role (line 258)

- access: public

mr_fixture_enrollment set_role (\mr_fixture_role|null $role)

- \mr_fixture_role|null $role

set_user (line 194)

- access: public

mr_fixture_enrollment 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:48 -0700 by phpDocumentor 1.4.3