@@ -142,12 +142,12 @@ protected function getAuthenticationServiceMock(): AuthenticationServiceInterfac
142
142
/**
143
143
* test `initialize` function
144
144
*
145
- * @covers ::initialize()
146
145
* @return void
146
+ * @covers ::initialize()
147
147
*/
148
148
public function testInitialize (): void
149
149
{
150
- $ this ->setupControllerAndLogin ();
150
+ $ this ->setupController ();
151
151
152
152
static ::assertNotEmpty ($ this ->AppController ->{'RequestHandler ' });
153
153
static ::assertNotEmpty ($ this ->AppController ->{'Flash ' });
@@ -181,21 +181,20 @@ public function testBeforeFilterLoginError(): void
181
181
}
182
182
183
183
/**
184
- * test 'beforeFilter' for correct apiClient token setup
184
+ * test 'initialize' and ' beforeFilter' for correct apiClient token setup
185
185
*
186
- * @covers ::beforeFilter()
187
186
* @return void
187
+ * @covers ::beforeFilter()
188
+ * @covers ::initialize()
188
189
*/
189
- public function testBeforeFilterCorrectTokens (): void
190
+ public function testCorrectTokens (): void
190
191
{
191
192
$ expectedtokens = [];
192
-
193
193
$ this ->setupControllerAndLogin ();
194
-
195
194
/** @var \Authentication\Identity|null $user */
196
195
$ user = $ this ->AppController ->Authentication ->getIdentity ();
197
196
$ expectedtokens = $ user ->get ('tokens ' );
198
- $ this ->AppController ->dispatchEvent ( ' Controller. initialize' );
197
+ $ this ->AppController ->initialize ( );
199
198
$ apiClient = $ this ->accessProperty ($ this ->AppController , 'apiClient ' );
200
199
$ apiClientTokens = $ apiClient ->getTokens ();
201
200
0 commit comments