File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Dcblogdev \MsGraph \Events \NewMicrosoft365SignInEvent ;
4+ use Illuminate \Support \Facades \Event ;
5+
6+ test ('NewMicrosoft365SignInEvent is dispatched with token data ' , function () {
7+ Event::fake ();
8+
9+ $ tokenData = [
10+ 'accessToken ' => 'fake_access_token ' ,
11+ 'refreshToken ' => 'fake_refresh_token ' ,
12+ 'expires ' => now ()->addHour ()->timestamp ,
13+ 'info ' => [
14+ 'mail ' => 'test@example.com ' ,
15+ 'displayName ' => 'Test User ' ,
16+ ],
17+ ];
18+
19+ // Dispatch the event
20+ event (new NewMicrosoft365SignInEvent ($ tokenData ));
21+
22+ // Assert event was dispatched
23+ Event::assertDispatched (NewMicrosoft365SignInEvent::class, function ($ event ) use ($ tokenData ) {
24+ return $ event ->token === $ tokenData ;
25+ });
26+ });
You can’t perform that action at this time.
0 commit comments