Proyectos de Subversion Moodle

Rev

Rev 11 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 1441
Línea 38... Línea 38...
38
 * @package    mod_lesson
38
 * @package    mod_lesson
39
 * @category   test
39
 * @category   test
40
 * @copyright  2016 Adrian Greeve <adrian@moodle.com>
40
 * @copyright  2016 Adrian Greeve <adrian@moodle.com>
41
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
41
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
42
 */
42
 */
43
class locallib_test extends \advanced_testcase {
43
final class locallib_test extends \advanced_testcase {
Línea 44... Línea 44...
44
 
44
 
45
    /**
45
    /**
46
     * Test duplicating a lesson page element.
46
     * Test duplicating a lesson page element.
47
     */
47
     */
Línea 248... Línea 248...
248
 
248
 
249
        $this->getDataGenerator()->enrol_user(2, $course->id);
249
        $this->getDataGenerator()->enrol_user(2, $course->id);
250
        $this->assertEquals(true, $lesson->is_participant($USER->id),
250
        $this->assertEquals(true, $lesson->is_participant($USER->id),
Línea 251... Línea 251...
251
            'Admin is enrolled and can participate');
251
            'Admin is enrolled and can participate');
252
 
252
 
253
        $this->getDataGenerator()->enrol_user(2, $course->id, [], 'manual', 0, 0, ENROL_USER_SUSPENDED);
253
        $this->getDataGenerator()->enrol_user(2, $course->id, null, 'manual', 0, 0, ENROL_USER_SUSPENDED);
254
        $this->assertEquals(true, $lesson->is_participant($USER->id),
254
        $this->assertEquals(true, $lesson->is_participant($USER->id),
Línea 255... Línea 255...
255
            'Admin is enrolled, suspended and can participate');
255
            'Admin is enrolled, suspended and can participate');
256
    }
256
    }
257
 
257
 
258
    /**
258
    /**
259
     * Data provider for test_get_last_attempt.
259
     * Data provider for test_get_last_attempt.
260
     *
260
     *
261
     * @return array
261
     * @return array
262
     */
262
     */
263
    public function get_last_attempt_dataprovider() {
263
    public static function get_last_attempt_dataprovider(): array {
264
        return [
264
        return [
265
            [0, [(object)['id' => 1], (object)['id' => 2], (object)['id' => 3]], (object)['id' => 3]],
265
            [0, [(object)['id' => 1], (object)['id' => 2], (object)['id' => 3]], (object)['id' => 3]],