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()
2929
3030 $ this ->assertSame ($ value , $ fieldProvider ->{$ method }());
3131 }
32-
32+
3333 public function testLaravelAuth ()
3434 {
3535 $ userId = 23452345 ;
@@ -71,6 +71,18 @@ public function testSentryGetUser()
7171 $ this ->assertSame ($ user ->id , $ currentUserId );
7272 }
7373
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+
7486 public function testQueryCount ()
7587 {
7688 $ this ->app ['understand.dataCollector ' ]->set ('sql_queries ' , range (1 , 1000 ));
You can’t perform that action at this time.
0 commit comments