mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
Merge branch 'MDL-82904-main' of https://github.com/laurentdavid/moodle
This commit is contained in:
commit
88c39c1766
@ -74,6 +74,6 @@ Feature: Import course's contents into another course
|
||||
And I should see "Unpublished course badge"
|
||||
And I should see "Unpublished without criteria course badge"
|
||||
# Badges exist and the criteria have been restored too.
|
||||
And I should not see "Criteria for this badge have not been set up yet" in the "Published course badge" "table_row"
|
||||
And I should not see "Criteria for this badge have not been set up yet" in the "Unpublished course badge" "table_row"
|
||||
And I should see "Criteria for this badge have not been set up yet" in the "Unpublished without criteria course badge" "table_row"
|
||||
And ".no-criteria-set" "css_element" should not exist in the "Published course badge" "table_row"
|
||||
And ".no-criteria-set" "css_element" should not exist in the "Unpublished course badge" "table_row"
|
||||
And ".no-criteria-set" "css_element" should exist in the "Unpublished without criteria course badge" "table_row"
|
||||
|
@ -290,11 +290,11 @@ Feature: Restore Moodle 2 course backups
|
||||
And I should see "Unpublished course badge"
|
||||
And I should see "Unpublished without criteria course badge"
|
||||
# If activities were included, the criteria have been restored too; otherwise no criteria have been set up for badges.
|
||||
And I <shouldornotsee> "Criteria for this badge have not been set up yet" in the "Published course badge" "table_row"
|
||||
And I <shouldornotsee> "Criteria for this badge have not been set up yet" in the "Unpublished course badge" "table_row"
|
||||
And I should see "Criteria for this badge have not been set up yet" in the "Unpublished without criteria course badge" "table_row"
|
||||
And ".no-criteria-set" "css_element" <shouldornotexist> in the "Published course badge" "table_row"
|
||||
And ".no-criteria-set" "css_element" <shouldornotexist> in the "Unpublished course badge" "table_row"
|
||||
And ".no-criteria-set" "css_element" should exist in the "Unpublished without criteria course badge" "table_row"
|
||||
|
||||
Examples:
|
||||
| includeactivities | shouldornotsee |
|
||||
| 0 | should see |
|
||||
| 1 | should not see |
|
||||
| includeactivities | shouldornotexist |
|
||||
| 0 | should exist |
|
||||
| 1 | should not exist |
|
||||
|
@ -160,7 +160,9 @@ class badge extends base {
|
||||
return '';
|
||||
}
|
||||
$badge = new \core_badges\badge($badgeid);
|
||||
|
||||
if (empty($badge->criteria)) {
|
||||
return '<span class="no-criteria-set d-none"></span>';
|
||||
}
|
||||
$renderer = $PAGE->get_renderer('core_badges');
|
||||
return $renderer->print_badge_criteria($badge, 'short');
|
||||
});
|
||||
|
@ -189,7 +189,7 @@ final class badges_test extends core_reportbuilder_testcase {
|
||||
$this->assertEquals($badgetwo->name, $badgename);
|
||||
$this->assertEmpty($fullname);
|
||||
$this->assertEquals($expectedbadgetwolink, $namewithlink);
|
||||
$this->assertEquals('Criteria for this badge have not been set up yet.', $criteria);
|
||||
$this->assertStringContainsString('no-criteria-set', $criteria);
|
||||
$this->assertStringContainsString('Image caption', $image);
|
||||
$this->assertEquals('English', $language);
|
||||
$this->assertEquals(2, $version);
|
||||
|
@ -193,7 +193,7 @@ class users_test extends core_reportbuilder_testcase {
|
||||
$this->assertEquals(fullname($user), $fullname);
|
||||
$this->assertEquals($badgecourse->name, $badgename);
|
||||
$this->assertEquals($expectedbadgecourselink, $namewithlink);
|
||||
$this->assertEquals('Criteria for this badge have not been set up yet.', $criteria);
|
||||
$this->assertStringContainsString('no-criteria-set', $criteria);
|
||||
$this->assertStringContainsString('Image caption', $image);
|
||||
$this->assertEquals('English', $language);
|
||||
$this->assertEquals(2, $version);
|
||||
|
Loading…
x
Reference in New Issue
Block a user