Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 33... Línea 33...
33
 * @category   external
33
 * @category   external
34
 * @copyright  2015 Juan Leyva <juan@moodle.com>
34
 * @copyright  2015 Juan Leyva <juan@moodle.com>
35
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36
 * @since      Moodle 3.0
36
 * @since      Moodle 3.0
37
 */
37
 */
38
class externallib_test extends externallib_advanced_testcase {
38
final class externallib_test extends externallib_advanced_testcase {
Línea 39... Línea 39...
39
 
39
 
40
    /**
40
    /**
41
     * Test get_course_blocks
41
     * Test get_course_blocks
42
     */
42
     */
43
    public function test_get_course_blocks(): void {
43
    public function test_get_course_blocks(): void {
Línea 44... Línea 44...
44
        global $DB, $FULLME;
44
        global $DB, $FULLME;
-
 
45
 
Línea 45... Línea 46...
45
 
46
        $this->resetAfterTest(true);
46
        $this->resetAfterTest(true);
47
        $this->setAdminUser();
47
 
48
 
48
        $user = $this->getDataGenerator()->create_user();
49
        $user = $this->getDataGenerator()->create_user();
Línea 75... Línea 76...
75
     */
76
     */
76
    public function test_get_course_blocks_site_home(): void {
77
    public function test_get_course_blocks_site_home(): void {
77
        global $DB, $FULLME;
78
        global $DB, $FULLME;
Línea 78... Línea 79...
78
 
79
 
-
 
80
        $this->resetAfterTest(true);
Línea 79... Línea 81...
79
        $this->resetAfterTest(true);
81
        $this->setAdminUser();
Línea 80... Línea 82...
80
 
82
 
81
        $user = $this->getDataGenerator()->create_user();
83
        $user = $this->getDataGenerator()->create_user();
Línea 139... Línea 141...
139
     */
141
     */
140
    public function test_get_course_blocks_contents(): void {
142
    public function test_get_course_blocks_contents(): void {
141
        global $DB, $FULLME;
143
        global $DB, $FULLME;
Línea 142... Línea 144...
142
 
144
 
-
 
145
        $this->resetAfterTest(true);
Línea 143... Línea 146...
143
        $this->resetAfterTest(true);
146
        $this->setAdminUser();
144
 
147
 
145
        $user = $this->getDataGenerator()->create_user();
148
        $user = $this->getDataGenerator()->create_user();
146
        $course = $this->getDataGenerator()->create_course();
149
        $course = $this->getDataGenerator()->create_course();
Línea 235... Línea 238...
235
     */
238
     */
236
    public function test_get_course_blocks_contents_with_mathjax(): void {
239
    public function test_get_course_blocks_contents_with_mathjax(): void {
237
        global $DB, $CFG;
240
        global $DB, $CFG;
Línea 238... Línea 241...
238
 
241
 
-
 
242
        $this->resetAfterTest(true);
Línea 239... Línea 243...
239
        $this->resetAfterTest(true);
243
        $this->setAdminUser();
240
 
244
 
241
        // Enable MathJax filter in content and headings.
245
        // Enable MathJax filter in content and headings.
242
        $this->configure_filters([
246
        $this->configure_filters([
Línea 360... Línea 364...
360
     * Test user get default dashboard blocks including a sticky block.
364
     * Test user get default dashboard blocks including a sticky block.
361
     */
365
     */
362
    public function test_get_dashboard_blocks_default_dashboard_including_sticky_block(): void {
366
    public function test_get_dashboard_blocks_default_dashboard_including_sticky_block(): void {
363
        global $PAGE, $DB;
367
        global $PAGE, $DB;
364
        $this->resetAfterTest(true);
368
        $this->resetAfterTest(true);
-
 
369
        $this->setAdminUser();
Línea 365... Línea 370...
365
 
370
 
366
        $user = $this->getDataGenerator()->create_user();
371
        $user = $this->getDataGenerator()->create_user();
Línea 367... Línea 372...
367
        $PAGE->set_url('/my/index.php');    // Need this because some internal API calls require the $PAGE url to be set.
372
        $PAGE->set_url('/my/index.php');    // Need this because some internal API calls require the $PAGE url to be set.
Línea 408... Línea 413...
408
     * Test admin get user's custom dashboard blocks.
413
     * Test admin get user's custom dashboard blocks.
409
     */
414
     */
410
    public function test_get_dashboard_blocks_custom_user_dashboard(): void {
415
    public function test_get_dashboard_blocks_custom_user_dashboard(): void {
411
        global $PAGE, $DB;
416
        global $PAGE, $DB;
412
        $this->resetAfterTest(true);
417
        $this->resetAfterTest(true);
-
 
418
        $this->setAdminUser();
Línea 413... Línea 419...
413
 
419
 
414
        $user = $this->getDataGenerator()->create_user();
420
        $user = $this->getDataGenerator()->create_user();
Línea 415... Línea 421...
415
        $PAGE->set_url('/my/index.php');    // Need this because some internal API calls require the $PAGE url to be set.
421
        $PAGE->set_url('/my/index.php');    // Need this because some internal API calls require the $PAGE url to be set.