2020class FOSUserExtensionTest extends TestCase
2121{
2222 /** @var ContainerBuilder */
23- protected $ configuration ;
24-
25- protected function tearDown (): void
26- {
27- unset($ this ->configuration );
28- }
23+ private $ configuration ;
2924
3025 public function testUserLoadThrowsExceptionUnlessDatabaseDriverSet ()
3126 {
@@ -157,8 +152,12 @@ public function testDisableChangePassword()
157152
158153 /**
159154 * @dataProvider providerEmailsDisabledFeature
155+ *
156+ * @param array<string, mixed> $testConfig
157+ * @param array{address: string, sender_name: string} $registration
158+ * @param array{address: string, sender_name: string} $resetting
160159 */
161- public function testEmailsDisabledFeature ($ testConfig , $ registration , $ resetting )
160+ public function testEmailsDisabledFeature (array $ testConfig , array $ registration , array $ resetting )
162161 {
163162 $ this ->configuration = new ContainerBuilder ();
164163 $ loader = new FOSUserExtension ();
@@ -170,7 +169,10 @@ public function testEmailsDisabledFeature($testConfig, $registration, $resetting
170169 $ this ->assertParameter ($ resetting , 'fos_user.resetting.email.from_address ' );
171170 }
172171
173- public function providerEmailsDisabledFeature ()
172+ /**
173+ * @return iterable<array{array<string, mixed>, array{address: string, sender_name: string}, array{address: string, sender_name: string}}>
174+ */
175+ public function providerEmailsDisabledFeature (): iterable
174176 {
175177 $ configBothFeaturesDisabled = ['registration ' => false , 'resetting ' => false ];
176178 $ configResettingDisabled = ['resetting ' => false ];
@@ -343,7 +345,7 @@ public function testUserLoadFlashesCanBeDisabled()
343345 /**
344346 * @dataProvider userManagerSetFactoryProvider
345347 */
346- public function testUserManagerSetFactory ($ dbDriver , $ doctrineService )
348+ public function testUserManagerSetFactory (string $ dbDriver , string $ doctrineService )
347349 {
348350 $ this ->configuration = new ContainerBuilder ();
349351 $ loader = new FOSUserExtension ();
@@ -357,6 +359,7 @@ public function testUserManagerSetFactory($dbDriver, $doctrineService)
357359
358360 $ factory = $ definition ->getFactory ();
359361
362+ $ this ->assertIsArray ($ factory );
360363 $ this ->assertInstanceOf ('Symfony\Component\DependencyInjection\Reference ' , $ factory [0 ]);
361364 $ this ->assertSame ('fos_user.doctrine_registry ' , (string ) $ factory [0 ]);
362365 $ this ->assertSame ('getManager ' , $ factory [1 ]);
@@ -373,27 +376,23 @@ public function userManagerSetFactoryProvider(): iterable
373376 ];
374377 }
375378
376- protected function createEmptyConfiguration ()
379+ protected function createEmptyConfiguration (): void
377380 {
378381 $ this ->configuration = new ContainerBuilder ();
379382 $ loader = new FOSUserExtension ();
380383 $ config = $ this ->getEmptyConfig ();
381384 $ loader ->load ([$ config ], $ this ->configuration );
382- $ this ->assertTrue ($ this ->configuration instanceof ContainerBuilder);
383385 }
384386
385- protected function createFullConfiguration ()
387+ protected function createFullConfiguration (): void
386388 {
387389 $ this ->configuration = new ContainerBuilder ();
388390 $ loader = new FOSUserExtension ();
389391 $ config = $ this ->getFullConfig ();
390392 $ loader ->load ([$ config ], $ this ->configuration );
391- $ this ->assertTrue ($ this ->configuration instanceof ContainerBuilder);
392393 }
393394
394395 /**
395- * getEmptyConfig.
396- *
397396 * @return array<string, mixed>
398397 */
399398 protected function getEmptyConfig (): array
0 commit comments