Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 54... Línea 54...
54
    /**
54
    /**
55
     * Tests for behaviour of get_name().
55
     * Tests for behaviour of get_name().
56
     *
56
     *
57
     * @covers ::get_name
57
     * @covers ::get_name
58
     */
58
     */
59
    public function test_get_name() {
59
    public function test_get_name(): void {
60
        $this->resetAfterTest();
60
        $this->resetAfterTest();
Línea 61... Línea 61...
61
 
61
 
62
        // Create content.
62
        // Create content.
63
        $record = new stdClass();
63
        $record = new stdClass();
Línea 94... Línea 94...
94
     * @param   string  $newname    The name to set
94
     * @param   string  $newname    The name to set
95
     * @param   string   $expected   The name result
95
     * @param   string   $expected   The name result
96
     *
96
     *
97
     * @covers ::set_name
97
     * @covers ::set_name
98
     */
98
     */
99
    public function test_set_name(string $newname, string $expected) {
99
    public function test_set_name(string $newname, string $expected): void {
100
        global $DB;
100
        global $DB;
Línea 101... Línea 101...
101
 
101
 
102
        $this->resetAfterTest();
102
        $this->resetAfterTest();
Línea 123... Línea 123...
123
    /**
123
    /**
124
     * Tests for behaviour of get_content_type().
124
     * Tests for behaviour of get_content_type().
125
     *
125
     *
126
     * @covers ::get_content_type
126
     * @covers ::get_content_type
127
     */
127
     */
128
    public function test_get_content_type() {
128
    public function test_get_content_type(): void {
129
        $this->resetAfterTest();
129
        $this->resetAfterTest();
Línea 130... Línea 130...
130
 
130
 
131
        // Create content.
131
        // Create content.
132
        $record = new stdClass();
132
        $record = new stdClass();
Línea 141... Línea 141...
141
    /**
141
    /**
142
     * Tests for 'configdata' behaviour.
142
     * Tests for 'configdata' behaviour.
143
     *
143
     *
144
     * @covers ::set_configdata
144
     * @covers ::set_configdata
145
     */
145
     */
146
    public function test_configdata_changes() {
146
    public function test_configdata_changes(): void {
147
        $this->resetAfterTest();
147
        $this->resetAfterTest();
Línea 148... Línea 148...
148
 
148
 
Línea 149... Línea 149...
149
        $configdata = "{img: 'icon.svg'}";
149
        $configdata = "{img: 'icon.svg'}";
Línea 164... Línea 164...
164
    /**
164
    /**
165
     * Tests for 'set_contextid' behaviour.
165
     * Tests for 'set_contextid' behaviour.
166
     *
166
     *
167
     * @covers ::set_contextid
167
     * @covers ::set_contextid
168
     */
168
     */
169
    public function test_set_contextid() {
169
    public function test_set_contextid(): void {
170
        $this->resetAfterTest();
170
        $this->resetAfterTest();
171
        $this->setAdminUser();
171
        $this->setAdminUser();
172
        $context = context_system::instance();
172
        $context = context_system::instance();
173
        $course = $this->getDataGenerator()->create_course();
173
        $course = $this->getDataGenerator()->create_course();
174
        $newcontext = \context_course::instance($course->id);
174
        $newcontext = \context_course::instance($course->id);
Línea 195... Línea 195...
195
    /**
195
    /**
196
     * Tests for set_visibility behaviour
196
     * Tests for set_visibility behaviour
197
     *
197
     *
198
     * @covers ::set_visibility
198
     * @covers ::set_visibility
199
     */
199
     */
200
    public function test_set_visibility() {
200
    public function test_set_visibility(): void {
201
        $this->resetAfterTest();
201
        $this->resetAfterTest();
202
        $this->setAdminUser();
202
        $this->setAdminUser();
203
        $context = context_system::instance();
203
        $context = context_system::instance();
204
        $oldvisibility = content::VISIBILITY_PUBLIC;
204
        $oldvisibility = content::VISIBILITY_PUBLIC;
205
        $newvisibility = content::VISIBILITY_UNLISTED;
205
        $newvisibility = content::VISIBILITY_UNLISTED;
Línea 331... Línea 331...
331
    /**
331
    /**
332
     * Tests for 'is_view_allowed'.
332
     * Tests for 'is_view_allowed'.
333
     *
333
     *
334
     * @covers ::is_view_allowed
334
     * @covers ::is_view_allowed
335
     */
335
     */
336
    public function test_is_view_allowed() {
336
    public function test_is_view_allowed(): void {
337
        $this->resetAfterTest();
337
        $this->resetAfterTest();
338
        $this->setAdminUser();
338
        $this->setAdminUser();
339
        $context = context_system::instance();
339
        $context = context_system::instance();
Línea 340... Línea 340...
340
 
340
 
Línea 369... Línea 369...
369
    /**
369
    /**
370
     * Tests for 'get_uses' behaviour.
370
     * Tests for 'get_uses' behaviour.
371
     *
371
     *
372
     * @covers ::get_uses
372
     * @covers ::get_uses
373
     */
373
     */
374
    public function test_get_uses() {
374
    public function test_get_uses(): void {
375
        $this->resetAfterTest();
375
        $this->resetAfterTest();
376
        $this->setAdminUser();
376
        $this->setAdminUser();
377
        $context = context_system::instance();
377
        $context = context_system::instance();
Línea 378... Línea 378...
378
 
378