Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 22... Línea 22...
22
 * @package    core
22
 * @package    core
23
 * @category   test
23
 * @category   test
24
 * @copyright  2012 Petr Skoda {@link http://skodak.org}
24
 * @copyright  2012 Petr Skoda {@link http://skodak.org}
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 geoplugin_test extends \advanced_testcase {
27
final class geoplugin_test extends \advanced_testcase {
Línea 28... Línea 28...
28
 
28
 
29
    /**
29
    /**
30
     * Load required test libraries
30
     * Load required test libraries
31
     */
31
     */
32
    public static function setUpBeforeClass(): void {
32
    public static function setUpBeforeClass(): void {
33
        global $CFG;
33
        global $CFG;
-
 
34
        require_once("{$CFG->dirroot}/iplookup/lib.php");
34
        require_once("{$CFG->dirroot}/iplookup/lib.php");
35
        parent::setUpBeforeClass();
Línea 35... Línea 36...
35
    }
36
    }
-
 
37
 
36
 
38
    /**
-
 
39
     * In order to execute this test:
37
    /**
40
     * - PHPUNIT_LONGTEST should be defined as true in phpunit.xml or directly in config.php
38
     * In order to execute this test PHPUNIT_LONGTEST should be defined as true in phpunit.xml or directly in config.php
41
     * - GeoPlugin API key should be defined in config.php as TEST_GEOIP_APIKEY
-
 
42
     */
-
 
43
    public function setUp(): void {
39
     */
44
        global $CFG;
40
    public function setUp(): void {
45
        parent::setUp();
41
        if (!PHPUNIT_LONGTEST) {
46
        if (!PHPUNIT_LONGTEST) {
-
 
47
            $this->markTestSkipped('PHPUNIT_LONGTEST is not defined');
-
 
48
        }
-
 
49
 
-
 
50
        if (!defined('TEST_GEOIP_APIKEY') || empty(TEST_GEOIP_APIKEY)) {
-
 
51
            $this->markTestSkipped('External geo tests are disabled.');
42
            $this->markTestSkipped('PHPUNIT_LONGTEST is not defined');
52
        }
Línea 43... Línea 53...
43
        }
53
        $CFG->geopluginapikey = TEST_GEOIP_APIKEY;
44
    }
54
    }
45
 
55