Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 44... Línea 44...
44
     * @Given /^I log in as "(?P<username_string>(?:[^"]|\\")*)"$/
44
     * @Given /^I log in as "(?P<username_string>(?:[^"]|\\")*)"$/
45
     * @Given I am logged in as :username
45
     * @Given I am logged in as :username
46
     * @param string $username the user to log in as.
46
     * @param string $username the user to log in as.
47
     * @param moodle_url|null $wantsurl optional, URL to go to after logging in.
47
     * @param moodle_url|null $wantsurl optional, URL to go to after logging in.
48
     */
48
     */
49
    public function i_log_in_as(string $username, moodle_url $wantsurl = null) {
49
    public function i_log_in_as(string $username, ?moodle_url $wantsurl = null) {
50
        // In the mobile app the required tasks are different (does not support $wantsurl).
50
        // In the mobile app the required tasks are different (does not support $wantsurl).
51
        if ($this->is_in_app()) {
51
        if ($this->is_in_app()) {
52
            $this->execute('behat_app::login', [$username]);
52
            $this->execute('behat_app::login', [$username]);
53
            return;
53
            return;
54
        }
54
        }