Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 23... Línea 23...
23
 * @category    test
23
 * @category    test
24
 * @copyright   2022 Andrew Lyons <andrew@nicols.co.uk>
24
 * @copyright   2022 Andrew Lyons <andrew@nicols.co.uk>
25
 * @license     http://www.gnu.org/copyleft/gpl.html GNU Public License
25
 * @license     http://www.gnu.org/copyleft/gpl.html GNU Public License
26
 * @covers      \core_external\util
26
 * @covers      \core_external\util
27
 */
27
 */
28
class util_test extends \advanced_testcase {
28
final class util_test extends \advanced_testcase {
29
    /** @var \moodle_database The database connection */
29
    /** @var \moodle_database The database connection */
30
    protected $db;
30
    protected $db;
Línea 31... Línea 31...
31
 
31
 
32
    /**
32
    /**
33
     * Store the global DB for restore between tests.
33
     * Store the global DB for restore between tests.
34
     */
34
     */
35
    public function setUp(): void {
35
    public function setUp(): void {
-
 
36
        global $DB;
Línea 36... Línea 37...
36
        global $DB;
37
        parent::setUp();
37
 
38
 
38
        $this->db = $DB;
39
        $this->db = $DB;
Línea 61... Línea 62...
61
        global $DB;
62
        global $DB;
62
        if ($this->db !== null) {
63
        if ($this->db !== null) {
63
            $DB = $this->db;
64
            $DB = $this->db;
64
        }
65
        }
65
        external_settings::reset();
66
        external_settings::reset();
-
 
67
        parent::tearDown();
66
    }
68
    }
Línea 67... Línea 69...
67
 
69
 
68
    /**
70
    /**
69
     * Validate courses, but still return courses even if they fail validation.
71
     * Validate courses, but still return courses even if they fail validation.