Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 24... Línea 24...
24
 * @copyright  2013 Marina Glancy
24
 * @copyright  2013 Marina Glancy
25
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26
 */
26
 */
27
class generator_test extends \advanced_testcase {
27
class generator_test extends \advanced_testcase {
Línea 28... Línea 28...
28
 
28
 
29
    public function test_create_instance() {
29
    public function test_create_instance(): void {
30
        global $DB;
30
        global $DB;
31
        $this->resetAfterTest();
31
        $this->resetAfterTest();
Línea 32... Línea 32...
32
        $this->setAdminUser();
32
        $this->setAdminUser();
Línea 44... Línea 44...
44
        $records = $DB->get_records('workshop', array('course' => $course->id), 'id');
44
        $records = $DB->get_records('workshop', array('course' => $course->id), 'id');
45
        $this->assertEquals(2, count($records));
45
        $this->assertEquals(2, count($records));
46
        $this->assertEquals('Another workshop', $records[$workshop->id]->name);
46
        $this->assertEquals('Another workshop', $records[$workshop->id]->name);
47
    }
47
    }
Línea 48... Línea 48...
48
 
48
 
49
    public function test_create_submission() {
49
    public function test_create_submission(): void {
50
        global $DB;
50
        global $DB;
51
        $this->resetAfterTest();
51
        $this->resetAfterTest();
Línea 52... Línea 52...
52
        $this->setAdminUser();
52
        $this->setAdminUser();
Línea 66... Línea 66...
66
        $this->assertTrue(isset($submissions[$id]));
66
        $this->assertTrue(isset($submissions[$id]));
67
        $this->assertEquals($submissions[$id]->authorid, $user->id);
67
        $this->assertEquals($submissions[$id]->authorid, $user->id);
68
        $this->assertSame('My custom title', $submissions[$id]->title);
68
        $this->assertSame('My custom title', $submissions[$id]->title);
69
    }
69
    }
Línea 70... Línea 70...
70
 
70
 
71
    public function test_create_assessment() {
71
    public function test_create_assessment(): void {
72
        global $DB;
72
        global $DB;
73
        $this->resetAfterTest();
73
        $this->resetAfterTest();
Línea 74... Línea 74...
74
        $this->setAdminUser();
74
        $this->setAdminUser();