Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 21... Línea 21...
21
 *
21
 *
22
 * @package    core
22
 * @package    core
23
 * @copyright  2015 onwards Ankit agarwal <ankit.agrr@gmail.com>
23
 * @copyright  2015 onwards Ankit agarwal <ankit.agrr@gmail.com>
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
24
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later.
25
 */
25
 */
26
class myprofilelib_test extends \advanced_testcase {
26
final class myprofilelib_test extends \advanced_testcase {
Línea 27... Línea 27...
27
 
27
 
28
    /**
28
    /**
29
     * @var stdClass The user.
29
     * @var stdClass The user.
30
     */
30
     */
Línea 45... Línea 45...
45
     */
45
     */
46
    public static function setUpBeforeClass(): void {
46
    public static function setUpBeforeClass(): void {
47
        global $CFG;
47
        global $CFG;
48
        require_once($CFG->dirroot . '/lib/myprofilelib.php');
48
        require_once($CFG->dirroot . '/lib/myprofilelib.php');
49
        require_once($CFG->dirroot . '/user/profile/lib.php');
49
        require_once($CFG->dirroot . '/user/profile/lib.php');
-
 
50
        parent::setUpBeforeClass();
50
    }
51
    }
Línea 51... Línea 52...
51
 
52
 
52
    public function setUp(): void {
53
    public function setUp(): void {
53
        // Set the $PAGE->url value so core_myprofile_navigation() doesn't complain.
54
        // Set the $PAGE->url value so core_myprofile_navigation() doesn't complain.
-
 
55
        global $PAGE;
54
        global $PAGE;
56
        parent::setUp();
Línea 55... Línea 57...
55
        $PAGE->set_url('/test');
57
        $PAGE->set_url('/test');
56
 
58
 
57
        $this->user = $this->getDataGenerator()->create_user();
59
        $this->user = $this->getDataGenerator()->create_user();
Línea 222... Línea 224...
222
    /**
224
    /**
223
     * Data provider for {@see test_core_myprofile_navigation_contact_timezone}
225
     * Data provider for {@see test_core_myprofile_navigation_contact_timezone}
224
     *
226
     *
225
     * @return array[]
227
     * @return array[]
226
     */
228
     */
227
    public function core_myprofile_navigation_contact_timezone_provider(): array {
229
    public static function core_myprofile_navigation_contact_timezone_provider(): array {
228
        return [
230
        return [
229
            'Hidden field' => ['timezone', '99', '99', null],
231
            'Hidden field' => ['timezone', '99', '99', null],
230
            'Forced timezone' => ['', 'Europe/London', 'Pacific/Tahiti', 'Europe/London'],
232
            'Forced timezone' => ['', 'Europe/London', 'Pacific/Tahiti', 'Europe/London'],
231
            'User timezone (default)' => ['', '99', '99', 'Australia/Perth'],
233
            'User timezone (default)' => ['', '99', '99', 'Australia/Perth'],
232
            'User timezone (selected)' => ['', '99', 'Pacific/Tahiti', 'Pacific/Tahiti'],
234
            'User timezone (selected)' => ['', '99', 'Pacific/Tahiti', 'Pacific/Tahiti'],