Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 44... Línea 44...
44
    public function setUp(): void {
44
    public function setUp(): void {
45
        $this->resetAfterTest();
45
        $this->resetAfterTest();
46
        $this->setAdminUser();
46
        $this->setAdminUser();
47
    }
47
    }
Línea 48... Línea 48...
48
 
48
 
49
    public function test_export_contents() {
49
    public function test_export_contents(): void {
50
        global $DB, $CFG;
50
        global $DB, $CFG;
Línea 51... Línea 51...
51
        require_once($CFG->dirroot . '/course/externallib.php');
51
        require_once($CFG->dirroot . '/course/externallib.php');
52
 
52
 
Línea 194... Línea 194...
194
 
194
 
195
    /**
195
    /**
196
     * Test book_view
196
     * Test book_view
197
     * @return void
197
     * @return void
198
     */
198
     */
199
    public function test_book_view() {
199
    public function test_book_view(): void {
Línea 200... Línea 200...
200
        global $CFG, $DB;
200
        global $CFG, $DB;
Línea 201... Línea 201...
201
 
201
 
Línea 240... Línea 240...
240
        $completion = new \completion_info($course);
240
        $completion = new \completion_info($course);
241
        $completiondata = $completion->get_data($cm);
241
        $completiondata = $completion->get_data($cm);
242
        $this->assertEquals(1, $completiondata->completionstate);
242
        $this->assertEquals(1, $completiondata->completionstate);
243
    }
243
    }
Línea 244... Línea 244...
244
 
244
 
245
    public function test_book_core_calendar_provide_event_action() {
245
    public function test_book_core_calendar_provide_event_action(): void {
246
        // Create the activity.
246
        // Create the activity.
247
        $course = $this->getDataGenerator()->create_course();
247
        $course = $this->getDataGenerator()->create_course();
Línea 248... Línea 248...
248
        $book = $this->getDataGenerator()->create_module('book', array('course' => $course->id));
248
        $book = $this->getDataGenerator()->create_module('book', array('course' => $course->id));
Línea 263... Línea 263...
263
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
263
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
264
        $this->assertEquals(1, $actionevent->get_item_count());
264
        $this->assertEquals(1, $actionevent->get_item_count());
265
        $this->assertTrue($actionevent->is_actionable());
265
        $this->assertTrue($actionevent->is_actionable());
266
    }
266
    }
Línea 267... Línea 267...
267
 
267
 
268
    public function test_book_core_calendar_provide_event_action_in_hidden_section() {
268
    public function test_book_core_calendar_provide_event_action_in_hidden_section(): void {
269
        // Create the activity.
269
        // Create the activity.
270
        $course = $this->getDataGenerator()->create_course();
270
        $course = $this->getDataGenerator()->create_course();
Línea 271... Línea 271...
271
        $book = $this->getDataGenerator()->create_module('book', array('course' => $course->id));
271
        $book = $this->getDataGenerator()->create_module('book', array('course' => $course->id));
Línea 291... Línea 291...
291
 
291
 
292
        // Confirm the event is not shown at all.
292
        // Confirm the event is not shown at all.
293
        $this->assertNull($actionevent);
293
        $this->assertNull($actionevent);
Línea 294... Línea 294...
294
    }
294
    }
295
 
295
 
296
    public function test_book_core_calendar_provide_event_action_for_user() {
296
    public function test_book_core_calendar_provide_event_action_for_user(): void {
297
        // Create the activity.
297
        // Create the activity.
Línea 298... Línea 298...
298
        $course = $this->getDataGenerator()->create_course();
298
        $course = $this->getDataGenerator()->create_course();
Línea 320... Línea 320...
320
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
320
        $this->assertInstanceOf('moodle_url', $actionevent->get_url());
321
        $this->assertEquals(1, $actionevent->get_item_count());
321
        $this->assertEquals(1, $actionevent->get_item_count());
322
        $this->assertTrue($actionevent->is_actionable());
322
        $this->assertTrue($actionevent->is_actionable());
323
    }
323
    }
Línea 324... Línea 324...
324
 
324
 
325
    public function test_book_core_calendar_provide_event_action_as_non_user() {
325
    public function test_book_core_calendar_provide_event_action_as_non_user(): void {
Línea 326... Línea 326...
326
        global $CFG;
326
        global $CFG;
327
 
327
 
328
        // Create the activity.
328
        // Create the activity.
Línea 345... Línea 345...
345
 
345
 
346
        // Ensure result was null.
346
        // Ensure result was null.
347
        $this->assertNull($actionevent);
347
        $this->assertNull($actionevent);
Línea 348... Línea 348...
348
    }
348
    }
349
 
349
 
Línea 350... Línea 350...
350
    public function test_book_core_calendar_provide_event_action_already_completed() {
350
    public function test_book_core_calendar_provide_event_action_already_completed(): void {
Línea 351... Línea 351...
351
        global $CFG;
351
        global $CFG;
Línea 376... Línea 376...
376
 
376
 
377
        // Ensure result was null.
377
        // Ensure result was null.
378
        $this->assertNull($actionevent);
378
        $this->assertNull($actionevent);
Línea 379... Línea 379...
379
    }
379
    }
380
 
380
 
Línea 381... Línea 381...
381
    public function test_book_core_calendar_provide_event_action_already_completed_for_user() {
381
    public function test_book_core_calendar_provide_event_action_already_completed_for_user(): void {
Línea 382... Línea 382...
382
        global $CFG;
382
        global $CFG;
Línea 431... Línea 431...
431
        $event->timestart = time();
431
        $event->timestart = time();
Línea 432... Línea 432...
432
 
432
 
433
        return \calendar_event::create($event);
433
        return \calendar_event::create($event);
Línea 434... Línea 434...
434
    }
434
    }
435
 
435
 
Línea 436... Línea 436...
436
    public function test_mod_book_get_tagged_chapters() {
436
    public function test_mod_book_get_tagged_chapters(): void {
437
        global $DB;
437
        global $DB;