Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
50ac4392
Commit
50ac4392
authored
Jan 13, 2014
by
Mark Nelson
Browse files
MDL-40909 mod_forum: removed duplicated test (duplicated in enrol/meta/tests/plugin_test.php)
parent
9788e268
Changes
1
Hide whitespace changes
Inline
Side-by-side
mod/forum/tests/lib_test.php
View file @
50ac4392
...
...
@@ -169,39 +169,6 @@ class mod_forum_lib_testcase extends advanced_testcase {
}
}
/**
* Test user_enrolment_deleted observer.
*/
public
function
test_user_enrolment_deleted_observer
()
{
global
$DB
;
$this
->
resetAfterTest
();
$metaplugin
=
enrol_get_plugin
(
'meta'
);
$user1
=
$this
->
getDataGenerator
()
->
create_user
();
$course1
=
$this
->
getDataGenerator
()
->
create_course
();
$course2
=
$this
->
getDataGenerator
()
->
create_course
();
$student
=
$DB
->
get_record
(
'role'
,
array
(
'shortname'
=>
'student'
));
$e1
=
$metaplugin
->
add_instance
(
$course2
,
array
(
'customint1'
=>
$course1
->
id
));
$enrol1
=
$DB
->
get_record
(
'enrol'
,
array
(
'id'
=>
$e1
));
// Enrol user.
$metaplugin
->
enrol_user
(
$enrol1
,
$user1
->
id
,
$student
->
id
);
$this
->
assertEquals
(
1
,
$DB
->
count_records
(
'user_enrolments'
));
// Unenrol user and capture event.
$sink
=
$this
->
redirectEvents
();
$metaplugin
->
unenrol_user
(
$enrol1
,
$user1
->
id
);
$events
=
$sink
->
get_events
();
$sink
->
close
();
$event
=
array_pop
(
$events
);
$this
->
assertEquals
(
0
,
$DB
->
count_records
(
'user_enrolments'
));
$this
->
assertInstanceOf
(
'\core\event\user_enrolment_deleted'
,
$event
);
$this
->
assertEquals
(
'user_unenrolled'
,
$event
->
get_legacy_eventname
());
}
/**
* Test the logic in the forum_tp_can_track_forums() function.
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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