File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public function testExtend()
29
29
30
30
$ this ->assertSame ($ value , $ fieldProvider ->{$ method }());
31
31
}
32
-
32
+
33
33
public function testLaravelAuth ()
34
34
{
35
35
$ userId = 23452345 ;
@@ -71,6 +71,18 @@ public function testSentryGetUser()
71
71
$ this ->assertSame ($ user ->id , $ currentUserId );
72
72
}
73
73
74
+ public function testFieldProviderThrowsAnException ()
75
+ {
76
+ $ loader = AliasLoader::getInstance ();
77
+ $ loader ->alias ('Sentry ' , '\Illuminate\Support\Facades\Auth ' );
78
+
79
+ \Illuminate \Support \Facades \Auth::shouldReceive ('getUser ' )->andThrow ('Exception ' );
80
+
81
+ $ currentUserId = $ this ->app ['understand.fieldProvider ' ]->getUserId ();
82
+
83
+ $ this ->assertNull ($ currentUserId );
84
+ }
85
+
74
86
public function testQueryCount ()
75
87
{
76
88
$ this ->app ['understand.dataCollector ' ]->set ('sql_queries ' , range (1 , 1000 ));
You can’t perform that action at this time.
0 commit comments