Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 27... Línea 27...
27
class profile_manager_test extends \advanced_testcase {
27
class profile_manager_test extends \advanced_testcase {
Línea 28... Línea 28...
28
 
28
 
29
    /**
29
    /**
30
     * Test that on this site we use the user table to hold moodle net profile information.
30
     * Test that on this site we use the user table to hold moodle net profile information.
31
     */
31
     */
32
    public function test_official_profile_exists() {
32
    public function test_official_profile_exists(): void {
33
        $this->assertTrue(\tool_moodlenet\profile_manager::official_profile_exists());
33
        $this->assertTrue(\tool_moodlenet\profile_manager::official_profile_exists());
Línea 34... Línea 34...
34
    }
34
    }
35
 
35
 
36
    /**
36
    /**
37
     * Test a null is returned when the user's mnet profile field is not set.
37
     * Test a null is returned when the user's mnet profile field is not set.
38
     */
38
     */
39
    public function test_get_moodlenet_user_profile_no_profile_set() {
39
    public function test_get_moodlenet_user_profile_no_profile_set(): void {
Línea 40... Línea 40...
40
        $this->resetAfterTest();
40
        $this->resetAfterTest();
41
        $user = $this->getDataGenerator()->create_user();
41
        $user = $this->getDataGenerator()->create_user();
42
 
42
 
Línea 43... Línea 43...
43
        $result = \tool_moodlenet\profile_manager::get_moodlenet_user_profile($user->id);
43
        $result = \tool_moodlenet\profile_manager::get_moodlenet_user_profile($user->id);
44
        $this->assertNull($result);
44
        $this->assertNull($result);
45
    }
45
    }
46
 
46
 
47
    /**
47
    /**
48
     * Test a null is returned when the user's mnet profile field is not set.
48
     * Test a null is returned when the user's mnet profile field is not set.
Línea 49... Línea 49...
49
     */
49
     */
50
    public function test_moodlenet_user_profile_creation_no_profile_set() {
50
    public function test_moodlenet_user_profile_creation_no_profile_set(): void {
Línea 57... Línea 57...
57
    }
57
    }
Línea 58... Línea 58...
58
 
58
 
59
    /**
59
    /**
60
     * Test the return of a moodle net profile.
60
     * Test the return of a moodle net profile.
61
     */
61
     */
62
    public function test_get_moodlenet_user_profile() {
62
    public function test_get_moodlenet_user_profile(): void {
63
        $this->resetAfterTest();
63
        $this->resetAfterTest();
Línea 64... Línea 64...
64
        $user = $this->getDataGenerator()->create_user(['moodlenetprofile' => '@matt@hq.mnet']);
64
        $user = $this->getDataGenerator()->create_user(['moodlenetprofile' => '@matt@hq.mnet']);
65
 
65
 
66
        $result = \tool_moodlenet\profile_manager::get_moodlenet_user_profile($user->id);
66
        $result = \tool_moodlenet\profile_manager::get_moodlenet_user_profile($user->id);
Línea 67... Línea 67...
67
        $this->assertEquals($user->moodlenetprofile, $result->get_profile_name());
67
        $this->assertEquals($user->moodlenetprofile, $result->get_profile_name());
68
    }
68
    }
69
 
69
 
70
    /**
70
    /**
71
     * Test the creation of a user profile category.
71
     * Test the creation of a user profile category.
72
     */
72
     */
Línea 73... Línea 73...
73
    public function test_create_user_profile_category() {
73
    public function test_create_user_profile_category(): void {
Línea 93... Línea 93...
93
    }
93
    }
Línea 94... Línea 94...
94
 
94
 
95
    /**
95
    /**
96
     * Test the creating of the custom user profile field to hold the moodle net profile.
96
     * Test the creating of the custom user profile field to hold the moodle net profile.
97
     */
97
     */
98
    public function test_create_user_profile_text_field() {
98
    public function test_create_user_profile_text_field(): void {
99
        global $DB;
99
        global $DB;
Línea 100... Línea 100...
100
        $this->resetAfterTest();
100
        $this->resetAfterTest();
Línea 118... Línea 118...
118
    }
118
    }
Línea 119... Línea 119...
119
 
119
 
120
    /**
120
    /**
121
     * Test that the user moodlenet profile is saved.
121
     * Test that the user moodlenet profile is saved.
122
     */
122
     */
123
    public function test_save_moodlenet_user_profile() {
123
    public function test_save_moodlenet_user_profile(): void {
Línea 124... Línea 124...
124
        $this->resetAfterTest();
124
        $this->resetAfterTest();
125
 
125