Skip to content

Commit 8ee5074

Browse files
Merge branch '6.3' into 6.4
* 6.3: [Console] Fix horizontal table top border is incorrectly rendered [Tests] Streamline [Uid] Fix UuidV7 collisions within the same ms [Validator] updated Romanian translation
2 parents 88f9f80 + 47c6af5 commit 8ee5074

File tree

8 files changed

+63
-15
lines changed

8 files changed

+63
-15
lines changed

Tests/DataCollector/SecurityDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ public function dispatch(object $event, string $eventName = null): object
397397
$this->assertSame($dataCollector->getVoterStrategy(), $strategy, 'Wrong value returned by getVoterStrategy');
398398
}
399399

400-
public static function provideRoles()
400+
public static function provideRoles(): array
401401
{
402402
return [
403403
// Basic roles

Tests/DependencyInjection/SecurityExtensionTest.php

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,27 @@ public function testSecretRememberMeHasher()
566566
$this->assertSame('very', $handler->getArgument(2));
567567
}
568568

569-
public function sessionConfigurationProvider()
569+
public function testSecretRememberMeHandler()
570+
{
571+
$container = $this->getRawContainer();
572+
573+
$container->register('custom_remember_me', \stdClass::class);
574+
$container->loadFromExtension('security', [
575+
'enable_authenticator_manager' => true,
576+
'firewalls' => [
577+
'default' => [
578+
'remember_me' => ['secret' => 'very', 'token_provider' => 'token_provider_id'],
579+
],
580+
],
581+
]);
582+
583+
$container->compile();
584+
585+
$handler = $container->getDefinition('security.authenticator.remember_me_handler.default');
586+
$this->assertSame('very', $handler->getArgument(1));
587+
}
588+
589+
public static function sessionConfigurationProvider(): array
570590
{
571591
return [
572592
[
@@ -670,10 +690,27 @@ public function testValidAccessControlWithEmptyRow()
670690
$this->assertTrue(true, 'extension throws an InvalidConfigurationException if there is one more more empty access control items');
671691
}
672692

693+
public static function provideEntryPointFirewalls(): iterable
694+
{
695+
// only one entry point available
696+
yield [['http_basic' => true], 'security.authenticator.http_basic.main'];
697+
// explicitly configured by authenticator key
698+
yield [['form_login' => true, 'http_basic' => true, 'entry_point' => 'form_login'], 'security.authenticator.form_login.main'];
699+
// explicitly configured another service
700+
yield [['form_login' => true, 'entry_point' => EntryPointStub::class], EntryPointStub::class];
701+
// no entry point required
702+
yield [['json_login' => true], null];
703+
704+
// only one guard authenticator entry point available
705+
yield [[
706+
'guard' => ['authenticators' => [AppCustomAuthenticator::class]],
707+
], 'security.authenticator.guard.main.0'];
708+
}
709+
673710
/**
674711
* @dataProvider provideEntryPointRequiredData
675712
*/
676-
public function testEntryPointRequired(array $firewall, $messageRegex)
713+
public function testEntryPointRequired(array $firewall, string $messageRegex)
677714
{
678715
$this->expectException(InvalidConfigurationException::class);
679716
$this->expectExceptionMessageMatches($messageRegex);
@@ -692,7 +729,7 @@ public function testEntryPointRequired(array $firewall, $messageRegex)
692729
$container->compile();
693730
}
694731

695-
public static function provideEntryPointRequiredData()
732+
public static function provideEntryPointRequiredData(): iterable
696733
{
697734
// more than one entry point available and not explicitly set
698735
yield [
@@ -723,7 +760,7 @@ public function testConfigureCustomAuthenticator(array $firewall, array $expecte
723760
$this->assertEquals($expectedAuthenticators, array_map('strval', $container->getDefinition('security.authenticator.manager.main')->getArgument(0)));
724761
}
725762

726-
public static function provideConfigureCustomAuthenticatorData()
763+
public static function provideConfigureCustomAuthenticatorData(): iterable
727764
{
728765
yield [
729766
['custom_authenticator' => TestAuthenticator::class],
@@ -800,7 +837,7 @@ public function testUserCheckerWithAuthenticatorManager(array $config, string $e
800837
$this->assertEquals($expectedUserCheckerClass, $container->findDefinition($userCheckerId)->getClass());
801838
}
802839

803-
public static function provideUserCheckerConfig()
840+
public static function provideUserCheckerConfig(): iterable
804841
{
805842
yield [[], InMemoryUserChecker::class];
806843
yield [['user_checker' => TestUserChecker::class], TestUserChecker::class];

Tests/Functional/AuthenticatorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function testWithoutUserProvider($email)
6060
$this->assertJsonStringEqualsJsonString('{"email":"'.$email.'"}', $client->getResponse()->getContent());
6161
}
6262

63-
public static function provideEmails()
63+
public static function provideEmails(): iterable
6464
{
6565
yield ['[email protected]', true];
6666
yield ['[email protected]', false];
@@ -84,7 +84,7 @@ public function testLoginUsersWithMultipleFirewalls(string $username, string $fi
8484
$this->assertEquals('Welcome '.$username.'!', $client->getResponse()->getContent());
8585
}
8686

87-
public static function provideEmailsWithFirewalls()
87+
public static function provideEmailsWithFirewalls(): iterable
8888
{
8989
yield ['[email protected]', 'main'];
9090
yield ['[email protected]', 'custom'];

Tests/Functional/CsrfFormLoginTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function testFormLoginRedirectsToProtectedResourceAfterLogin($options)
122122
$this->assertStringContainsString('You\'re browsing to path "/protected-resource".', $text);
123123
}
124124

125-
public static function provideClientOptions()
125+
public static function provideClientOptions(): iterable
126126
{
127127
yield [['test_case' => 'CsrfFormLogin', 'root_config' => 'config.yml']];
128128
yield [['test_case' => 'CsrfFormLogin', 'root_config' => 'routes_as_path.yml']];

Tests/Functional/FormLoginTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public function testLoginThrottling()
147147
}
148148
}
149149

150-
public static function provideClientOptions()
150+
public static function provideClientOptions(): iterable
151151
{
152152
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'base_config.yml']];
153153
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'routes_as_path.yml']];

Tests/Functional/RememberMeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function testSessionLessRememberMeLogout()
9393
$this->assertNull($cookieJar->get('REMEMBERME'));
9494
}
9595

96-
public static function provideConfigs()
96+
public static function provideConfigs(): iterable
9797
{
9898
yield [['root_config' => 'config_session.yml']];
9999
yield [['root_config' => 'config_persistent.yml']];

Tests/Functional/SecurityRoutingIntegrationTest.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ public function testInvalidIpsInAccessControl()
125125
$this->expectException(\LogicException::class);
126126
$this->expectExceptionMessage('The given value "256.357.458.559" in the "security.access_control" config option is not a valid IP address.');
127127

128-
$client = $this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => 'invalid_ip_access_control.yml']);
129-
$client->request('GET', '/unprotected_resource');
128+
$this->createClient(['test_case' => 'StandardFormLogin', 'root_config' => 'invalid_ip_access_control.yml']);
130129
}
131130

132131
public function testPublicHomepage()
@@ -151,7 +150,19 @@ private function assertRestricted($client, $path)
151150
$this->assertEquals(302, $client->getResponse()->getStatusCode());
152151
}
153152

154-
public static function provideConfigs()
153+
public static function provideClientOptions(): iterable
154+
{
155+
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'base_config.yml', 'enable_authenticator_manager' => true]];
156+
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'routes_as_path.yml', 'enable_authenticator_manager' => true]];
157+
}
158+
159+
public static function provideLegacyClientOptions()
160+
{
161+
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'base_config.yml', 'enable_authenticator_manager' => true]];
162+
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'routes_as_path.yml', 'enable_authenticator_manager' => true]];
163+
}
164+
165+
public static function provideConfigs(): iterable
155166
{
156167
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'base_config.yml']];
157168
yield [['test_case' => 'StandardFormLogin', 'root_config' => 'routes_as_path.yml']];

Tests/Functional/SecurityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function testUserWillBeMarkedAsChangedIfRolesHasChanged(UserInterface $us
7676
$this->assertEquals(302, $client->getResponse()->getStatusCode());
7777
}
7878

79-
public static function userWillBeMarkedAsChangedIfRolesHasChangedProvider()
79+
public static function userWillBeMarkedAsChangedIfRolesHasChangedProvider(): array
8080
{
8181
return [
8282
[

0 commit comments

Comments
 (0)