Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f8fe5d

Browse files
Merge branch '4.4' into 5.0
* 4.4: [Routing] fix tests [Form] group constraints when calling the validator Remove wrong @group legacy annotations [DependencyInjection] Fix dumping multiple deprecated aliases allow button names to start with uppercase letter States that the HttpClient provides a Http Async implementation
2 parents c41fa26 + 2c1b1ba commit 0f8fe5d

File tree

18 files changed

+43
-43
lines changed

18 files changed

+43
-43
lines changed

UPGRADE-4.3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Form
9696
----
9797

9898
* Using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled is deprecated.
99-
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore is deprecated and will lead to an
99+
* Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated and will lead to an
100100
exception in 5.0.
101101
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons is deprecated and
102102
will lead to an exception in 5.0.

UPGRADE-5.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Form
142142
without configuring a reference date.
143143
* Removed support for using `int` or `float` as data for the `NumberType` when the `input` option is set to `string`.
144144
* Removed support for using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled.
145-
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore leads to an exception.
145+
* Using names for buttons that do not start with a letter, a digit, or an underscore leads to an exception.
146146
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons leads to an
147147
exception.
148148
* Using the `date_format`, `date_widget`, and `time_widget` options of the `DateTimeType` when the `widget` option is

src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ public function getDebugModes()
6060
}
6161

6262
/**
63-
* @group legacy
64-
*
6563
* @dataProvider getInterceptRedirectsConfiguration
6664
*/
6765
public function testConfigTreeUsingInterceptRedirects(bool $interceptRedirects, array $expectedResult)

src/Symfony/Bundle/WebProfilerBundle/Tests/DependencyInjection/WebProfilerExtensionTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ public function getToolbarConfig()
142142
}
143143

144144
/**
145-
* @group legacy
146-
*
147145
* @dataProvider getInterceptRedirectsToolbarConfig
148146
*/
149147
public function testToolbarConfigUsingInterceptRedirects(

src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ private function addDeprecatedAliases(): string
13021302
$methodNameAlias = $this->generateMethodName($alias);
13031303
$idExported = $this->export($id);
13041304
$messageExported = $this->export($definition->getDeprecationMessage($alias));
1305-
$code = <<<EOF
1305+
$code .= <<<EOF
13061306
13071307
/*{$this->docStar}
13081308
* Gets the $public '$alias' alias.

src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,6 +1339,30 @@ public function testWither()
13391339
$wither = $container->get('wither');
13401340
$this->assertInstanceOf(Foo::class, $wither->foo);
13411341
}
1342+
1343+
/**
1344+
* @group legacy
1345+
* @expectedDeprecation The "deprecated1" service alias is deprecated. You should stop using it, as it will be removed in the future.
1346+
* @expectedDeprecation The "deprecated2" service alias is deprecated. You should stop using it, as it will be removed in the future.
1347+
*/
1348+
public function testMultipleDeprecatedAliasesWorking()
1349+
{
1350+
$container = new ContainerBuilder();
1351+
$container->setDefinition('bar', new Definition('stdClass'))->setPublic(true);
1352+
$container->setAlias('deprecated1', 'bar')->setPublic(true)->setDeprecated('%alias_id% is deprecated');
1353+
$container->setAlias('deprecated2', 'bar')->setPublic(true)->setDeprecated('%alias_id% is deprecated');
1354+
$container->compile();
1355+
1356+
$dumper = new PhpDumper($container);
1357+
$dump = $dumper->dump(['class' => $class = __FUNCTION__]);
1358+
1359+
eval('?>'.$dump);
1360+
$container = new $class();
1361+
1362+
$this->assertInstanceOf(\stdClass::class, $container->get('bar'));
1363+
$this->assertInstanceOf(\stdClass::class, $container->get('deprecated1'));
1364+
$this->assertInstanceOf(\stdClass::class, $container->get('deprecated2'));
1365+
}
13421366
}
13431367

13441368
class Rot13EnvVarProcessor implements EnvVarProcessorInterface

src/Symfony/Component/Form/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ CHANGELOG
4141

4242
* added a `symbol` option to the `PercentType` that allows to disable or customize the output of the percent character
4343
* Using the `format` option of `DateType` and `DateTimeType` when the `html5` option is enabled is deprecated.
44-
* Using names for buttons that do not start with a lowercase letter, a digit, or an underscore is deprecated and will lead to an
44+
* Using names for buttons that do not start with a letter, a digit, or an underscore is deprecated and will lead to an
4545
exception in 5.0.
4646
* Using names for buttons that do not contain only letters, digits, underscores, hyphens, and colons is deprecated and
4747
will lead to an exception in 5.0.

src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ public function validate($form, Constraint $formConstraint)
7676
}
7777
}
7878
} else {
79+
$groupedConstraints = [];
80+
7981
foreach ($constraints as $constraint) {
8082
// For the "Valid" constraint, validate the data in all groups
8183
if ($constraint instanceof Valid) {
@@ -88,7 +90,7 @@ public function validate($form, Constraint $formConstraint)
8890
// matching group
8991
foreach ($groups as $group) {
9092
if (\in_array($group, $constraint->groups)) {
91-
$validator->atPath('data')->validate($form->getData(), $constraint, $group);
93+
$groupedConstraints[$group][] = $constraint;
9294

9395
// Prevent duplicate validation
9496
if (!$constraint instanceof Composite) {
@@ -97,6 +99,10 @@ public function validate($form, Constraint $formConstraint)
9799
}
98100
}
99101
}
102+
103+
foreach ($groupedConstraints as $group => $constraint) {
104+
$validator->atPath('data')->validate($form->getData(), $constraint, $group);
105+
}
100106
}
101107
} elseif (!$form->isSynchronized()) {
102108
$childrenSynchronized = true;

src/Symfony/Component/Form/Tests/ButtonBuilderTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ public function testNameContainingIllegalCharacters()
4747
$this->assertInstanceOf('\Symfony\Component\Form\ButtonBuilder', new ButtonBuilder('button[]'));
4848
}
4949

50-
/**
51-
* @group legacy
52-
*/
53-
public function testNameStartingWithIllegalCharacters()
54-
{
55-
$this->assertInstanceOf('\Symfony\Component\Form\ButtonBuilder', new ButtonBuilder('Button'));
56-
}
57-
5850
public function getInvalidNames()
5951
{
6052
return [

src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
use Symfony\Component\Translation\IdentityTranslator;
2727
use Symfony\Component\Validator\Constraints\Collection;
2828
use Symfony\Component\Validator\Constraints\GroupSequence;
29+
use Symfony\Component\Validator\Constraints\Length;
2930
use Symfony\Component\Validator\Constraints\NotBlank;
3031
use Symfony\Component\Validator\Constraints\NotNull;
3132
use Symfony\Component\Validator\Constraints\Valid;
@@ -77,10 +78,11 @@ public function testValidateConstraints()
7778
$object = new \stdClass();
7879
$constraint1 = new NotNull(['groups' => ['group1', 'group2']]);
7980
$constraint2 = new NotBlank(['groups' => 'group2']);
81+
$constraint3 = new Length(['groups' => 'group2', 'min' => 3]);
8082

8183
$options = [
8284
'validation_groups' => ['group1', 'group2'],
83-
'constraints' => [$constraint1, $constraint2],
85+
'constraints' => [$constraint1, $constraint2, $constraint3],
8486
];
8587
$form = $this->getCompoundForm($object, $options);
8688
$form->submit([]);
@@ -89,8 +91,8 @@ public function testValidateConstraints()
8991
$this->expectValidateAt(0, 'data', $object, ['group1', 'group2']);
9092

9193
// Then custom constraints
92-
$this->expectValidateValueAt(1, 'data', $object, $constraint1, 'group1');
93-
$this->expectValidateValueAt(2, 'data', $object, $constraint2, 'group2');
94+
$this->expectValidateValueAt(1, 'data', $object, [$constraint1], 'group1');
95+
$this->expectValidateValueAt(2, 'data', $object, [$constraint2, $constraint3], 'group2');
9496

9597
$this->validator->validate($form, new Form());
9698

@@ -172,8 +174,8 @@ public function testValidateConstraintsOptionEvenIfNoValidConstraint()
172174
$parent->add($form);
173175
$parent->submit([]);
174176

175-
$this->expectValidateValueAt(0, 'data', $object, $constraint1, 'group1');
176-
$this->expectValidateValueAt(1, 'data', $object, $constraint2, 'group2');
177+
$this->expectValidateValueAt(0, 'data', $object, [$constraint1], 'group1');
178+
$this->expectValidateValueAt(1, 'data', $object, [$constraint2], 'group2');
177179

178180
$this->validator->validate($form, new Form());
179181

src/Symfony/Component/HttpClient/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
}
1616
],
1717
"provide": {
18+
"php-http/async-client-implementation": "*",
1819
"php-http/client-implementation": "*",
1920
"psr/http-client-implementation": "1.0",
2021
"symfony/http-client-implementation": "1.1"

src/Symfony/Component/HttpKernel/Tests/Bundle/BundleTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ public function testGetContainerExtension()
2828
);
2929
}
3030

31-
/**
32-
* @group legacy
33-
*/
3431
public function testGetContainerExtensionWithInvalidClass()
3532
{
3633
$this->expectException('LogicException');

src/Symfony/Component/Security/Core/Tests/Authentication/Provider/DaoAuthenticationProviderTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323

2424
class DaoAuthenticationProviderTest extends TestCase
2525
{
26-
/**
27-
* @group legacy
28-
*/
2926
public function testRetrieveUserWhenProviderDoesNotReturnAnUserInterface()
3027
{
3128
$this->expectException('Symfony\Component\Security\Core\Exception\AuthenticationServiceException');

src/Symfony/Component/Security/Core/Tests/Authentication/Provider/UserAuthenticationProviderTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ public function testAuthenticateWhenUsernameIsNotFoundAndHideIsTrue()
6161
$provider->authenticate($this->getSupportedToken());
6262
}
6363

64-
/**
65-
* @group legacy
66-
*/
6764
public function testAuthenticateWhenProviderDoesNotReturnAnUserInterface()
6865
{
6966
$this->expectException('Symfony\Component\Security\Core\Exception\AuthenticationServiceException');

src/Symfony/Component/Security/Http/Tests/Firewall/ExceptionListenerTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ public function getAuthenticationExceptionProvider()
7272
];
7373
}
7474

75-
/**
76-
* @group legacy
77-
*/
7875
public function testExceptionWhenEntryPointReturnsBadValue()
7976
{
8077
$event = $this->createEvent(new AuthenticationException());

src/Symfony/Component/Security/Http/Tests/Firewall/LogoutListenerTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,6 @@ public function testHandleMatchedPathWithoutSuccessHandlerAndCsrfValidation()
123123
$listener($event);
124124
}
125125

126-
/**
127-
* @group legacy
128-
*/
129126
public function testSuccessHandlerReturnsNonResponse()
130127
{
131128
$this->expectException('RuntimeException');

src/Symfony/Component/Security/Http/Tests/RememberMe/AbstractRememberMeServicesTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ public function testAutoLoginReturnsNullWhenNoCookie()
3939
$this->assertNull($service->autoLogin(new Request()));
4040
}
4141

42-
/**
43-
* @group legacy
44-
*/
4542
public function testAutoLoginThrowsExceptionWhenImplementationDoesNotReturnUserInterface()
4643
{
4744
$this->expectException('RuntimeException');

src/Symfony/Component/Workflow/Tests/WorkflowTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ class WorkflowTest extends TestCase
2020
{
2121
use WorkflowBuilderTrait;
2222

23-
/**
24-
* @group legacy
25-
*/
2623
public function testGetMarkingWithInvalidStoreReturn()
2724
{
2825
$this->expectException('Symfony\Component\Workflow\Exception\LogicException');

0 commit comments

Comments
 (0)