Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 26... Línea 26...
26
 * @copyright  2019 Mihail Geshoski <mihail@moodle.com>
26
 * @copyright  2019 Mihail Geshoski <mihail@moodle.com>
27
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
27
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
28
 * @runTestsInSeparateProcesses
28
 * @runTestsInSeparateProcesses
29
 * @covers     \core_h5p_generator
29
 * @covers     \core_h5p_generator
30
*/
30
*/
31
class generator_test extends \advanced_testcase {
31
final class generator_test extends \advanced_testcase {
Línea 32... Línea 32...
32
 
32
 
33
    /**
33
    /**
34
     * Tests set up.
34
     * Tests set up.
35
     */
35
     */
Línea 193... Línea 193...
193
    /**
193
    /**
194
     * Data provider for test_generate_h5p_data_files_creation().
194
     * Data provider for test_generate_h5p_data_files_creation().
195
     *
195
     *
196
     * @return array
196
     * @return array
197
     */
197
     */
198
    public function generate_h5p_data_files_creation_provider(): array {
198
    public static function generate_h5p_data_files_creation_provider(): array {
199
        return [
199
        return [
200
            'Do not create library related files on the filesystem' => [
200
            'Do not create library related files on the filesystem' => [
201
                false,
201
                false,
202
                false
202
                false
203
            ],
203
            ],
Línea 302... Línea 302...
302
    /**
302
    /**
303
     * Data provider for test_generate_h5p_data_xapistates().
303
     * Data provider for test_generate_h5p_data_xapistates().
304
     *
304
     *
305
     * @return array
305
     * @return array
306
     */
306
     */
307
    public function generate_h5p_data_xapistates_provider(): array {
307
    public static function generate_h5p_data_xapistates_provider(): array {
308
        return [
308
        return [
309
            'Do not create the file nor xAPI states' => [
309
            'Do not create the file nor xAPI states' => [
310
                'filerecord' => null,
310
                'filerecord' => null,
311
            ],
311
            ],
312
            'Create the H5P file but not create any xAPI state' => [
312
            'Create the H5P file but not create any xAPI state' => [
Línea 389... Línea 389...
389
    /**
389
    /**
390
     * Data provider for test_create_h5p_record().
390
     * Data provider for test_create_h5p_record().
391
     *
391
     *
392
     * @return array
392
     * @return array
393
     */
393
     */
394
    public function create_h5p_record_provider(): array {
394
    public static function create_h5p_record_provider(): array {
395
        $createdjsoncontent = json_encode(
395
        $createdjsoncontent = json_encode(
396
            array(
396
            array(
397
                'text' => '<p>Created dummy text<\/p>\n',
397
                'text' => '<p>Created dummy text<\/p>\n',
398
                'questions' => '<p>Test created question<\/p>\n'
398
                'questions' => '<p>Test created question<\/p>\n'
399
            )
399
            )
Línea 510... Línea 510...
510
    /**
510
    /**
511
     * Data provider for test_create_contents_libraries_record().
511
     * Data provider for test_create_contents_libraries_record().
512
     *
512
     *
513
     * @return array
513
     * @return array
514
     */
514
     */
515
    public function create_contents_libraries_record_provider(): array {
515
    public static function create_contents_libraries_record_provider(): array {
516
        return [
516
        return [
517
            'Create h5p content library with set dependency type' => [
517
            'Create h5p content library with set dependency type' => [
518
                [
518
                [
519
                    1,
519
                    1,
520
                    1,
520
                    1,
Línea 570... Línea 570...
570
    /**
570
    /**
571
     * Data provider for test_create_library_dependency_record().
571
     * Data provider for test_create_library_dependency_record().
572
     *
572
     *
573
     * @return array
573
     * @return array
574
     */
574
     */
575
    public function create_library_dependency_record_provider(): array {
575
    public static function create_library_dependency_record_provider(): array {
576
        return [
576
        return [
577
            'Create h5p library dependency with set dependency type' => [
577
            'Create h5p library dependency with set dependency type' => [
578
                [
578
                [
579
                    1,
579
                    1,
580
                    1,
580
                    1,
Línea 636... Línea 636...
636
    /**
636
    /**
637
     * Data provider for test_create_content_file(). Data from different files to be created.
637
     * Data provider for test_create_content_file(). Data from different files to be created.
638
     *
638
     *
639
     * @return array
639
     * @return array
640
     **/
640
     **/
641
    public function create_content_file_provider(): array {
641
    public static function create_content_file_provider(): array {
642
        return [
642
        return [
643
            'Create file in content with id 4' => [
643
            'Create file in content with id 4' => [
644
                [
644
                [
645
                    'images/img1.png',
645
                    'images/img1.png',
646
                    'content',
646
                    'content',