@@ -15,11 +15,13 @@ class AuthEventsTest extends TestCase
1515
1616 public function testAuthenticatedEventFillsUserOnScope (): void
1717 {
18- $ user = new AuthEventsTestUserModel () ;
18+ $ user = new AuthEventsTestUserModel ;
1919
20- $ user ->id = 123 ;
21- $ user ->username = 'username ' ;
22- $ user->
email =
'[email protected] ' ;
20+ $ user ->forceFill ([
21+ 'id ' => 123 ,
22+ 'username ' => 'username ' ,
23+ 24+ ]);
2325
2426 $ scope = $ this ->getCurrentSentryScope ();
2527
@@ -29,17 +31,19 @@ public function testAuthenticatedEventFillsUserOnScope(): void
2931
3032 $ this ->assertNotNull ($ scope ->getUser ());
3133
32- $ this ->assertEquals ($ scope ->getUser ()->getId (), 123 );
33- $ this ->assertEquals ($ scope ->getUser ()->getUsername (), ' username ' );
34- $ this ->
assertEquals (
$ scope->
getUser ()->
getEmail ()
, ' [email protected] ' );
34+ $ this ->assertEquals (123 , $ scope ->getUser ()->getId ());
35+ $ this ->assertEquals (' username ' , $ scope ->getUser ()->getUsername ());
36+ $ this ->
assertEquals (
' [email protected] ' , $ scope->
getUser ()->
getEmail ());
3537 }
3638
3739 public function testAuthenticatedEventFillsUserOnScopeWhenUsernameIsNotAString (): void
3840 {
3941 $ user = new AuthEventsTestUserModel ();
4042
41- $ user ->id = 123 ;
42- $ user ->username = 456 ;
43+ $ user ->forceFill ([
44+ 'id ' => 123 ,
45+ 'username ' => 456 ,
46+ ]);
4347
4448 $ scope = $ this ->getCurrentSentryScope ();
4549
@@ -49,8 +53,8 @@ public function testAuthenticatedEventFillsUserOnScopeWhenUsernameIsNotAString()
4953
5054 $ this ->assertNotNull ($ scope ->getUser ());
5155
52- $ this ->assertEquals ($ scope ->getUser ()->getId (), 123 );
53- $ this ->assertEquals ($ scope ->getUser ()->getUsername (), ' 456 ' );
56+ $ this ->assertEquals (123 , $ scope ->getUser ()->getId ());
57+ $ this ->assertEquals (' 456 ' , $ scope ->getUser ()->getUsername ());
5458 }
5559
5660 public function testAuthenticatedEventDoesNotFillUserOnScopeWhenPIIShouldNotBeSent (): void
0 commit comments