This repository has been archived by the owner on Jul 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
TTO-153 Logged-in user doesn't see collections despite matching username #30
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/perl | ||
|
||
use strict; | ||
use warnings; | ||
use Test::More; | ||
|
||
use Utils; | ||
|
||
local %ENV = %ENV; | ||
|
||
subtest "Get_Remote_User_Names" => sub { | ||
my $save_remote_user = $ENV{REMOTE_USER}; | ||
my $save_eppn = $ENV{eppn}; | ||
|
||
subtest "with logged-in user" => sub { | ||
$ENV{eppn} = 'EPPN@default.invalid'; | ||
$ENV{REMOTE_USER} = 'REMOTE_USER@default.invalid'; | ||
my @names = Utils::Get_Remote_User_Names(); | ||
ok(1 <= scalar grep(/remote_user/, @names), "contains lowercase REMOTE_USER"); | ||
ok(1 <= scalar grep(/REMOTE_USER/, @names), "contains case-preserved REMOTE_USER"); | ||
ok(1 <= scalar grep(/eppn/, @names), "contains lowercase EPPN"); | ||
ok(1 <= scalar grep(/EPPN/, @names), "contains case-preserved EPPN"); | ||
}; | ||
|
||
subtest "with logged-out user" => sub { | ||
delete $ENV{REMOTE_USER}; | ||
delete $ENV{eppn}; | ||
my @names = Utils::Get_Remote_User_Names(); | ||
ok(1 == scalar @names, "there is one name"); | ||
ok('' eq $names[0], "name is empty string"); | ||
}; | ||
|
||
$ENV{REMOTE_USER} = $save_remote_user; | ||
$ENV{eppn} = $save_eppn; | ||
}; | ||
|
||
done_testing(); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, line 110 gets the lowercased
REMOTE_USER
, and this line gets a case-preserved version?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's right.