diff --git a/lib/tests/behat/securelayout.feature b/lib/tests/behat/securelayout.feature new file mode 100644 index 00000000000..f20c7c2dfc9 --- /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 00000000000..31ecba2624a --- /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 dbbca33501d..69833e28367 100644 --- a/theme/boost/templates/navbar-secure.mustache +++ b/theme/boost/templates/navbar-secure.mustache @@ -19,18 +19,12 @@ }}