Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 23... Línea 23...
23
 * @copyright  2013 Frédéric Massart
23
 * @copyright  2013 Frédéric Massart
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 */
25
 */
26
class generator_test extends \advanced_testcase {
26
class generator_test extends \advanced_testcase {
Línea 27... Línea 27...
27
 
27
 
28
    public function test_create_instance() {
28
    public function test_create_instance(): void {
29
        global $DB;
29
        global $DB;
30
        $this->resetAfterTest();
30
        $this->resetAfterTest();
Línea 31... Línea 31...
31
        $this->setAdminUser();
31
        $this->setAdminUser();
Línea 41... Línea 41...
41
        $book = $this->getDataGenerator()->create_module('book', $params);
41
        $book = $this->getDataGenerator()->create_module('book', $params);
42
        $this->assertEquals(2, $DB->count_records('book', array('course' => $course->id)));
42
        $this->assertEquals(2, $DB->count_records('book', array('course' => $course->id)));
43
        $this->assertEquals('One more book', $DB->get_field_select('book', 'name', 'id = :id', array('id' => $book->id)));
43
        $this->assertEquals('One more book', $DB->get_field_select('book', 'name', 'id = :id', array('id' => $book->id)));
44
    }
44
    }
Línea 45... Línea 45...
45
 
45
 
46
    public function test_create_chapter() {
46
    public function test_create_chapter(): void {
47
        global $DB;
47
        global $DB;
48
        $this->resetAfterTest();
48
        $this->resetAfterTest();
Línea 49... Línea 49...
49
        $this->setAdminUser();
49
        $this->setAdminUser();