File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace UnityWebPortal \lib ;
4
4
5
+ use UnityWebPortal \lib \exceptions \SSOException ;
5
6
use PHPUnit \Framework \TestCase ;
6
7
7
8
class UnitySSOTest extends TestCase
@@ -22,4 +23,28 @@ public function testMultipleAttributeValues()
22
23
$ _PREVIOUS_SERVER = $ _SERVER ;
23
24
}
24
25
}
26
+
27
+ public function testUnsetAttribute ()
28
+ {
29
+ $ PREVIOUS_SERVER = $ _SERVER ;
30
+ $ this ->expectException (SSOException::class);
31
+ try {
32
+ unset($ _SERVER ["REMOTE_USER " ]);
33
+ $ sso = UnitySSO::getSSO ();
34
+ } finally {
35
+ $ _PREVIOUS_SERVER = $ _SERVER ;
36
+ }
37
+ }
38
+
39
+ public function testEmptyAttribute ()
40
+ {
41
+ $ PREVIOUS_SERVER = $ _SERVER ;
42
+ $ this ->expectException (SSOException::class);
43
+ try {
44
+ $ _SERVER ["REMOTE_USER " ] = "" ;
45
+ $ sso = UnitySSO::getSSO ();
46
+ } finally {
47
+ $ _PREVIOUS_SERVER = $ _SERVER ;
48
+ }
49
+ }
25
50
}
You can’t perform that action at this time.
0 commit comments