From c430bed525c4c7e6e5a1c0f7222bc323cf9b6245 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luca=20B=C3=B6sch?= Date: Fri, 25 Jan 2019 16:03:22 +0100 Subject: [PATCH] MDL-64706 theme_boost: Remove logo link in secure template --- lib/tests/behat/securelayout.feature | 21 +++++++++++ lib/tests/fixtures/securetestpage.php | 37 ++++++++++++++++++++ theme/boost/templates/navbar-secure.mustache | 18 ++++------ 3 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 lib/tests/behat/securelayout.feature create mode 100644 lib/tests/fixtures/securetestpage.php diff --git a/lib/tests/behat/securelayout.feature b/lib/tests/behat/securelayout.feature new file mode 100644 index 0000000000000..f20c7c2dfc901 --- /dev/null +++ b/lib/tests/behat/securelayout.feature @@ -0,0 +1,21 @@ +@core +Feature: Page displaying with secure layout + In order to securely perform tasks + As a student + I need not to be able to exit the page using the header logo + + Background: + # Get to the fixture page. + Given the following "courses" exist: + | fullname | shortname | format | + | Course 1 | C1 | topics | + And the following "activities" exist: + | activity | name | intro | course | idnumber | + | label | L1 | Fixture link | C1 | label1 | + + Scenario: Confirm that there is no header link + Given I log in as "admin" + And I am on "Course 1" course homepage + When I follow "Fixture link" + Then I should see "Acceptance test site" in the "nav" "css_element" + But "Acceptance test site" "link" should not exist diff --git a/lib/tests/fixtures/securetestpage.php b/lib/tests/fixtures/securetestpage.php new file mode 100644 index 0000000000000..31ecba2624a20 --- /dev/null +++ b/lib/tests/fixtures/securetestpage.php @@ -0,0 +1,37 @@ +. + +/** + * Fixture for testing secure layout pages have no nav link. + * + * @package core + * @copyright 2019 Luca Bösch + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +require_once(__DIR__ . '/../../../config.php'); +// Behat test fixture only. +defined('BEHAT_SITE_RUNNING') || die('Only available on Behat test server'); + +$PAGE->set_pagelayout('secure'); +$PAGE->set_url('/lib/tests/fixtures/securetestpage.php'); +$PAGE->set_context(context_system::instance()); + +echo $OUTPUT->header(); + +echo $OUTPUT->heading('Hello world'); + +echo $OUTPUT->footer(); diff --git a/theme/boost/templates/navbar-secure.mustache b/theme/boost/templates/navbar-secure.mustache index 8dadab0f8a6ec..45f88be810331 100644 --- a/theme/boost/templates/navbar-secure.mustache +++ b/theme/boost/templates/navbar-secure.mustache @@ -19,18 +19,12 @@ }}