Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 41... Línea 41...
41
 * @package    mod_h5pactivity
41
 * @package    mod_h5pactivity
42
 * @category   test
42
 * @category   test
43
 * @copyright  2020 Ferran Recio <ferran@moodle.com>
43
 * @copyright  2020 Ferran Recio <ferran@moodle.com>
44
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
44
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
45
 */
45
 */
46
class attempt_test extends \advanced_testcase {
46
final class attempt_test extends \advanced_testcase {
Línea 47... Línea 47...
47
 
47
 
48
    /**
48
    /**
49
     * Generate a scenario to run all tests.
49
     * Generate a scenario to run all tests.
50
     * @return array course_modules, user record, course record
50
     * @return array course_modules, user record, course record
Línea 178... Línea 178...
178
    /**
178
    /**
179
     * Data provider for data request creation tests.
179
     * Data provider for data request creation tests.
180
     *
180
     *
181
     * @return array
181
     * @return array
182
     */
182
     */
183
    public function save_statement_data(): array {
183
    public static function save_statement_data(): array {
184
        return [
184
        return [
185
            'Statement without definition and result' => [
185
            'Statement without definition and result' => [
186
                '', false, false, [false, 0, 0, 0, 0, null, null]
186
                '', false, false, [false, 0, 0, 0, 0, null, null]
187
            ],
187
            ],
188
            'Statement with definition but no result' => [
188
            'Statement with definition but no result' => [
Línea 310... Línea 310...
310
    /**
310
    /**
311
     * Data provider for data request creation tests.
311
     * Data provider for data request creation tests.
312
     *
312
     *
313
     * @return array
313
     * @return array
314
     */
314
     */
315
    public function delete_all_attempts_data(): array {
315
    public static function delete_all_attempts_data(): array {
316
        return [
316
        return [
317
            'Delete all attempts from activity' => [
317
            'Delete all attempts from activity' => [
318
                false, [0, 0, 2, 2, 2, 4]
318
                false, [0, 0, 2, 2, 2, 4]
319
            ],
319
            ],
320
            'Delete all attempts from user' => [
320
            'Delete all attempts from user' => [
Línea 411... Línea 411...
411
    /**
411
    /**
412
     * Data provider for testing basic setters.
412
     * Data provider for testing basic setters.
413
     *
413
     *
414
     * @return array
414
     * @return array
415
     */
415
     */
416
    public function basic_setters_data(): array {
416
    public static function basic_setters_data(): array {
417
        return [
417
        return [
418
            'Set attempt duration' => [
418
            'Set attempt duration' => [
419
                'duration', 25, 35
419
                'duration', 25, 35
420
            ],
420
            ],
421
            'Set attempt completion' => [
421
            'Set attempt completion' => [