MDL-57001 user_menu: Fixes for unit tests

We added a link to the user menu so we have to adjust the tests.
This commit is contained in:
Damyon Wiese 2016-11-22 16:33:03 +08:00
parent 8c224317ee
commit 22b8c5b842
2 changed files with 3 additions and 2 deletions

View File

@ -93,8 +93,8 @@ test
// We always add two dividers as standard.
$dividercount += 2;
// The basic entry count will additionally include the wrapper menu, Dashboard, Profile, and the Logout link.
$entrycount += 3;
// The basic entry count will additionally include the wrapper menu, Dashboard, Profile, Logout and switch roles link.
$entrycount += 4;
$output = $OUTPUT->user_menu($USER);
preg_match_all('/<a [^>]+role="menuitem"[^>]+>/', $output, $results);

View File

@ -473,6 +473,7 @@ class core_userliblib_testcase extends advanced_testcase {
$testsize = 100;
$PAGE->set_url('/');
$user = $this->getDataGenerator()->create_user();
$opts = user_get_user_navigation_info($user, $PAGE, array('avatarsize' => $testsize));
$avatarhtml = $opts->metadata['useravatar'];