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    auth_oauth2
22
 * @package    auth_oauth2
23
 * @category   test
23
 * @category   test
24
 * @copyright  2019 Shamim Rezaie
24
 * @copyright  2019 Shamim Rezaie
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
 * @coversDefaultClass \auth_oauth2\auth
26
 * @covers \auth_oauth2\auth
27
 */
27
 */
28
class auth_test extends \advanced_testcase {
28
final class auth_test extends \advanced_testcase {
Línea 29... Línea 29...
29
 
29
 
30
    public function test_get_password_change_info(): void {
30
    public function test_get_password_change_info(): void {
Línea 31... Línea 31...
31
        $this->resetAfterTest();
31
        $this->resetAfterTest();
Línea 87... Línea 87...
87
 
87
 
88
        // Make sure the extra record is in the user_loggedin event.
88
        // Make sure the extra record is in the user_loggedin event.
89
        $extrauserinfo = $event->other['extrauserinfo'];
89
        $extrauserinfo = $event->other['extrauserinfo'];
90
        $this->assertEquals($info, $extrauserinfo);
90
        $this->assertEquals($info, $extrauserinfo);
-
 
91
    }
-
 
92
 
-
 
93
    /**
-
 
94
     *  Test case for checking the email greetings in the password change information email.
-
 
95
     */
-
 
96
    public function test_email_greetings(): void {
-
 
97
        $this->resetAfterTest();
-
 
98
        $user = $this->getDataGenerator()->create_user(['auth' => 'oauth2']);
-
 
99
        $auth = get_auth_plugin($user->auth);
-
 
100
        $info = $auth->get_password_change_info($user);
-
 
101
        $this->assertStringContainsString('Hi ' . $user->firstname, quoted_printable_decode($info['message']));
91
    }
102
    }