Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 89... Línea 89...
89
        $this->tagid  = $tag->id;
89
        $this->tagid  = $tag->id;
90
        $this->postid = $post->id;
90
        $this->postid = $post->id;
91
    }
91
    }
Línea 92... Línea 92...
92
 
92
 
93
 
93
 
Línea 94... Línea 94...
94
    public function test_overrides() {
94
    public function test_overrides(): void {
95
        global $SITE;
95
        global $SITE;
96
 
96
 
Línea 130... Línea 130...
130
    }
130
    }
Línea 131... Línea 131...
131
 
131
 
132
    // The following series of 'test_blog..' functions correspond to the blog_get_headers() function within blog/lib.php.
132
    // The following series of 'test_blog..' functions correspond to the blog_get_headers() function within blog/lib.php.
Línea 133... Línea 133...
133
    // Some cases are omitted due to the optional_param variables used.
133
    // Some cases are omitted due to the optional_param variables used.
134
 
134
 
135
    public function test_blog_get_headers_case_1() {
135
    public function test_blog_get_headers_case_1(): void {
136
        global $CFG, $PAGE, $OUTPUT;
136
        global $CFG, $PAGE, $OUTPUT;
137
        $blogheaders = blog_get_headers();
137
        $blogheaders = blog_get_headers();
Línea 138... Línea 138...
138
        $this->assertEquals($blogheaders['heading'], get_string('siteblogheading', 'blog'));
138
        $this->assertEquals($blogheaders['heading'], get_string('siteblogheading', 'blog'));
139
    }
139
    }
140
 
140
 
141
    public function test_blog_get_headers_case_6() {
141
    public function test_blog_get_headers_case_6(): void {
142
        global $CFG, $PAGE, $OUTPUT;
142
        global $CFG, $PAGE, $OUTPUT;
Línea 143... Línea 143...
143
        $blogheaders = blog_get_headers($this->courseid, null, $this->userid);
143
        $blogheaders = blog_get_headers($this->courseid, null, $this->userid);
144
        $this->assertNotEquals($blogheaders['heading'], '');
144
        $this->assertNotEquals($blogheaders['heading'], '');
145
    }
145
    }
146
 
146
 
147
    public function test_blog_get_headers_case_7() {
147
    public function test_blog_get_headers_case_7(): void {
Línea 148... Línea 148...
148
        global $CFG, $PAGE, $OUTPUT;
148
        global $CFG, $PAGE, $OUTPUT;
149
        $blogheaders = blog_get_headers(null, $this->groupid);
149
        $blogheaders = blog_get_headers(null, $this->groupid);
150
        $this->assertNotEquals($blogheaders['heading'], '');
150
        $this->assertNotEquals($blogheaders['heading'], '');
151
    }
151
    }
152
 
152
 
Línea 153... Línea 153...
153
    public function test_blog_get_headers_case_10() {
153
    public function test_blog_get_headers_case_10(): void {
154
        global $CFG, $PAGE, $OUTPUT;
154
        global $CFG, $PAGE, $OUTPUT;
155
        $blogheaders = blog_get_headers($this->courseid);
155
        $blogheaders = blog_get_headers($this->courseid);
156
        $this->assertNotEquals($blogheaders['heading'], '');
156
        $this->assertNotEquals($blogheaders['heading'], '');
157
    }
157
    }
Línea 158... Línea 158...
158
 
158
 
159
    /**
159
    /**
160
     * Tests the core_blog_myprofile_navigation() function.
160
     * Tests the core_blog_myprofile_navigation() function.
Línea 179... Línea 179...
179
    }
179
    }
Línea 180... Línea 180...
180
 
180
 
181
    /**
181
    /**
182
     * Tests the core_blog_myprofile_navigation() function as a guest.
182
     * Tests the core_blog_myprofile_navigation() function as a guest.
183
     */
183
     */
184
    public function test_core_blog_myprofile_navigation_as_guest() {
184
    public function test_core_blog_myprofile_navigation_as_guest(): void {
Línea 185... Línea 185...
185
        global $USER;
185
        global $USER;
186
 
186
 
187
        // Set up the test.
187
        // Set up the test.
Línea 200... Línea 200...
200
    }
200
    }
Línea 201... Línea 201...
201
 
201
 
202
    /**
202
    /**
203
     * Tests the core_blog_myprofile_navigation() function when blogs are disabled.
203
     * Tests the core_blog_myprofile_navigation() function when blogs are disabled.
204
     */
204
     */
205
    public function test_core_blog_myprofile_navigation_blogs_disabled() {
205
    public function test_core_blog_myprofile_navigation_blogs_disabled(): void {
Línea 206... Línea 206...
206
        global $USER;
206
        global $USER;
207
 
207
 
208
        // Set up the test.
208
        // Set up the test.
Línea 219... Línea 219...
219
        $reflector = new \ReflectionObject($tree);
219
        $reflector = new \ReflectionObject($tree);
220
        $nodes = $reflector->getProperty('nodes');
220
        $nodes = $reflector->getProperty('nodes');
221
        $this->assertArrayNotHasKey('blogs', $nodes->getValue($tree));
221
        $this->assertArrayNotHasKey('blogs', $nodes->getValue($tree));
222
    }
222
    }
Línea 223... Línea 223...
223
 
223
 
224
    public function test_blog_get_listing_course() {
224
    public function test_blog_get_listing_course(): void {
225
        $this->setAdminUser();
225
        $this->setAdminUser();
226
        $coursecontext = \context_course::instance($this->courseid);
226
        $coursecontext = \context_course::instance($this->courseid);
Línea 227... Línea 227...
227
        $anothercourse = $this->getDataGenerator()->create_course();
227
        $anothercourse = $this->getDataGenerator()->create_course();
Línea 249... Línea 249...
249
        // There is one entry associated with course context.
249
        // There is one entry associated with course context.
250
        $bloglisting = new blog_listing(array('context' => $coursecontext->id));
250
        $bloglisting = new blog_listing(array('context' => $coursecontext->id));
251
        $this->assertCount(1, $bloglisting->get_entries());
251
        $this->assertCount(1, $bloglisting->get_entries());
252
    }
252
    }
Línea 253... Línea 253...
253
 
253
 
254
    public function test_blog_get_listing_module() {
254
    public function test_blog_get_listing_module(): void {
255
        $this->setAdminUser();
255
        $this->setAdminUser();
256
        $coursecontext = \context_course::instance($this->courseid);
256
        $coursecontext = \context_course::instance($this->courseid);
257
        $contextmodule = \context_module::instance($this->cmid);
257
        $contextmodule = \context_module::instance($this->cmid);