Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.5] Test components using their lowest possible deps #12998

Merged
merged 1,810 commits into from Dec 16, 2014

Conversation

nicolas-grekas
Copy link
Member

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? not yet
Fixed tickets -
License MIT
Doc PR -

Follow up of #12542

webmozart and others added 30 commits July 28, 2014 15:52
…le validators, legacy validators were created
…utionContext (Tobion)

This PR was merged into the 2.5 branch.

Discussion
----------

[Validator] prevent unnecessary calls inside ExecutionContext

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT

Small performance improvement by preventing calls to `PropertyPath::append($this->propertyPath, $subPath)` when not needed.

Commits
-------

d6d462a [Validator] do not call getter inside ExecutionContext to prevent unnecessary calls
…gelog (JeroenDeDauw)

This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes symfony#11507).

Discussion
----------

Add point about ConsoleLogger to Console 2.5 changelog

Commits
-------

8744826 Add point about ConsoleLogger to Console 2.5 changelog
* Added some translations in CA
* Fixed some translations in ES
…ions (mmoreram)

This PR was merged into the 2.4 branch.

Discussion
----------

Issue symfony#11489 Added some CA and ES translations

* Added some translations in CA
* Fixed some translations in ES

Commits
-------

67a6b75 Issue symfony#11489 Added some CA and ES translations
* 2.3: (22 commits)
  Fix incorrect romanian plural translations
  fix axes handling in Crawler::filterXPath()
  fix some docblocks
  Fixed self-reference in 'service_container' service breaks garbage collection (and clone).
  [Process] Fix tests when pcntl is not available.
  [DependencyInjection] Roll back changes made to generated files.
  [Console] Roll back changes made to fixture files.
  [Validator] Added more detailed inline documentation
  [Validator] Removed information from the violation output if the value is an array, object or resource
  partially reverted previous commit
  fixed CS
  properly handle null data when denormalizing
  [Validator] Renamed valueToString() to formatValue(); added missing formatValue() calls
  [Validator] Fixed CS
  [Validator] Fixed date-to-string conversion tests to match ICU 51
  [Validator] Added "{{ value }}" parameters where they were missing
  [Validator] Simplified and explained the LuhnValidator
  [Validator] Simplified IssnValidator
  [Validator] Fixed and simplified IsbnValidator
  [Validator] Simplified IBAN validation algorithm
  ...

Conflicts:
	src/Symfony/Component/Console/Helper/DescriptorHelper.php
	src/Symfony/Component/DependencyInjection/Container.php
	src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php
	src/Symfony/Component/HttpFoundation/File/UploadedFile.php
	src/Symfony/Component/HttpKernel/Fragment/FragmentHandler.php
	src/Symfony/Component/Validator/Constraints/AbstractComparisonValidator.php
	src/Symfony/Component/Validator/Constraints/CollectionValidator.php
	src/Symfony/Component/Validator/Tests/Constraints/EqualToValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/GreaterThanValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/IdenticalToValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/LessThanOrEqualValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/NotEqualToValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/NotIdenticalToValidatorTest.php
…s name to validatePropertyValue() (webmozart)

This PR was merged into the 2.5 branch.

Discussion
----------

[Validator] Made it possible (again) to pass a class name to validatePropertyValue()

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#11139
| License       | MIT
| Doc PR        | -

In the 2.4 API it was possible to do both:

```php
$validator->validatePropertyValue($object, 'propertyName', $myValue);
$validator->validatePropertyValue('\Vendor\Namespace\ClassName', 'propertyName', $myValue);
```

In the 2.5 API, the second case was not supported anymore. This is fixed now.

Together with the fix comes also a small change (also in the 2.4 API) which I'll demonstrate with a code snippet:

```php
$metadata->addPropertyConstraint('ClassName', 'propertyName', new Callback(
    function ($value, $context) {
        var_dump($context->getRoot());
        var_dump($context->getPropertyPath());
    }
));

$validator->validatePropertyValue('ClassName', 'propertyName', 'foobar');
```

Before this PR, the output would be:

```
string(9) "ClassName"
string(12) "propertyName"
```

This doesn't make a lot of sense, because usually the following condition holds during validation:

```php
'' === $context->getPropertyPath() || $value === $propertyAccessor->getValue($context->getRoot(), $context->getPropertyPath())
```

which obviously cannot work if root is a class name. Thus I changed the root and property path to become:

```
string(6) "foobar"
string(0) ""
```

With this change, the condition holds also in this case.

Commits
-------

2bf1b37 [Validator] Fixed ExpressionValidator when the validation root is not an object
ef6f5f5 [Validator] Fixed: Made it possible (again) to pass a class name to Validator::validatePropertyValue()
… API (webmozart)

This PR was squashed before being merged into the 2.5 branch (closes symfony#11485).

Discussion
----------

[Validator] Constraint validators now use the 2.5 API

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

See the comments in symfony#11049 for the origin of this PR.

Currently, the 2.5 API needs to use `LegacyExecutionContextFactory` because the constraint validators rely on methods from the old `ExecutionContext` class (like `validate()`, `validateValue()`). Consequently it is impossible to switch to the pure 2.5 API and check whether all calls to deprecated methods were removed from application code. This is fixed now.

This PR also introduces a complete test suite to test each constraint validator against all three APIs: 2.4, 2.5-BC and 2.5. Currently, some tests are not executed yet when running the complete test suite is run. I expect this to be fixed soon (ticket: sebastianbergmann/phpunit#529, pr: sebastianbergmann/phpunit#1327).

Commits
-------

295e5bb [Validator] Fixed failing tests
3bd6d80 [Validator] CS fixes
870a41a [FrameworkBundle] Made ConstraintValidatorFactory aware of the legacy validators
7504448 [Validator] Added extensive test coverage for the constraint validators for the different APIs
8e461af [Validator] Constraint validators now use the 2.5 API. For incompatible validators, legacy validators were created
This PR was merged into the 2.4 branch.

Discussion
----------

[Validator] Added Swedish translations

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | part of symfony#11489
| License       | MIT

Added some missing Swedish translations.

Should I make an additional PR to `master` for the `trans-unit id=78` ([ref](https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf#L302))? Or should I add that in this PR?

Commits
-------

a361f10 [Validator] Added Swedish translations
* 2.4: (24 commits)
  [Validator] Added Swedish translations
  Fix incorrect romanian plural translations
  fix axes handling in Crawler::filterXPath()
  fix some docblocks
  Fixed self-reference in 'service_container' service breaks garbage collection (and clone).
  [Process] Fix tests when pcntl is not available.
  [DependencyInjection] Roll back changes made to generated files.
  [Console] Roll back changes made to fixture files.
  Issue symfony#11489 Added some CA and ES translations
  [Validator] Added more detailed inline documentation
  [Validator] Removed information from the violation output if the value is an array, object or resource
  partially reverted previous commit
  fixed CS
  properly handle null data when denormalizing
  [Validator] Renamed valueToString() to formatValue(); added missing formatValue() calls
  [Validator] Fixed CS
  [Validator] Fixed date-to-string conversion tests to match ICU 51
  [Validator] Added "{{ value }}" parameters where they were missing
  [Validator] Simplified and explained the LuhnValidator
  [Validator] Simplified IssnValidator
  ...

Conflicts:
	src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
	src/Symfony/Component/Security/Core/Encoder/BasePasswordEncoder.php
	src/Symfony/Component/Validator/Constraints/ChoiceValidator.php
	src/Symfony/Component/Validator/Constraints/CollectionValidator.php
	src/Symfony/Component/Validator/Constraints/FileValidator.php
	src/Symfony/Component/Validator/Constraints/Isbn.php
	src/Symfony/Component/Validator/Constraints/IsbnValidator.php
	src/Symfony/Component/Validator/Constraints/LengthValidator.php
	src/Symfony/Component/Validator/Tests/Constraints/AbstractComparisonValidatorTestCase.php
	src/Symfony/Component/Validator/Tests/Constraints/BlankValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/CollectionValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/DateTimeValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/DateValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/EmailValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/FalseValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/FileValidatorPathTest.php
	src/Symfony/Component/Validator/Tests/Constraints/FileValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/IpValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/IsbnValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/NullValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/RegexValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/TimeValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/TrueValidatorTest.php
	src/Symfony/Component/Validator/Tests/Constraints/UrlValidatorTest.php
…on-BC 2.5 Validation API (webmozart)

This PR was merged into the 2.5 branch.

Discussion
----------

[Form] Fixed FormValidator compatibility with the non-BC 2.5 Validation API

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#11568
| License       | MIT
| Doc PR        | -

Commits
-------

6ac130e [Form] Fixed FormValidator compatibility with the non-BC 2.5 Validation API
* 2.3:
  Fixed relative redirects for ambiguous paths
  [BrowserKit] Fix browser kit redirect with ports
  [TwigBridge] [Form] Fixed some extra empty spaces
  Plural fix
  removed some .gitattributes that should have been removed a lot time ago
  [DependencyInjection] fixed missing 'factory-class' attribute in XmlDumper output
  fixed whitespace in Twig form template
  built-in server: exit when docroot does not exist

Conflicts:
	src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
* 2.4:
  Fixed relative redirects for ambiguous paths
  [BrowserKit] Fix browser kit redirect with ports
  [TwigBridge] [Form] Fixed some extra empty spaces
  Plural fix
  removed some .gitattributes that should have been removed a lot time ago
  [DependencyInjection] fixed missing 'factory-class' attribute in XmlDumper output
  fixed whitespace in Twig form template
  built-in server: exit when docroot does not exist

Conflicts:
	src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php
	src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services9.xml
…s for the different Validation APIs (webmozart)

This PR was merged into the 2.5 branch.

Discussion
----------

[SecurityBundle] Added UserPasswordValidator tests for the different Validation APIs

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

0653426 [SecurityBundle] Added UserPasswordValidator tests for the different Validation APIs
…se the 2.5 Validation API (webmozart)

This PR was merged into the 2.5 branch.

Discussion
----------

[DoctrineBridge] Changed UniqueEntityValidator to use the 2.5 Validation API

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#11578
| License       | MIT
| Doc PR        | -

Commits
-------

f45f1ab [DoctrineBridge] Changed UniqueEntityValidator to use the 2.5 Validation API
fabpot and others added 9 commits December 12, 2014 08:45
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes symfony#12453).

Discussion
----------

[Debug] Show only unique class candidates

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

```
PHPUnit 4.3.5 by Sebastian Bergmann.

Configuration read from .../symfony/phpunit.xml.dist

S....S.............................FFFS.......

Time: 2.29 seconds, Memory: 8.50Mb

There were 3 failures:

1) Symfony\Component\Debug\Tests\FatalErrorHandler\ClassNotFoundFatalErrorHandlerTest::testClassNotFound with data set #2 (array(1, 12, 'foo.php', 'Class \'UndefinedFunctionException\' not found'), 'Attempted to load class "UndefinedFunctionException" from the global namespace.
Did you forget a "use" statement for "Symfony\\Component\\Debug\\Exception\\UndefinedFunctionException"?')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 Attempted to load class "UndefinedFunctionException" from the global namespace.
-Did you forget a "use" statement for "Symfony\Component\Debug\Exception\UndefinedFunctionException"?
+Did you forget a "use" statement for e.g. "Symfony\Component\Debug\Exception\UndefinedFunctionException" or "Symfony\Component\Debug\Exception\UndefinedFunctionException"?

.../symfony/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php:28

2) Symfony\Component\Debug\Tests\FatalErrorHandler\ClassNotFoundFatalErrorHandlerTest::testClassNotFound with data set #3 (array(1, 12, 'foo.php', 'Class \'PEARClass\' not found'), 'Attempted to load class "PEARClass" from the global namespace.
Did you forget a "use" statement for "Symfony_Component_Debug_Tests_Fixtures_PEARClass"?')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 Attempted to load class "PEARClass" from the global namespace.
-Did you forget a "use" statement for "Symfony_Component_Debug_Tests_Fixtures_PEARClass"?
+Did you forget a "use" statement for e.g. "Symfony_Component_Debug_Tests_Fixtures_PEARClass" or "Symfony_Component_Debug_Tests_Fixtures_PEARClass"?

.../symfony/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php:28

3) Symfony\Component\Debug\Tests\FatalErrorHandler\ClassNotFoundFatalErrorHandlerTest::testClassNotFound with data set #4 (array(1, 12, 'foo.php', 'Class \'Foo\\Bar\\UndefinedFunctionException\' not found'), 'Attempted to load class "UndefinedFunctionException" from namespace "Foo\\Bar".
Did you forget a "use" statement for "Symfony\\Component\\Debug\\Exception\\UndefinedFunctionException"?')
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
 Attempted to load class "UndefinedFunctionException" from namespace "Foo\Bar".
-Did you forget a "use" statement for "Symfony\Component\Debug\Exception\UndefinedFunctionException"?
+Did you forget a "use" statement for e.g. "Symfony\Component\Debug\Exception\UndefinedFunctionException" or "Symfony\Component\Debug\Exception\UndefinedFunctionException"?

.../symfony/src/Symfony/Component/Debug/Tests/FatalErrorHandler/ClassNotFoundFatalErrorHandlerTest.php:28
```

Commits
-------

db8a3ae [Debug] Show only unique class candidates
…igaminal)

This PR was squashed before being merged into the 2.5 branch (closes symfony#12548).

Discussion
----------

[Form] fixed a maxlength overring on a guessing

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony#11527
| License       | MIT
| Doc PR        | -

Commits
-------

7248680 [Form] fixed a maxlength overring on a guessing
* 2.3:
  [SecurityBundle] Firewall providers building - code cleaning
  [Filesystem] symlink use RealPath instead LinkTarget
  Fixed the AuthenticationProviderInterface alignment
  Fixed the proxy-manager version constraint

Conflicts:
	composer.json
	src/Symfony/Bridge/ProxyManager/composer.json
* 2.3:
  remove short array syntax
  fix session restart on PHP 5.3
Symfony 2.5 and higher requires ocramius/proxy-manager 0.4.0 or
higher.
…ekas)

This PR was merged into the 2.5 branch.

Discussion
----------

Fix failing tests after merge

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

https://github.com/symfony/symfony/pull/12967/files?w=1

Commits
-------

9b96373 Fix failing tests after merge
6638535 fix ocramius/proxy-manager dependency version
* symfony/2.3:
  Test components using their lowest possible deps

Conflicts:
	src/Symfony/Bridge/Doctrine/composer.json
	src/Symfony/Bridge/Twig/composer.json
	src/Symfony/Bundle/FrameworkBundle/composer.json
	src/Symfony/Bundle/SecurityBundle/composer.json
	src/Symfony/Bundle/TwigBundle/composer.json
	src/Symfony/Component/DependencyInjection/composer.json
	src/Symfony/Component/EventDispatcher/composer.json
	src/Symfony/Component/Form/composer.json
	src/Symfony/Component/HttpKernel/composer.json
	src/Symfony/Component/Routing/composer.json
	src/Symfony/Component/Security/composer.json
	src/Symfony/Component/Validator/composer.json
@nicolas-grekas nicolas-grekas force-pushed the lowest-25 branch 12 times, most recently from 01551af to 16929a1 Compare December 16, 2014 14:54
@fabpot
Copy link
Member

fabpot commented Dec 16, 2014

Thank you @nicolas-grekas.

@fabpot fabpot merged commit b1b5cca into symfony:2.5 Dec 16, 2014
fabpot added a commit that referenced this pull request Dec 16, 2014
…nicolas-grekas, fabpot)

This PR was merged into the 2.5 branch.

Discussion
----------

[2.5] Test components using their lowest possible deps

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | not yet
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Follow up of #12542

Commits
-------

b1b5cca Test lowest versions of dependencies
88d524e Merge remote-tracking branch 'symfony/2.3' into lowest-25
206ebc7 minor #12542 Test components using their lowest possible deps (nicolas-grekas)
25fef27 Test components using their lowest possible deps
@nicolas-grekas nicolas-grekas deleted the lowest-25 branch December 16, 2014 15:32
nicolas-grekas added a commit that referenced this pull request Dec 16, 2014
…as, fabpot)

This PR was merged into the 2.6 branch.

Discussion
----------

[2.6] Test lowest versions of dependencies

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

a29ffa8 [2.6] Test lowest versions of dependencies
5e6959b Merge remote-tracking branch 'symfony/2.5' into lowest-26
b2e0a80 minor #12998 [2.5] Test components using their lowest possible deps (nicolas-grekas, fabpot)
b1b5cca Test lowest versions of dependencies
88d524e Merge remote-tracking branch 'symfony/2.3' into lowest-25
206ebc7 minor #12542 Test components using their lowest possible deps (nicolas-grekas)
25fef27 Test components using their lowest possible deps
fabpot added a commit that referenced this pull request Feb 18, 2022
…rves no purpose anymore (nicolas-grekas)

This PR was merged into the 6.1 branch.

Discussion
----------

[HttpKernel] Deprecate StreamedResponseListener, it serves no purpose anymore

| Q             | A
| ------------- | ---
| Branch?       | 6.1
| Bug fix?      | no
| New feature?  | no
| Deprecations? | yes
| Tickets       | -
| License       | MIT
| Doc PR        | -

`StreamedResponseListener` has been introduced at the same time as `StreamedResponse` in #2935.

Its purpose was to make catching exceptions easier by wrapping the call to `$response->send()` in the main try/catch of `HttpKernel`.

Since #12998, we have `HttpKernel::terminateWithException()`, and we don't need that anymore, so we can just remove the listener.

This will help [integrate Symfony into e.g. Swoole](php-runtime/runtime#115) /cc @alexander-schranz.

Commits
-------

ee61774 [HttpKernel] Deprecate StreamedResponseListener, it serves no purpose anymore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet