MDL-79840 contentbank: fix references to invalid icon images.
This commit is contained in:
@@ -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 <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core_contentbank;
|
||||
|
||||
use core\event\contentbank_content_created;
|
||||
@@ -286,7 +278,7 @@ abstract class contenttype {
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core_contentbank;
|
||||
|
||||
use stdClass;
|
||||
@@ -104,6 +95,8 @@ class contenttype_test extends \advanced_testcase {
|
||||
* @covers ::get_icon
|
||||
*/
|
||||
public function test_get_icon() {
|
||||
global $CFG;
|
||||
|
||||
$this->resetAfterTest();
|
||||
|
||||
$systemcontext = \context_system::instance();
|
||||
@@ -111,8 +104,10 @@ class contenttype_test extends \advanced_testcase {
|
||||
$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),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 <[email protected]>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace contenttype_testable;
|
||||
|
||||
/**
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user