Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 27... Línea 27...
27
 * @subpackage course
27
 * @subpackage course
28
 * @author     Dmitrii Metelkin <dmitriim@catalyst-au.net>
28
 * @author     Dmitrii Metelkin <dmitriim@catalyst-au.net>
29
 * @copyright  2021 Catalyst IT
29
 * @copyright  2021 Catalyst IT
30
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
30
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
31
 */
31
 */
32
class course_summary_exporter_test extends \advanced_testcase {
32
final class course_summary_exporter_test extends \advanced_testcase {
Línea 33... Línea 33...
33
 
33
 
34
    /**
34
    /**
35
     * Test that if no course overview images uploaded get_course_image returns false.
35
     * Test that if no course overview images uploaded get_course_image returns false.
36
     */
36
     */
Línea 59... Línea 59...
59
            'itemid' => $draftid,
59
            'itemid' => $draftid,
60
            'filename' => 'image.jpg',
60
            'filename' => 'image.jpg',
61
            'filepath' => '/',
61
            'filepath' => '/',
62
        ];
62
        ];
63
        $fs = get_file_storage();
63
        $fs = get_file_storage();
64
        $fs->create_file_from_string($filerecord, file_get_contents(__DIR__ . '/fixtures/image.jpg'));
64
        $fs->create_file_from_string($filerecord, file_get_contents(self::get_fixture_path(__NAMESPACE__, 'image.jpg')));
65
        $course = $this->getDataGenerator()->create_course(['overviewfiles_filemanager' => $draftid]);
65
        $course = $this->getDataGenerator()->create_course(['overviewfiles_filemanager' => $draftid]);
66
        $coursecontext = context_course::instance($course->id);
66
        $coursecontext = context_course::instance($course->id);
Línea 67... Línea 67...
67
 
67
 
68
        $expected = 'https://www.example.com/moodle/pluginfile.php/' . $coursecontext->id . '/course/overviewfiles/image.jpg';
68
        $expected = 'https://www.example.com/moodle/pluginfile.php/' . $coursecontext->id . '/course/overviewfiles/image.jpg';