From 27d2f549d0f154dd6b7b6600b2659fda624d1b9b Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sat, 30 Apr 2016 07:28:18 +0200 Subject: [PATCH] MDL-53994 block_feedback: Add missing include Also, a little scenario has been added to have the behavior covered and prevent this to happen again. --- blocks/feedback/block_feedback.php | 4 ++++ mod/feedback/tests/behat/coursemapping.feature | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/blocks/feedback/block_feedback.php b/blocks/feedback/block_feedback.php index f67a9c9495220..add5034ef2433 100644 --- a/blocks/feedback/block_feedback.php +++ b/blocks/feedback/block_feedback.php @@ -22,6 +22,10 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +defined('MOODLE_INTERNAL') || die(); + +require_once($CFG->dirroot . '/mod/feedback/lib.php'); + class block_feedback extends block_list { function init() { diff --git a/mod/feedback/tests/behat/coursemapping.feature b/mod/feedback/tests/behat/coursemapping.feature index 8a814c16357ba..9d25b6faae3ce 100644 --- a/mod/feedback/tests/behat/coursemapping.feature +++ b/mod/feedback/tests/behat/coursemapping.feature @@ -222,3 +222,17 @@ Feature: Mapping courses in a feedback And I should see "2 (66.67 %)" in the "option e" "table_row" And I should see "0" in the "option f" "table_row" And I log out + + Scenario: Site feedback deletion hides feedback block completely + When I log in as "manager" + And I am on site homepage + And I follow "Turn editing on" + And I add the "Feedback" block + And I click on "Delete" "link" in the "//div[contains(@class,'block_site_main_menu')]//li[contains(.,'Course feedback')]" "xpath_element" + And I press "Yes" + And I follow "Turn editing off" + And I am on site homepage + Then "Feedback" "block" should not exist + And I follow "Course 1" + And "Feedback" "block" should not exist + And I log out