Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/monara/public_html/test.athavaneng.com/themes.php on line 99
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 226
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 227
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 228
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 230
Warning: Cannot modify header information - headers already sent by (output started at /home/monara/public_html/test.athavaneng.com/themes.php:1) in /home/monara/public_html/test.athavaneng.com/themes.php on line 231
.
declare(strict_types=1);
use core_badges\badge;
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once("{$CFG->libdir}/badgeslib.php");
/**
* Badges test generator
*
* @package core_badges
* @copyright 2022 Paul Holden
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_badges_generator extends component_generator_base {
/**
* Create badge
*
* TODO: MDL-73648 Use from Behat too
*
* @param array|stdClass $record
*/
public function create_badge($record): badge {
global $DB, $USER;
$record = (object) array_merge([
'name' => 'Test badge',
'description' => 'Testing badges',
'timecreated' => time(),
'timemodified' => time(),
'usercreated' => $USER->id,
'usermodified' => $USER->id,
'issuername' => 'Test issuer',
'issuerurl' => 'http://issuer-url.domain.co.nz',
'issuercontact' => 'issuer@example.com',
'expiredate' => null,
'expireperiod' => null,
'type' => BADGE_TYPE_SITE,
'courseid' => null,
'messagesubject' => 'Test message subject',
'message' => 'Test message body',
'attachment' => 1,
'notification' => 0,
'status' => BADGE_STATUS_ACTIVE,
'version' => OPEN_BADGES_V2,
'language' => 'en',
'imageauthorname' => 'Image author',
'imageauthoremail' => 'author@example.com',
'imageauthorurl' => 'http://image.example.com/',
'imagecaption' => 'Image caption'
], (array) $record);
$record->id = $DB->insert_record('badge', $record);
return new badge($record->id);
}
}