Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 136... Línea 136...
136
     * @param string $content Example content that we'll attempt to replace.
136
     * @param string $content Example content that we'll attempt to replace.
137
     * @param string $ouputregex Regex for what output we expect.
137
     * @param string $ouputregex Regex for what output we expect.
138
     * @param string $expectedcontent What content we are expecting afterwards.
138
     * @param string $expectedcontent What content we are expecting afterwards.
139
     * @dataProvider upgrade_http_links_provider
139
     * @dataProvider upgrade_http_links_provider
140
     */
140
     */
141
    public function test_upgrade_http_links($content, $ouputregex, $expectedcontent) {
141
    public function test_upgrade_http_links($content, $ouputregex, $expectedcontent): void {
142
        global $DB;
142
        global $DB;
Línea 143... Línea 143...
143
 
143
 
144
        $this->resetAfterTest();
144
        $this->resetAfterTest();
Línea 210... Línea 210...
210
     * @param string $content Example content that we'll attempt to replace.
210
     * @param string $content Example content that we'll attempt to replace.
211
     * @param string $domain The domain we will check was replaced.
211
     * @param string $domain The domain we will check was replaced.
212
     * @param string $expectedcount Number of urls from that domain that we expect to be replaced.
212
     * @param string $expectedcount Number of urls from that domain that we expect to be replaced.
213
     * @dataProvider http_link_stats_provider
213
     * @dataProvider http_link_stats_provider
214
     */
214
     */
215
    public function test_http_link_stats($content, $domain, $expectedcount) {
215
    public function test_http_link_stats($content, $domain, $expectedcount): void {
216
        $this->resetAfterTest();
216
        $this->resetAfterTest();
Línea 217... Línea 217...
217
 
217
 
Línea 218... Línea 218...
218
        $finder = new tool_httpreplace_url_finder_mock();
218
        $finder = new tool_httpreplace_url_finder_mock();
Línea 228... Línea 228...
228
    }
228
    }
Línea 229... Línea 229...
229
 
229
 
230
    /**
230
    /**
231
     * Test links and text are not changed
231
     * Test links and text are not changed
232
     */
232
     */
233
    public function test_links_and_text() {
233
    public function test_links_and_text(): void {
Línea 234... Línea 234...
234
        global $DB;
234
        global $DB;
235
 
235
 
Línea 259... Línea 259...
259
    }
259
    }
Línea 260... Línea 260...
260
 
260
 
261
    /**
261
    /**
262
     * If we have an http wwwroot then we shouldn't report it.
262
     * If we have an http wwwroot then we shouldn't report it.
263
     */
263
     */
264
    public function test_httpwwwroot() {
264
    public function test_httpwwwroot(): void {
Línea 265... Línea 265...
265
        global $DB, $CFG;
265
        global $DB, $CFG;
266
 
266
 
267
        $this->resetAfterTest();
267
        $this->resetAfterTest();
Línea 284... Línea 284...
284
    }
284
    }
Línea 285... Línea 285...
285
 
285
 
286
    /**
286
    /**
287
     * Test that links in excluded tables are not replaced
287
     * Test that links in excluded tables are not replaced
288
     */
288
     */
289
    public function test_upgrade_http_links_excluded_tables() {
289
    public function test_upgrade_http_links_excluded_tables(): void {
Línea 290... Línea 290...
290
        $this->resetAfterTest();
290
        $this->resetAfterTest();
Línea 291... Línea 291...
291
 
291
 
Línea 304... Línea 304...
304
    }
304
    }
Línea 305... Línea 305...
305
 
305
 
306
    /**
306
    /**
307
     * Test renamed domains
307
     * Test renamed domains
308
     */
308
     */
309
    public function test_renames() {
309
    public function test_renames(): void {
310
        global $DB, $CFG;
310
        global $DB, $CFG;
311
        $this->resetAfterTest();
311
        $this->resetAfterTest();
Línea 312... Línea 312...
312
        $this->expectOutputRegex('/UPDATE/');
312
        $this->expectOutputRegex('/UPDATE/');
Línea 337... Línea 337...
337
    }
337
    }
Línea 338... Línea 338...
338
 
338
 
339
    /**
339
    /**
340
     * When there are many different pieces of contents from the same site, we should only run replace once
340
     * When there are many different pieces of contents from the same site, we should only run replace once
341
     */
341
     */
342
    public function test_multiple() {
342
    public function test_multiple(): void {
343
        global $DB;
343
        global $DB;
344
        $this->resetAfterTest();
344
        $this->resetAfterTest();
345
        $original1 = '';
345
        $original1 = '';
346
        $expected1 = '';
346
        $expected1 = '';
Línea 374... Línea 374...
374
    }
374
    }
Línea 375... Línea 375...
375
 
375
 
376
    /**
376
    /**
377
     * Test the tool when the column name is a reserved word in SQL (in this case 'where')
377
     * Test the tool when the column name is a reserved word in SQL (in this case 'where')
378
     */
378
     */
379
    public function test_reserved_words() {
379
    public function test_reserved_words(): void {
Línea 380... Línea 380...
380
        global $DB;
380
        global $DB;
381
 
381