| Línea 45... |
Línea 45... |
| 45 |
* @category test
|
45 |
* @category test
|
| 46 |
* @copyright 2018 Frédéric Massart
|
46 |
* @copyright 2018 Frédéric Massart
|
| 47 |
* @author Frédéric Massart <fred@branchup.tech>
|
47 |
* @author Frédéric Massart <fred@branchup.tech>
|
| 48 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
48 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
| 49 |
*/
|
49 |
*/
|
| 50 |
class provider_test extends provider_testcase {
|
50 |
final class provider_test extends provider_testcase {
|
| Línea 51... |
Línea 51... |
| 51 |
|
51 |
|
| - |
|
52 |
public function setUp(): void {
|
| 52 |
public function setUp(): void {
|
53 |
parent::setUp();
|
| 53 |
$this->resetAfterTest();
|
54 |
$this->resetAfterTest();
|
| Línea 54... |
Línea 55... |
| 54 |
}
|
55 |
}
|
| 55 |
|
56 |
|
| Línea 339... |
Línea 340... |
| 339 |
$path = [get_string('badges', 'core_badges'), "{$b1->name} ({$b1->id})"];
|
340 |
$path = [get_string('badges', 'core_badges'), "{$b1->name} ({$b1->id})"];
|
| 340 |
$data = writer::with_context($u1ctx)->get_data($path);
|
341 |
$data = writer::with_context($u1ctx)->get_data($path);
|
| 341 |
$this->assertEquals($b1->name, $data->name);
|
342 |
$this->assertEquals($b1->name, $data->name);
|
| 342 |
$this->assertEquals($b1->version, $data->version);
|
343 |
$this->assertEquals($b1->version, $data->version);
|
| 343 |
$this->assertEquals($b1->language, $data->language);
|
344 |
$this->assertEquals($b1->language, $data->language);
|
| 344 |
$this->assertEquals($b1->imageauthorname, $data->imageauthorname);
|
- |
|
| 345 |
$this->assertEquals($b1->imageauthoremail, $data->imageauthoremail);
|
- |
|
| 346 |
$this->assertEquals($b1->imageauthorurl, $data->imageauthorurl);
|
- |
|
| 347 |
$this->assertEquals($b1->imagecaption, $data->imagecaption);
|
345 |
$this->assertEquals($b1->imagecaption, $data->imagecaption);
|
| 348 |
$this->assertNotEmpty($data->issued);
|
346 |
$this->assertNotEmpty($data->issued);
|
| 349 |
$this->assertEmpty($data->manual_award);
|
347 |
$this->assertEmpty($data->manual_award);
|
| 350 |
$this->assertEmpty($data->criteria_met);
|
348 |
$this->assertEmpty($data->criteria_met);
|
| 351 |
$this->assertFalse(isset($data->course));
|
349 |
$this->assertFalse(isset($data->course));
|
| Línea 637... |
Línea 635... |
| 637 |
'attachment' => 1,
|
635 |
'attachment' => 1,
|
| 638 |
'notification' => 0,
|
636 |
'notification' => 0,
|
| 639 |
'status' => BADGE_STATUS_ACTIVE,
|
637 |
'status' => BADGE_STATUS_ACTIVE,
|
| 640 |
'version' => OPEN_BADGES_V2,
|
638 |
'version' => OPEN_BADGES_V2,
|
| 641 |
'language' => 'en',
|
639 |
'language' => 'en',
|
| 642 |
'imageauthorname' => 'Image author',
|
- |
|
| 643 |
'imageauthoremail' => 'author@example.com',
|
- |
|
| 644 |
'imageauthorurl' => 'http://image.example.com/',
|
- |
|
| 645 |
'imagecaption' => 'Image caption'
|
640 |
'imagecaption' => 'Image caption'
|
| 646 |
], $params);
|
641 |
], $params);
|
| 647 |
$record->id = $DB->insert_record('badge', $record);
|
642 |
$record->id = $DB->insert_record('badge', $record);
|
| Línea 648... |
Línea 643... |
| 648 |
|
643 |
|