Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 29... Línea 29...
29
 * @package    core_backup
29
 * @package    core_backup
30
 * @category   test
30
 * @category   test
31
 * @copyright  2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
31
 * @copyright  2010 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
32
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
33
 */
33
 */
34
class restore_dbops_test extends \advanced_testcase {
34
final class restore_dbops_test extends \advanced_testcase {
Línea 35... Línea 35...
35
 
35
 
36
    /**
36
    /**
37
     * Verify the xxx_ids_cached (in-memory backup_ids cache) stuff works as expected.
37
     * Verify the xxx_ids_cached (in-memory backup_ids cache) stuff works as expected.
38
     *
38
     *
Línea 122... Línea 122...
122
    }
122
    }
Línea 123... Línea 123...
123
 
123
 
124
    /**
124
    /**
125
     * Data provider for {@link test_precheck_user()}
125
     * Data provider for {@link test_precheck_user()}
126
     */
126
     */
127
    public function precheck_user_provider() {
-
 
128
 
127
    public static function precheck_user_provider(): array {
129
        $emailmultiplier = [
128
        $emailmultiplier = [
130
            'shortmail' => 'normalusername@example.com',
129
            'shortmail' => 'normalusername@example.com',
131
            'longmail' => str_repeat('a', 100)  // It's not validated, hence any string is ok.
130
            'longmail' => str_repeat('a', 100)  // It's not validated, hence any string is ok.
Línea 132... Línea 131...
132
        ];
131
        ];
Línea 133... Línea 132...
133
 
132
 
134
        $providercases = [];
133
        $providercases = [];
135
 
134
 
136
        foreach ($emailmultiplier as $emailk => $email) {
135
        foreach ($emailmultiplier as $emailk => $email) {
137
            // Get the related cases.
136
            // Get the related cases.
138
            $cases = $this->precheck_user_cases($email);
137
            $cases = self::precheck_user_cases($email);
139
            // Rename them (keys).
138
            // Rename them (keys).
140
            foreach ($cases as $key => $case) {
139
            foreach ($cases as $key => $case) {
Línea 148... Línea 147...
148
    /**
147
    /**
149
     * Get all the cases implemented in {@link restore_dbops::precheck_users()}
148
     * Get all the cases implemented in {@link restore_dbops::precheck_users()}
150
     *
149
     *
151
     * @param string $email
150
     * @param string $email
152
     */
151
     */
153
    private function precheck_user_cases($email) {
152
    private static function precheck_user_cases($email) {
154
        global $CFG;
153
        global $CFG;
Línea 155... Línea 154...
155
 
154
 
156
        $baseuserarr = [
155
        $baseuserarr = [
157
            'username' => 'normalusername',
156
            'username' => 'normalusername',