| Línea 58... |
Línea 58... |
| 58 |
}
|
58 |
}
|
| Línea 59... |
Línea 59... |
| 59 |
|
59 |
|
| 60 |
/**
|
60 |
/**
|
| 61 |
* Test confirming that contexts of favourited items can be added to the contextlist.
|
61 |
* Test confirming that contexts of favourited items can be added to the contextlist.
|
| 62 |
*/
|
62 |
*/
|
| 63 |
public function test_add_contexts_for_userid() {
|
63 |
public function test_add_contexts_for_userid(): void {
|
| Línea 64... |
Línea 64... |
| 64 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
64 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
| 65 |
|
65 |
|
| 66 |
// Favourite 2 courses for user1 and 1 course for user2, all at the site context.
|
66 |
// Favourite 2 courses for user1 and 1 course for user2, all at the site context.
|
| Línea 90... |
Línea 90... |
| 90 |
}
|
90 |
}
|
| Línea 91... |
Línea 91... |
| 91 |
|
91 |
|
| 92 |
/**
|
92 |
/**
|
| 93 |
* Test deletion of user favourites based on an approved_contextlist and component area.
|
93 |
* Test deletion of user favourites based on an approved_contextlist and component area.
|
| 94 |
*/
|
94 |
*/
|
| 95 |
public function test_delete_favourites_for_user() {
|
95 |
public function test_delete_favourites_for_user(): void {
|
| Línea 96... |
Línea 96... |
| 96 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
96 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
| 97 |
|
97 |
|
| 98 |
// Favourite 2 courses for user1 and 1 course for user2, all at the user context.
|
98 |
// Favourite 2 courses for user1 and 1 course for user2, all at the user context.
|
| Línea 111... |
Línea 111... |
| 111 |
// Verify that we have no favourite courses for user1 but that the records are in tact for user2.
|
111 |
// Verify that we have no favourite courses for user1 but that the records are in tact for user2.
|
| 112 |
$this->assertCount(0, $ufservice1->find_favourites_by_type('core_course', 'courses'));
|
112 |
$this->assertCount(0, $ufservice1->find_favourites_by_type('core_course', 'courses'));
|
| 113 |
$this->assertCount(1, $ufservice2->find_favourites_by_type('core_course', 'courses'));
|
113 |
$this->assertCount(1, $ufservice2->find_favourites_by_type('core_course', 'courses'));
|
| 114 |
}
|
114 |
}
|
| Línea 115... |
Línea 115... |
| 115 |
|
115 |
|
| 116 |
public function test_delete_favourites_for_all_users() {
|
116 |
public function test_delete_favourites_for_all_users(): void {
|
| Línea 117... |
Línea 117... |
| 117 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
117 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
| 118 |
|
118 |
|
| 119 |
// Favourite 2 course modules for user1 and 1 course module for user2 all in course 1 context.
|
119 |
// Favourite 2 course modules for user1 and 1 course module for user2 all in course 1 context.
|
| Línea 138... |
Línea 138... |
| 138 |
}
|
138 |
}
|
| Línea 139... |
Línea 139... |
| 139 |
|
139 |
|
| 140 |
/**
|
140 |
/**
|
| 141 |
* Test confirming that user ID's of favourited items can be added to the userlist.
|
141 |
* Test confirming that user ID's of favourited items can be added to the userlist.
|
| 142 |
*/
|
142 |
*/
|
| 143 |
public function test_add_userids_for_context() {
|
143 |
public function test_add_userids_for_context(): void {
|
| Línea 144... |
Línea 144... |
| 144 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
144 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
| 145 |
|
145 |
|
| 146 |
// Favourite 2 courses for user1 and 1 course for user2, all at the site context.
|
146 |
// Favourite 2 courses for user1 and 1 course for user2, all at the site context.
|
| Línea 183... |
Línea 183... |
| 183 |
}
|
183 |
}
|
| Línea 184... |
Línea 184... |
| 184 |
|
184 |
|
| 185 |
/**
|
185 |
/**
|
| 186 |
* Test deletion of user favourites based on an approved_userlist, component area and item type.
|
186 |
* Test deletion of user favourites based on an approved_userlist, component area and item type.
|
| 187 |
*/
|
187 |
*/
|
| 188 |
public function test_delete_favourites_for_userlist() {
|
188 |
public function test_delete_favourites_for_userlist(): void {
|
| Línea 189... |
Línea 189... |
| 189 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
189 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
| 190 |
|
190 |
|
| 191 |
// Favourite 2 courses for user1 and 1 course for user2.
|
191 |
// Favourite 2 courses for user1 and 1 course for user2.
|
| Línea 250... |
Línea 250... |
| 250 |
}
|
250 |
}
|
| Línea 251... |
Línea 251... |
| 251 |
|
251 |
|
| 252 |
/**
|
252 |
/**
|
| 253 |
* Test fetching the favourites data for a specified user in a specified component, item type and item ID.
|
253 |
* Test fetching the favourites data for a specified user in a specified component, item type and item ID.
|
| 254 |
*/
|
254 |
*/
|
| 255 |
public function test_get_favourites_info_for_user() {
|
255 |
public function test_get_favourites_info_for_user(): void {
|
| Línea 256... |
Línea 256... |
| 256 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
256 |
list($user1, $user2, $user1context, $user2context, $course1context, $course2context) = $this->set_up_courses_and_users();
|
| 257 |
|
257 |
|
| 258 |
// Favourite 2 courses for user1 and 1 course for user2.
|
258 |
// Favourite 2 courses for user1 and 1 course for user2.
|