Skip to content

Commit

Permalink
Merge branch 'MDL-79840-403' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_403_STABLE
  • Loading branch information
HuongNV13 committed Nov 8, 2023
2 parents b2e58ae + cf715c5 commit 81d7225
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 41 deletions.
10 changes: 1 addition & 9 deletions contentbank/classes/contenttype.php
Expand Up @@ -14,14 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Content type manager class
*
* @package core_contentbank
* @copyright 2020 Amaia Anabitarte <amaia@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace core_contentbank;

use core\event\contentbank_content_created;
Expand Down Expand Up @@ -286,7 +278,7 @@ public function get_download_url(content $content): string {
*/
public function get_icon(content $content): string {
global $OUTPUT;
return $OUTPUT->image_url('f/unknown-64', 'moodle')->out(false);
return $OUTPUT->image_url('f/unknown')->out(false);
}

/**
Expand Down
17 changes: 6 additions & 11 deletions contentbank/tests/contenttype_test.php
Expand Up @@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Test for content bank contenttype class.
*
* @package core_contentbank
* @category test
* @copyright 2020 Amaia Anabitarte <amaia@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace core_contentbank;

use stdClass;
Expand Down Expand Up @@ -104,15 +95,19 @@ public function test_get_plugin_name() {
* @covers ::get_icon
*/
public function test_get_icon() {
global $CFG;

$this->resetAfterTest();

$systemcontext = \context_system::instance();
$testable = new contenttype($systemcontext);
$record = new stdClass();
$record->name = 'New content';
$content = $testable->create_content($record);
$icon = $testable->get_icon($content);
$this->assertStringContainsString('archive', $icon);
$this->assertEquals(
"{$CFG->wwwroot}/theme/image.php/boost/core/1/f/unknown",
$testable->get_icon($content),
);
}

/**
Expand Down
21 changes: 0 additions & 21 deletions contentbank/tests/fixtures/testable_contenttype.php
Expand Up @@ -14,15 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Testable contenttype plugin class.
*
* @package core_contentbank
* @category test
* @copyright 2020 Sara Arjona <sara@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

namespace contenttype_testable;

/**
Expand All @@ -40,18 +31,6 @@ class contenttype extends \core_contentbank\contenttype {
/** @var array Additional features for testing */
public static $featurestotest;

/**
* Returns the HTML code to render the icon for content bank contents.
*
* @param content $content The content to delete.
* @return string HTML code to render the icon
*/
public function get_icon(\core_contentbank\content $content): string {
global $OUTPUT;

return $OUTPUT->image_url('f/archive-64', 'moodle')->out(false);
}

/**
* Return an array of implemented features by this plugin.
*
Expand Down

0 comments on commit 81d7225

Please sign in to comment.