@@ -50,6 +50,9 @@ public function testLoginControllerCanBeCreated(): void
50
50
public function testExceptionHandlerIsCalledWhenAuthenticateThrowsException (): void
51
51
{
52
52
$ mockClient = Mockery::mock (OpenIDConnectClient::class);
53
+ $ mockClient
54
+ ->shouldReceive ('setLoginHint ' )
55
+ ->once ();
53
56
$ mockClient
54
57
->shouldReceive ('authenticate ' )
55
58
->andThrow (OpenIDConnectClientException::class);
@@ -64,12 +67,15 @@ public function testExceptionHandlerIsCalledWhenAuthenticateThrowsException(): v
64
67
$ mockExceptionHandler ,
65
68
);
66
69
67
- $ loginController ->__invoke ();
70
+ $ loginController ->__invoke (new Request () );
68
71
}
69
72
70
73
public function testExceptionHandlerIsCalledWhenRequestUserInfoDoesNotReturnAnObject (): void
71
74
{
72
75
$ mockClient = Mockery::mock (OpenIDConnectClient::class);
76
+ $ mockClient
77
+ ->shouldReceive ('setLoginHint ' )
78
+ ->once ();
73
79
$ mockClient ->shouldReceive ('authenticate ' )->once ();
74
80
$ mockClient
75
81
->shouldReceive ('requestUserInfo ' )
@@ -89,12 +95,15 @@ public function testExceptionHandlerIsCalledWhenRequestUserInfoDoesNotReturnAnOb
89
95
$ mockExceptionHandler ,
90
96
);
91
97
92
- $ loginController ->__invoke ();
98
+ $ loginController ->__invoke (new Request () );
93
99
}
94
100
95
101
public function testExceptionHandlerIsCalledWhenRequestUserInfoThrowsAnException (): void
96
102
{
97
103
$ mockClient = Mockery::mock (OpenIDConnectClient::class);
104
+ $ mockClient
105
+ ->shouldReceive ('setLoginHint ' )
106
+ ->once ();
98
107
$ mockClient ->shouldReceive ('authenticate ' )->once ();
99
108
$ mockClient
100
109
->shouldReceive ('requestUserInfo ' )
@@ -114,12 +123,15 @@ public function testExceptionHandlerIsCalledWhenRequestUserInfoThrowsAnException
114
123
$ mockExceptionHandler ,
115
124
);
116
125
117
- $ loginController ->__invoke ();
126
+ $ loginController ->__invoke (new Request () );
118
127
}
119
128
120
129
public function testExceptionHandlerIsCalledWhenRequestUserInfoThrowsAnJweDecryptException (): void
121
130
{
122
131
$ mockClient = Mockery::mock (OpenIDConnectClient::class);
132
+ $ mockClient
133
+ ->shouldReceive ('setLoginHint ' )
134
+ ->once ();
123
135
$ mockClient ->shouldReceive ('authenticate ' )->once ();
124
136
$ mockClient
125
137
->shouldReceive ('requestUserInfo ' )
@@ -139,12 +151,15 @@ public function testExceptionHandlerIsCalledWhenRequestUserInfoThrowsAnJweDecryp
139
151
$ mockExceptionHandler ,
140
152
);
141
153
142
- $ loginController ->__invoke ();
154
+ $ loginController ->__invoke (new Request () );
143
155
}
144
156
145
157
public function testLoginResponseIsReturnedWithUserInfo (): void
146
158
{
147
159
$ mockClient = Mockery::mock (OpenIDConnectClient::class);
160
+ $ mockClient
161
+ ->shouldReceive ('setLoginHint ' )
162
+ ->once ();
148
163
$ mockClient ->shouldReceive ('authenticate ' )->once ();
149
164
$ mockClient
150
165
->shouldReceive ('requestUserInfo ' )
@@ -158,7 +173,7 @@ public function testLoginResponseIsReturnedWithUserInfo(): void
158
173
$ mockExceptionHandler ,
159
174
);
160
175
161
- $ response = $ loginController ->__invoke ();
176
+ $ response = $ loginController ->__invoke (new Request () );
162
177
163
178
$ this ->assertInstanceOf (LoginResponseInterface::class, $ response );
164
179
$ this ->assertInstanceOf (Responsable::class, $ response );
@@ -167,6 +182,9 @@ public function testLoginResponseIsReturnedWithUserInfo(): void
167
182
public function testUserInfoIsReturned (): void
168
183
{
169
184
$ mockClient = Mockery::mock (OpenIDConnectClient::class);
185
+ $ mockClient
186
+ ->shouldReceive ('setLoginHint ' )
187
+ ->once ();
170
188
$ mockClient ->shouldReceive ('authenticate ' )->once ();
171
189
$ mockClient
172
190
->shouldReceive ('requestUserInfo ' )
@@ -180,7 +198,7 @@ public function testUserInfoIsReturned(): void
180
198
$ mockExceptionHandler ,
181
199
);
182
200
183
- $ loginResponse = $ loginController ->__invoke ();
201
+ $ loginResponse = $ loginController ->__invoke (new Request () );
184
202
$ response = $ loginResponse ->toResponse (Mockery::mock (Request::class));
185
203
186
204
$ this ->assertSame (json_encode ([
0 commit comments