Commit Graph

5237 Commits

Author SHA1 Message Date
Alexander M. Turek
0fee41a617 Merge branch '5.1' into 5.x 2020-10-28 22:46:03 +01:00
Alexander M. Turek
294cffea25 Merge branch '4.4' into 5.1 2020-10-28 22:31:18 +01:00
Alexander M. Turek
659decf594 Use short array deconstruction syntax. 2020-10-28 21:42:29 +01:00
Grégoire Paris
f0605b8137
Use createMock() rather than createStub()
The CI is not using a recent enough version of PHPUnit for that
2020-10-28 19:29:55 +01:00
Grégoire Paris
ed80bcc82c
Remove dependency on doctrine/reflection
That package is being phased out, and there are good chances that the
classes involved at runtime are completely different from the classes
involved in the test changed in that commit. That test was the only
piece of code I could find still referencing the
Doctrine\Common\Reflection namespace.
2020-10-28 19:09:12 +01:00
Nicolas Grekas
4b36736e91 minor #38838 [ProxyManager] use "composer/package-versions-deprecated" instead of "ocramius/package-versions" (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[ProxyManager] use "composer/package-versions-deprecated" instead of "ocramius/package-versions"

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

As highlighted by our CI, `ocramius/proxy-manager` cannot be installed on PHP 7.3 using composer 2 because of broken versioning policies:
![image](https://user-images.githubusercontent.com/243674/97278564-37e73080-183a-11eb-885c-7b3cc07c26af.png)

Fortunately, the package that causes all this mess (`ocramius/package-versions`) has been forked precisely to work around these broken policies.

Requiring this fork allows resolving the dependencies properly.

Commits
-------

8cf60c4ab7 [ProxyManager] use "composer/package-versions-deprecated" instead of "ocramius/package-versions"
2020-10-27 12:56:04 +01:00
Nicolas Grekas
d5118933ed Merge branch '5.1' into 5.x
* 5.1:
  [DI] Fix Preloader exception when preloading a class with an unknown parent/interface
  [Translation] added missing Albanian translations
  [Form, Security, Validator] Add missing Turkish translations (tr)
  Display php info for extra versions in travis
  [ProxyManager] use "composer/package-versions-deprecated" instead of "ocramius/package-versions"
  38737 add missing dutch translation
  Fix transient tests
  [Validator] Add missing Slovak translations.
  [Form, Security, Validator] Add missing Persian translations (fa_IR)
  [Form] Fix wrong translations for Ukrainian (uk)
  [Validator] Add missing translations for Ukrainian (uk)
  [Security] Add missing translations for Ukrainian (uk)
  [Form] Add missing translations for Ukrainian (uk)
  [Security] Add missing Slovak translations.
  [Form] Added missing Spanish translations.
  Fix transient tests
2020-10-27 11:14:44 +01:00
Nicolas Grekas
8810d2da62 Merge branch '4.4' into 5.1
* 4.4:
  [DI] Fix Preloader exception when preloading a class with an unknown parent/interface
  [Translation] added missing Albanian translations
  [Form, Security, Validator] Add missing Turkish translations (tr)
  Display php info for extra versions in travis
  [ProxyManager] use "composer/package-versions-deprecated" instead of "ocramius/package-versions"
  38737 add missing dutch translation
  Fix transient tests
  [Validator] Add missing Slovak translations.
  [Form, Security, Validator] Add missing Persian translations (fa_IR)
  [Form] Fix wrong translations for Ukrainian (uk)
  [Validator] Add missing translations for Ukrainian (uk)
  [Security] Add missing translations for Ukrainian (uk)
  [Form] Add missing translations for Ukrainian (uk)
  [Security] Add missing Slovak translations.
  [Form] Added missing Spanish translations.
  Fix transient tests
2020-10-27 11:11:13 +01:00
Nicolas Grekas
8cf60c4ab7 [ProxyManager] use "composer/package-versions-deprecated" instead of "ocramius/package-versions" 2020-10-27 09:50:57 +01:00
Nicolas Grekas
c417fd700a Merge branch '5.1' into 5.x
* 5.1:
  Disable platform checks
  Put branch-version in the source for CI
  Bump default PHPUnit version for PHP 8 to 9.4.
2020-10-24 17:54:31 +02:00
Nicolas Grekas
50a61b5392 Merge branch '4.4' into 5.1
* 4.4:
  Disable platform checks
  Put branch-version in the source for CI
  Bump default PHPUnit version for PHP 8 to 9.4.
2020-10-24 17:53:55 +02:00
Alexander M. Turek
9f322091c8 Bump default PHPUnit version for PHP 8 to 9.4. 2020-10-24 14:35:18 +02:00
Nicolas Grekas
605a5674a8 Merge branch '5.1' into 5.x
* 5.1:
  fix merge
  fix merge
  Remove branch-version (keep them for contracts only)
  [HttpClient] relax auth bearer format requirements
  [PHPUnitBridge] Silence errors from mkdir()
  [DependencyInjection] Preload classes with union types correctly.
  [Serializer] fix decoding float XML attributes starting with 0
  add missing dutch translations
  [TwigBridge] Remove "transchoice" from the code base
  Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait
  Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill
  [String] fix before/after[Last]() returning the empty string instead of the original one on non-match
  Add missing exporter function for PHPUnit 7
  [Validator] Add missing romanian translations
  [String] fix slicing in UnicodeString
  [Cache] Use correct expiry in ChainAdapter
  do not translate null placeholders or titles
2020-10-24 14:08:07 +02:00
Nicolas Grekas
65f2620bc4 Merge branch '4.4' into 5.1
* 4.4:
  fix merge
  Remove branch-version (keep them for contracts only)
  [HttpClient] relax auth bearer format requirements
  [PHPUnitBridge] Silence errors from mkdir()
  [DependencyInjection] Preload classes with union types correctly.
  [Serializer] fix decoding float XML attributes starting with 0
  add missing dutch translations
  Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait
  Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill
  Add missing exporter function for PHPUnit 7
  [Validator] Add missing romanian translations
  [Cache] Use correct expiry in ChainAdapter
  do not translate null placeholders or titles
2020-10-24 14:01:57 +02:00
Nicolas Grekas
2c4dff8461 fix merge 2020-10-24 13:56:22 +02:00
Nicolas Grekas
77aa17401d Merge branch '3.4' into 4.4
* 3.4:
  Remove branch-version (keep them for contracts only)
  [Serializer] fix decoding float XML attributes starting with 0
  add missing dutch translations
  [Validator] Add missing romanian translations
  do not translate null placeholders or titles
2020-10-24 13:50:19 +02:00
Nicolas Grekas
f8fe4bf9f5 Remove branch-version (keep them for contracts only) 2020-10-24 12:57:07 +02:00
Nyholm
f3976ee5d8
[PHPUnitBridge] Silence errors from mkdir() 2020-10-24 10:20:26 +02:00
Fabien Potencier
9bfd3ee66e bug #38680 [PhpUnitBridge] Support new expect methods in test case polyfill (alcaeus)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Support new expect methods in test case polyfill

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| License       | MIT

This PR adds the `expectError`, `expectWarning`, `expectNotice`, ~and `expectDeprecation`~ methods to the test case polyfill.

~Note that I saw a `expectDeprecation` message in `ExpectDeprecationTrait`, but I couldn't quite figure out what it's supposed to do. Please let me know if the `expectDeprecation` method needs to be removed from the test polyfill.~

Commits
-------

8a49a263a2 Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill
2020-10-23 06:24:01 +02:00
Fabien Potencier
49182e1eeb bug #38681 [PHPUnitBridge] Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait (alcaeus)
This PR was merged into the 4.4 branch.

Discussion
----------

[PHPUnitBridge] Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | not really
| New feature?  | yes
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| License       | MIT

This expands the compatibility layer for PHPUnit constraints by supporting PHPUnit 8 and PHPUnit 9. Support for the latter requires also adding the `evaluate` method to the trait, as this method gets a signature change in PHPUnit 9.

Commits
-------

f79ad80009 Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait
2020-10-23 06:19:51 +02:00
Nicolas Grekas
713c2623e5 [TwigBridge] Remove "transchoice" from the code base 2020-10-22 20:37:20 +02:00
Andreas Braun
f79ad80009
Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait 2020-10-22 14:29:45 +02:00
Andreas Braun
8a49a263a2
Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill 2020-10-22 14:28:16 +02:00
Nicolas Grekas
e2f0454f13 [PhpUnitBridge] remove wrong changelog entry 2020-10-22 14:27:47 +02:00
Andreas Braun
52e7d78dca
Add missing exporter function for PHPUnit 7 2020-10-22 14:02:19 +02:00
Fabien Potencier
1eead3f2af bug #38595 [TwigBridge] do not translate null placeholders or titles (xabbuh)
This PR was merged into the 3.4 branch.

Discussion
----------

[TwigBridge] do not translate null placeholders or titles

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #37573
| License       | MIT
| Doc PR        |

Commits
-------

2ee24a0592 do not translate null placeholders or titles
2020-10-21 11:42:21 +02:00
Alexander M. Turek
5e7d3ab17b Enabled to use the UniqueEntity constraint as an attribute. 2020-10-21 10:44:28 +02:00
Alexander M. Turek
e6417384d2 Merge branch '5.1' into 5.x 2020-10-20 22:28:53 +02:00
Alexander M. Turek
1c6380f333 Merge branch '4.4' into 5.1 2020-10-20 22:28:16 +02:00
Nicolas Grekas
c8c227f43f Merge branch '3.4' into 4.4
* 3.4:
  [Form] Sync translations
  Added dutch translations for new invalid messages
  Don't skip Doctrine tests on php 8.
  Bump APCu to 5.1.19 on Travis.
  [WebProfilerBundle] Hide debug toolbar in print view
  indexBy does not refer to attributes, but to column names
  Fix Reflection file name with eval()\'d code
  [HttpFoundation] Fix Range Requests
2020-10-20 13:58:22 +02:00
Alexander M. Turek
f4a99b2361 Don't skip Doctrine tests on php 8. 2020-10-19 23:16:40 +02:00
Nicolas Grekas
ba31d0ee59 [DoctrinBridge] make Uid types stricter 2020-10-16 18:51:00 +02:00
Christian Flothmann
af1a6208ec indexBy does not refer to attributes, but to column names 2020-10-16 16:16:55 +02:00
Kai
fd3a6e8a0a [DoctrineBridge] Convert values to Rfc4122 before inserting them into the database 2020-10-16 15:08:47 +02:00
Christian Flothmann
2ee24a0592 do not translate null placeholders or titles 2020-10-16 10:33:02 +02:00
Wouter de Jong
04ef565895 [Security][Notifier] Added integration of Login Link with the Notifier component 2020-10-14 20:49:27 +02:00
Nicolas Grekas
ffbb9883bd Merge branch '5.1' into 5.x
* 5.1:
  [Contracts] add branch-aliases for dev-main
  [Cache] Make Redis initializers static
  [Messenger] Fixed typos in Connection
  [CI] Fixed build on AppVeyor
  Fix tests typo
  [Lock] Reset Key lifetime time before we acquire it
  [CI] Silence errors when remove file/dir on test tearDown()
  Fix tests
  Remove content-type check on toArray methods
2020-10-14 19:08:19 +02:00
Fabien Potencier
9f6d604b52 Fix test 2020-10-14 11:36:06 +02:00
Nyholm
0c08432a3d [CI] Fixed build on AppVeyor 2020-10-14 11:34:34 +02:00
Fabien Potencier
9982713327 Merge branch '3.4' into 4.4
* 3.4:
  [CI] Silence errors when remove file/dir on test tearDown()
2020-10-14 11:30:35 +02:00
Nyholm
efef41faa1
[CI] Silence errors when remove file/dir on test tearDown() 2020-10-14 09:00:24 +02:00
Nicolas Grekas
01b064d97a Merge branch '5.1' into 5.x
* 5.1:
  Fix branch-version
2020-10-13 15:22:54 +02:00
Nicolas Grekas
1a0ea4d2f7 Merge branch '4.4' into 5.1
* 4.4:
  Fix branch-version
2020-10-13 15:21:37 +02:00
Nicolas Grekas
58f803f356 Merge branch '3.4' into 4.4
* 3.4:
  Fix branch-version
2020-10-13 15:20:53 +02:00
Nicolas Grekas
44a7e3e920 Fix branch-version 2020-10-13 15:20:16 +02:00
Nicolas Grekas
59db41386f Merge branch '4.4' into 5.1
* 4.4:
  Fix merge
2020-10-13 14:46:35 +02:00
Nicolas Grekas
7f0015ee35 Merge branch '5.1' into 5.x
* 5.1:
  Remove "version" from composer.json files, use "branch-version" instead
  [String] fix "is too large" ValueError on PHP 8
2020-10-13 14:43:06 +02:00
Nicolas Grekas
23ab908213 Merge branch '4.4' into 5.1
* 4.4:
  Remove "version" from composer.json files, use "branch-version" instead
2020-10-13 14:35:38 +02:00
Nicolas Grekas
e953dd3e0d Merge branch '3.4' into 4.4
* 3.4:
  Remove "version" from composer.json files, use "branch-version" instead
2020-10-13 14:30:56 +02:00
Nicolas Grekas
f9ed6940fd Remove "version" from composer.json files, use "branch-version" instead 2020-10-13 14:21:16 +02:00
Bernd Stellwag
2a370143a4 fix warning for preloading TranslatorTrait class 2020-10-13 07:04:30 +02:00
Fabien Potencier
ee3294e050 Merge branch '5.1' into 5.x
* 5.1:
  fix warning for preloading TranslatorTrait class
2020-10-13 06:59:45 +02:00
Bernd Stellwag
0f167f6ed4 fix warning for preloading TranslatorTrait class 2020-10-12 21:56:01 +02:00
Nicolas Grekas
e4024e80ed Merge branch '5.1' into 5.x
* 5.1:
  Disable the PhpUnit bridge when testing it
  [PropertyInfo] Support for the mixed type.
  Don't unset the inflate resource on close as it might still be needed
  [HttpClient] Fix CurlHttpClient memory leak
  [Form] Add Bosnian (bs) validators translation
  [Form] Add missing Serbian (latn & cyrl) validators translation
  [Cache] skip igbinary < 3.1.6
  [Ldap] Bypass the use of `ldap_control_paged_result` on PHP >= 7.3
  [Form] [Validator] added pt_BR translations
  Estonian update
  Fix no collection in extract default value
  [PhpUnitBridge] fix running parallel tests with phpunit 9
  [VarDumper] fix truncating big arrays
2020-10-12 14:05:07 +02:00
Nicolas Grekas
a1616a76eb Merge branch '4.4' into 5.1
* 4.4:
  Disable the PhpUnit bridge when testing it
  [PropertyInfo] Support for the mixed type.
  Don't unset the inflate resource on close as it might still be needed
  [HttpClient] Fix CurlHttpClient memory leak
  [Form] Add Bosnian (bs) validators translation
  [Form] Add missing Serbian (latn & cyrl) validators translation
  [Cache] skip igbinary < 3.1.6
  [Ldap] Bypass the use of `ldap_control_paged_result` on PHP >= 7.3
  [Form] [Validator] added pt_BR translations
  Estonian update
  [PhpUnitBridge] fix running parallel tests with phpunit 9
  [VarDumper] fix truncating big arrays
2020-10-12 13:21:05 +02:00
Nicolas Grekas
6000e51629 Merge branch '3.4' into 4.4
* 3.4:
  Disable the PhpUnit bridge when testing it
  [PropertyInfo] Support for the mixed type.
  [Form] Add Bosnian (bs) validators translation
  [Form] Add missing Serbian (latn & cyrl) validators translation
  [Form] [Validator] added pt_BR translations
  Estonian update
  [PhpUnitBridge] fix running parallel tests with phpunit 9
  [VarDumper] fix truncating big arrays
2020-10-12 13:11:24 +02:00
Nicolas Grekas
177cd1abce Fix test for PHP 8 2020-10-12 10:22:47 +02:00
Alex Pott
483236f34a [PhpUnitBridge] Add ability to set a baseline for deprecation testing 2020-10-07 13:07:08 +02:00
Titouan Galopin
7b414a96df [Form] Fix field_value Twig helper 2020-10-07 10:52:31 +02:00
Fabien Potencier
27c22602d6 bug #38444 [PhpUnitBridge] fix running parallel tests with phpunit 9 (nicolas-grekas)
This PR was merged into the 3.4 branch.

Discussion
----------

[PhpUnitBridge] fix running parallel tests with phpunit 9

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #38337
| License       | MIT
| Doc PR        | -

Commits
-------

6b13ffaef2 [PhpUnitBridge] fix running parallel tests with phpunit 9
2020-10-07 07:54:18 +02:00
Nate Wiebe
0d4e25f4a6 Rename Translatable class to TranslatableMessage 2020-10-07 07:51:02 +02:00
Nicolas Grekas
6b13ffaef2 [PhpUnitBridge] fix running parallel tests with phpunit 9 2020-10-06 19:33:55 +02:00
Nicolas Grekas
6066462be2 Merge branch '5.1' into 5.x
* 5.1:
  Update versions in composer.json
  [Mime] Fix serialization of RawMessage
2020-10-06 17:53:16 +02:00
Nicolas Grekas
3e492d6e5d Merge branch '4.4' into 5.1
* 4.4:
  Update versions in composer.json
  [Mime] Fix serialization of RawMessage
2020-10-06 17:50:31 +02:00
Nicolas Grekas
55396f90a3 Merge branch '3.4' into 4.4
* 3.4:
  Update versions in composer.json
2020-10-06 17:45:41 +02:00
Nicolas Grekas
8f714a2fd6 Update versions in composer.json 2020-10-06 17:25:25 +02:00
Nicolas Grekas
11c4f28137 Merge branch '5.1' into 5.x
* 5.1:
  fix merge
  [appveyor] fix checking for the .x branch
  Remove "branch-alias", populate "version"
2020-10-06 14:00:29 +02:00
Nicolas Grekas
097c8c6f27 Merge branch '4.4' into 5.1
* 4.4:
  [appveyor] fix checking for the .x branch
  Remove "branch-alias", populate "version"
2020-10-06 13:49:34 +02:00
Nicolas Grekas
e553f424d0 Merge branch '3.4' into 4.4
* 3.4:
  Remove "branch-alias", populate "version"
2020-10-06 13:41:17 +02:00
Nicolas Grekas
9d40c796c4 Remove "branch-alias", populate "version" 2020-10-06 13:22:52 +02:00
Maxime Hélias
28d1169714 [DoctrineBridge] fix and replace namespace to Uid 2020-10-05 23:45:00 +02:00
Fabien Potencier
2be67879b9 feature #38307 [Form] Implement Twig helpers to get field variables (tgalopin)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Form] Implement Twig helpers to get field variables

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/14308

Designing Symfony Forms has always been difficult, especially for developers not comfortable with Symfony or Twig. The reason behind this difficulty is that the current `form_*` helper functions, while providing a way to quickly render a form, are hiding the generated HTML behind a notation specific to Symfony.

HTML standards introduced many new attributes since the Form component was created, from new constraints to how should inputs be displayed, treated by screen readers, etc.

I propose to introduce a series of new Twig functions to help create more flexible forms without the hurdle of having to use `form_*` functions. I called these methods `field_*` because they aim at rendering only the tiny bits of strings necessary to map forms to the Symfony backend.

The functions introduced are:

* `field_name` returns the name of the given field
* `field_value` returns the current value of the given field
* `field_label` returns the label of the given field, translated if possible
* `field_help` returns the help of the given field, translated if possible
* `field_errors` returns an iterator of strings for each of the errors of the given field
* `field_choices` returns an iterator of choices (the structure depending on whether the field uses or doesn't use optgroup) with translated labels if possible as keys and values as values

A quick example of usage of these functions could be the following:

``` twig
<input
    name="{{ field_name(form.username) }}"
    value="{{ field_value(form.username) }}"
    placeholder="{{ field_label(form.username) }}"
    class="form-control"
/>

<select name="{{ field_name(form.country) }}" class="form-control">
    <option value="">{{ field_label(form.country) }}</option>

    {% for label, value in field_choices(form.country) %}
        <option value="{{ value }}">{{ label }}</option>
    {% endfor %}
</select>

<select name="{{ field_name(form.stockStatus) }}" class="form-control">
    <option value="">{{ field_label(form.stockStatus) }}</option>

    {% for groupLabel, groupChoices in field_choices(form.stockStatus) %}
        <optgroup label="{{ groupLabel }}">
            {% for label, value in groupChoices %}
                <option value="{{ value }}">{{ label }}</option>
            {% endfor %}
        </optgroup>
    {% endfor %}
</select>

{% for error in field_errors(form.country) %}
    <div class="text-danger mb-2">
        {{ error }}
    </div>
{% endfor %}
```

There are several advantages to using these functions instead of their `form_*` equivalents:

* they are much easier to use for developers not knowing Symfony: they rely on native HTML with bits of logic inside, instead of relying on specific tools needing to be configured to display proper HTML
* they allow for better integration with CSS frameworks or Javascript libraries as adding a new HTML attribute is trivial (no need to look at the documentation)
* they are easier to use in contexts where one would like to customize the rendering of a input in details: having the label as placeholder, displaying a select empty field, ...

The `form_*` functions are still usable of course, but I'd argue this technique is actually easier to read and understand.

Commits
-------

3941d70928 [Form] Implement Twig helpers to get field variables
2020-10-03 11:48:50 +02:00
Nicolas Grekas
9d6333a7ff Merge branch '5.1'
* 5.1:
  [5.1] Ignore more deprecations for Mockery mocks
  [PhpUnitBridge] Fix Deprecation file when it comes from the TestsListener
  disallow FrameworkBundle 4.4+
  propagate validation groups to subforms
  [Form] [Validator] Add failing testcase to demonstrate group sequence issue
2020-10-02 15:09:26 +02:00
Thomas Calvet
1ba06a0f86 [PhpUnitBridge] Fix Deprecation file when it comes from the TestsListener 2020-10-02 14:57:56 +02:00
Thomas Calvet
1a801e8452 [4.4] Ignore more deprecations for Mockery mocks 2020-10-02 09:34:48 +02:00
Titouan Galopin
3941d70928 [Form] Implement Twig helpers to get field variables 2020-09-30 12:00:15 +02:00
Fabien Potencier
3f51de3ee8 Merge branch '5.1'
* 5.1:
  [FrameworkBundle] Add Mailjet definition
  Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)"
  [PhpUnitBridge] Fix class_alias() for PHPUnit\Framework\Error\Error
2020-09-30 07:29:43 +02:00
Fabien Potencier
65ee6c9f88 Merge branch '4.4' into 5.1
* 4.4:
  Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)"
  [PhpUnitBridge] Fix class_alias() for PHPUnit\Framework\Error\Error
2020-09-30 07:27:28 +02:00
Fabien Potencier
72ff4012a5 bug #38336 [PhpUnitBridge] Fixed class_alias() for PHPUnit\Framework\Error\Error (stevegrunwell)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Fixed class_alias() for PHPUnit\Framework\Error\Error

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

PHPUnit 6.x removed the PHPUnit_Framework_* classes in favor of PHP namespaces, but one error class did not map the same as the others: `PHPUnit_Framework_Error`.

Instead of mapping to `PHPUnit\Framework\Error` in the same way that `PHPUnit_Framework_Error_Warning` mapped to `PHPUnit\Framework\Error\Warning`, this base class was replaced with `PHPUnit\Framework\Error\Error`, so we cannot map it using simple string replacement like its descendants.

Commits
-------

8e607b58df [PhpUnitBridge] Fix class_alias() for PHPUnit\Framework\Error\Error
2020-09-29 08:53:53 +02:00
Steve Grunwell
8e607b58df [PhpUnitBridge] Fix class_alias() for PHPUnit\Framework\Error\Error
PHPUnit 6.x removed the PHPUnit_Framework_* classes in favor of PHP namespaces, but one error class did not map the same as the others: `PHPUnit_Framework_Error`.

Instead of mapping to `PHPUnit\Framework\Error` in the same way that `PHPUnit_Framework_Error_Warning` mapped to `PHPUnit\Framework\Error\Warning`, this base class was replaced with `PHPUnit\Framework\Error\Error`.
2020-09-28 16:03:26 -04:00
Nicolas Grekas
9224f7ac5b [Contracts] add TranslatableInterface 2020-09-28 15:05:58 +02:00
Nicolas Grekas
6349a1b2fc Merge branch '5.1'
* 5.1:
  [HttpFoundation] skip tests when the IANA server is throttling the list of status codes
  [DoctrineBridge] fix DBAL v3 compat
2020-09-27 16:15:50 +02:00
Nicolas Grekas
66758ad5dc Merge branch '4.4' into 5.1
* 4.4:
  [HttpFoundation] skip tests when the IANA server is throttling the list of status codes
  [DoctrineBridge] fix DBAL v3 compat
2020-09-27 16:14:57 +02:00
Nicolas Grekas
cbb0b1d54b Merge branch '3.4' into 4.4
* 3.4:
  [HttpFoundation] skip tests when the IANA server is throttling the list of status codes
  [DoctrineBridge] fix DBAL v3 compat
2020-09-27 16:14:06 +02:00
Nicolas Grekas
4b1612b8dd [DoctrineBridge] fix DBAL v3 compat 2020-09-27 16:06:58 +02:00
Fabien Potencier
6a5571552f Fix CS 2020-09-26 07:26:20 +02:00
Steve Grunwell
7877a5b488 [PhpUnitBridge] Enable a maximum PHPUnit version to be set via SYMFONY_MAX_PHPUNIT_VERSION 2020-09-25 14:59:28 -04:00
Jordan de Laune
96a0e5fca1 Register the binary types as well 2020-09-25 07:57:18 +02:00
Manuel Alejandro Paz Cetina
33e78b43a4 Always require SQL comment hint 2020-09-23 01:30:05 -05:00
Fabien Potencier
90056b871a feature #38176 [Config] Adding the "info" to a missing option error messages (weaverryan)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Config] Adding the "info" to a missing option error messages

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | None
| License       | MIT
| Doc PR        | Not needed

New error:

<img width="1063" alt="Screen Shot 2020-09-13 at 10 51 32 AM" src="https://user-images.githubusercontent.com/121003/93021186-6329ff00-f5af-11ea-83c6-98581b12ef75.png">

I used the missing `class` just as an example. I hit this while building a new feature in Symfony. It occurred to me that if, for example, you activate some feature in config and that feature has a required sub-key, why not print the `info()` for that sub key to make it discoverable?

Commits
-------

3780f122c7 adding the description to a missing option
2020-09-22 11:20:33 +02:00
Fabien Potencier
e9071e6a4d bug #38250 Return AbstractUid as string (lexthink)
This PR was merged into the 5.2-dev branch.

Discussion
----------

Return AbstractUid as string

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

Should return AbstractUidType as string.

Commits
-------

1a9d76a869 Return AbstractUid as string
2020-09-22 06:58:01 +02:00
Christian Flothmann
61bfea459b fix tests 2020-09-21 10:49:48 +02:00
Manuel Alejandro Paz Cetina
1a9d76a869
Return AbstractUid as string 2020-09-21 00:26:47 -05:00
Christian Flothmann
ccecffeff6 Merge branch '5.1' into master
* 5.1: (25 commits)
  stop using the deprecated at() PHPUnit matcher
  fix lowest allowed version of the HTTP client contracts
  fix lowest allowed version for the PHPUnit bridge
  fix merge
  fix merge
  drop logger mock in favor of using the BufferingLogger
  catch ValueError thrown on PHP 8
  [Yaml Parser] Fix edge cases when parsing multiple documents
  fix parsing comments not prefixed by a space
  [Translator] Make sure a null locale is handled properly
  deal with errors being thrown on PHP 8
  loadRoutes shoud receive RoutingPhpFileLoader
  [Cache] Allow cache tags to be objects implementing __toString()
  [HttpKernel] Do not override max_redirects option in HttpClientKernel
  Log notice when no entry point is configured
  remove superfluous cast
  [HttpClient] Support for CURLOPT_LOCALPORT.
  Upgrade PHPUnit to 8.5 (php 7.2) and 9.3 (php >= 7.3).
  Fixed exception message formatting
  [FrameworkBundle] Fix error in xsd which prevent to register more than one metadata
  ...
2020-09-20 09:20:17 +02:00
Christian Flothmann
4ee591bec6 Merge branch '4.4' into 5.1
* 4.4:
  fix merge
  drop logger mock in favor of using the BufferingLogger
  catch ValueError thrown on PHP 8
  [Yaml Parser] Fix edge cases when parsing multiple documents
  fix parsing comments not prefixed by a space
  [Translator] Make sure a null locale is handled properly
  deal with errors being thrown on PHP 8
  [Cache] Allow cache tags to be objects implementing __toString()
  [HttpKernel] Do not override max_redirects option in HttpClientKernel
  remove superfluous cast
  [HttpClient] Support for CURLOPT_LOCALPORT.
  Upgrade PHPUnit to 8.5 (php 7.2) and 9.3 (php >= 7.3).
  Fixed exception message formatting
  [FrameworkBundle] Fix error in xsd which prevent to register more than one metadata
  [Console] work around disabled putenv()
  [PhpUnitBridge] Fix error with ReflectionClass
  [HttpClient][HttpClientTrait] don't calculate alternatives if option is auth_ntlm
  Change 'cache_key' to AbstractRendererEngine::CACHE_KEY_VAR
  Upgrade PHPUnit to 8.5 (php 7.2) and 9.3 (php >= 7.3).
2020-09-18 16:27:32 +02:00
pvgnd
0fb14394ca Use composition instead of inheritance in HttpCodeActivationStrategy 2020-09-18 10:50:00 +02:00
Alexey Kopytko
ed1bffeed7
[PhpUnitBridge] Fix error with ReflectionClass 2020-09-15 16:51:47 +09:00
Alexander M. Turek
ff47516ea0 Upgrade PHPUnit to 8.5 (php 7.2) and 9.3 (php >= 7.3). 2020-09-14 08:11:19 +02:00
Ryan Weaver
3780f122c7 adding the description to a missing option 2020-09-13 10:51:40 -04:00
Fabien Potencier
3b1ab7bfac Merge branch '5.1'
* 5.1:
  Internal classes are not legacy.
  [HttpFoundation] Skip the cookie_max_age fixture on PHP 8.
  add choice_translation_domain tests to prevent further regressions
  Update validators.tr.xlf
2020-09-13 07:01:37 +02:00
Fabien Potencier
9fae49fb20 Merge branch '4.4' into 5.1
* 4.4:
  Internal classes are not legacy.
  [HttpFoundation] Skip the cookie_max_age fixture on PHP 8.
  add choice_translation_domain tests to prevent further regressions
  Update validators.tr.xlf
2020-09-13 07:01:27 +02:00
Fabien Potencier
f2e7158bc0 Merge branch '3.4' into 4.4
* 3.4:
  [HttpFoundation] Skip the cookie_max_age fixture on PHP 8.
  add choice_translation_domain tests to prevent further regressions
  Update validators.tr.xlf
2020-09-13 07:00:26 +02:00
Alexander M. Turek
7d55e0c065 Internal classes are not legacy. 2020-09-12 23:46:40 +02:00
Christian Flothmann
7775b3707b add choice_translation_domain tests to prevent further regressions 2020-09-12 15:01:37 +02:00
Nicolas Grekas
908ca446e9 [MonologBridge] fix tests 2020-09-08 17:01:05 +02:00
Nicolas Grekas
d96c7a0f40 Merge branch '5.1'
* 5.1:
  [Debug] fix test
  consistently use same types for strict comparisons
  [PhpUnitBridge] Skip internal classes in CoverageListenerTrait
  [VarExporter] unserialize() might throw an Exception on php 8.
  [SecurityHttp] Don't call createMock() with multiple interfaces.
  [ErrorHandler] Parse "x not found" errors correctly on php 8.
  Prevent parsing invalid octal digits as octal numbers
  remove unnecessary check for  existing request
  [DI] fix ContainerBuilder on PHP8
  [Console] Make sure $maxAttempts is an int or null.
  [VarDumper] Fix caster for invalid SplFileInfo objects on php 8.
  [Intl] Skip test cases that produce a TypeError on php 8.
  [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3.
  [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
  add bosnian (bs) translation
  [Debug] Parse "x not found" errors correctly on php 8.
2020-09-08 16:20:09 +02:00
Nicolas Grekas
62a4559619 Merge branch '4.4' into 5.1
* 4.4:
  [Debug] fix test
  consistently use same types for strict comparisons
  [PhpUnitBridge] Skip internal classes in CoverageListenerTrait
  [VarExporter] unserialize() might throw an Exception on php 8.
  [ErrorHandler] Parse "x not found" errors correctly on php 8.
  Prevent parsing invalid octal digits as octal numbers
  remove unnecessary check for  existing request
  [DI] fix ContainerBuilder on PHP8
  [Console] Make sure $maxAttempts is an int or null.
  [VarDumper] Fix caster for invalid SplFileInfo objects on php 8.
  [Intl] Skip test cases that produce a TypeError on php 8.
  [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3.
  [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
  add bosnian (bs) translation
  [Debug] Parse "x not found" errors correctly on php 8.
2020-09-08 16:19:54 +02:00
Christian Flothmann
261a939ea6 Merge branch '3.4' into 4.4
* 3.4:
  Prevent parsing invalid octal digits as octal numbers
  [DI] fix ContainerBuilder on PHP8
  [Console] Make sure $maxAttempts is an int or null.
  [VarDumper] Fix caster for invalid SplFileInfo objects on php 8.
  [Intl] Skip test cases that produce a TypeError on php 8.
  [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3.
  [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
  add bosnian (bs) translation
  [Debug] Parse "x not found" errors correctly on php 8.
2020-09-08 13:16:46 +02:00
Alexey Kopytko
a0dedb9aa6 [PhpUnitBridge] Skip internal classes in CoverageListenerTrait 2020-09-08 09:26:14 +02:00
Fabien Potencier
3ba965a6cd feature #37704 [MonologBridge] Added SwitchUserTokenProcessor to log the impersonator (IgorTimoshenko)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

[MonologBridge] Added SwitchUserTokenProcessor to log the impersonator

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

This pull request adds the ability to log the impersonator user in case of user impersonation feature usage. The current TokenProcessor logs only the current token and there are no ability to simply log the original token, so we need to copy-paste the TokenProcessor and change a few lines to log the original token

Commits
-------

2f8651d4ec [MonologBridge] Added SwitchUserTokenProcessor to log the impersonator
2020-09-07 15:03:25 +02:00
Igor Timoshenko
2f8651d4ec [MonologBridge] Added SwitchUserTokenProcessor to log the impersonator 2020-09-07 15:03:17 +02:00
Fabien Potencier
b89b7474ca Merge branch '5.1'
* 5.1:
  Update UPGRADE-5.1.md
  [HttpKernel] Adjust tests to new "class not found" error message format.
  Don't call createMock with an array of interfaces.
  [FrameworkBundle] Fix Tests on PHPUnit 9.3.
  [WebProfilerBundle] Fix Tests on PHPUnit 9.3.
  esmtp error not being thrown properly
  [Yaml Parser] fixed Parser to skip comments when inlining sequences
  Update Connection.php
  [DI] fix generating preload file when cache_dir is outside project_dir
  Fix CacheCollectorPass with decorated cache pools
  [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
  Remove invalid instantiation declaration
  [PropertyInfo] Fix typed collections in PHP 7.4
2020-09-07 07:10:36 +02:00
Fabien Potencier
0bdef0a996 Merge branch '4.4' into 5.1
* 4.4:
  [HttpKernel] Adjust tests to new "class not found" error message format.
  Don't call createMock with an array of interfaces.
  [FrameworkBundle] Fix Tests on PHPUnit 9.3.
  [WebProfilerBundle] Fix Tests on PHPUnit 9.3.
  esmtp error not being thrown properly
  [Yaml Parser] fixed Parser to skip comments when inlining sequences
  [DI] fix generating preload file when cache_dir is outside project_dir
  Fix CacheCollectorPass with decorated cache pools
  [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x
  Remove invalid instantiation declaration
  [PropertyInfo] Fix typed collections in PHP 7.4
2020-09-07 07:10:28 +02:00
Alexander M. Turek
a8e762d8c3 Don't call createMock with an array of interfaces. 2020-09-06 21:21:37 +02:00
dFayet
c1e3703efd Create impersonation_exit_path() and *_url() functions 2020-09-06 10:51:53 +02:00
Alexander M. Turek
a3831dc0f2 [PhpUnitBridge] Adjust output parsing for PHPUnit 9.3. 2020-09-05 18:24:06 +02:00
Alexey Kopytko
99c98bd716 [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x 2020-09-05 18:24:06 +02:00
Alexey Kopytko
5f83811002 [PhpUnitBridge] CoverageListenerTrait update for PHPUnit 8.5/9.x 2020-09-04 13:30:02 +02:00
Gennadi Janzen
f44fa34098 [DoctrineBridge] Ulid and Uuid as Doctrine Types 2020-09-03 21:51:16 +02:00
Christian Flothmann
7ce234a34b Merge branch '5.1' into master
* 5.1:
  fix tests
2020-09-03 10:41:50 +02:00
Christian Flothmann
0a4cb62677 fix tests 2020-09-03 10:04:57 +02:00
Nicolas Grekas
4ee85e8e3b Merge branch '5.1'
* 5.1:
  Enable "native_constant_invocation" CS rule
  Make AbstractPhpFileCacheWarmer public
  Fix CS
  Add a warning comment on ldap empty password
  Bump Symfony version to 4.4.14
  Update VERSION for 4.4.13
  Update CHANGELOG for 4.4.13
  [PhpunitBridge] Fix deprecation type detection
2020-09-02 18:27:44 +02:00
Nicolas Grekas
034602699e Merge branch '4.4' into 5.1
* 4.4:
  Enable "native_constant_invocation" CS rule
  Make AbstractPhpFileCacheWarmer public
2020-09-02 18:23:27 +02:00
Nicolas Grekas
2e8ca94fb8 Merge remote-tracking branch 'origin/4.4' into 5.1
* origin/4.4:
  Fix CS
  Add a warning comment on ldap empty password
  Bump Symfony version to 4.4.14
  Update VERSION for 4.4.13
  Update CHANGELOG for 4.4.13
  [PhpunitBridge] Fix deprecation type detection
2020-09-02 18:21:51 +02:00
Nicolas Grekas
6c2a1c9a57 Merge branch '3.4' into 4.4
* 3.4:
  Enable "native_constant_invocation" CS rule
  Make AbstractPhpFileCacheWarmer public
2020-09-02 18:08:58 +02:00
Nicolas Grekas
4351a70637 Enable "native_constant_invocation" CS rule 2020-09-02 18:06:40 +02:00
Nicolas Grekas
160a5bf556 Merge branch '5.1'
* 5.1:
  [PHPUnitBridge] Fix deprecation type detection when trigger_deprecation is used
2020-09-02 17:48:48 +02:00
Nicolas Grekas
a8726dfa7b bug #38013 [PHPUnitBridge] Fix deprecation type detection when trigger_deprecation is used (l-vo)
This PR was merged into the 5.1 branch.

Discussion
----------

[PHPUnitBridge] Fix deprecation type detection when trigger_deprecation is used

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

when trigger_deprecation is used, the deprecation types (self, direct, indirect) are not properly detected because the file where the deprecation come from is always `deprecation-contracts/functions.php`. This PR aims to fix that.

Commits
-------

fd39961180 [PHPUnitBridge] Fix deprecation type detection when trigger_deprecation is used
2020-09-02 17:22:00 +02:00
Laurent VOULLEMIER
fd39961180 [PHPUnitBridge] Fix deprecation type detection when trigger_deprecation is used 2020-09-02 17:21:37 +02:00
Fabien Potencier
52719f2800 bug #37959 [PhpunitBridge] Fix deprecation type detection (when several autoload files are used) (l-vo)
This PR was merged into the 4.4 branch.

Discussion
----------

[PhpunitBridge] Fix deprecation type detection (when several autoload files are used)

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

Several autoload files are supported by the PHPUnit Bridge but when the internal paths are registered (for deprecation type detection), the paths (from prefixes) of the last autoload file override the paths previously registered. This PR fixes this bug.

Commits
-------

cc7b6c5e5a [PhpunitBridge] Fix deprecation type detection
2020-09-02 16:59:26 +02:00
Fabien Potencier
e06d339353 feature #35890 [Cache] give control over cache prefix seed (Tobion)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Cache] give control over cache prefix seed

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |
| License       | MIT
| Doc PR        |

Reopened #35723 for master.

The configurable cache prefix seed does not give full control over the cache prefix because the container class is added to the prefix in any case. This is a problem because the container class contains the app env name. We use different app environments for different deployment targets (dev and test). We want dev and test to use the same redis cache. But this is impossible to achieve because even setting the cache prefix seed does not accomplish this.

Commits
-------

6681b92524 [Cache] give control over cache prefix seed
2020-09-02 14:12:28 +02:00
Tobias Schultze
6681b92524 [Cache] give control over cache prefix seed
The configurable cache prefix seed does not give full control over the cache prefix because the container class is added to the prefix in any case. This is a problem because the container class contains the app env name. We use different app environments for different deployment targets (dev and test). Dev and test should use the same redis cache. But this is impossible to achieve because even setting the cache prefix seed does not accomplish this.
2020-09-02 11:53:39 +02:00
Alex Pott
03201f0d23
No longer need to silence errors as we're catching them all 2020-09-02 10:52:53 +01:00
Alex Pott
244e8d2408
Revert "Swallow errors"
This reverts commit ee8cc2666b.
2020-09-02 10:51:41 +01:00
Alex Pott
ee8cc2666b
Swallow errors 2020-09-02 10:14:45 +01:00
Fabien Potencier
f9bfe7fd79
Allow Drupal to wrap the Symfony test listener 2020-09-02 10:08:38 +01:00
Fabien Potencier
a060635b97 feature #38017 [PHPUnitBridge] deprecations not disabled anymore when disabled=0 (l-vo)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[PHPUnitBridge] deprecations not disabled anymore when disabled=0

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

According to the [docs](https://symfony.com/doc/current/components/phpunit_bridge.html#disabling-the-deprecation-helper), `disabled=1` turns off deprecations mode on phpunit-bridge. It's not totally true since deprecations are disabled as soon as `disabled` key is present in `SYMFONY_DEPRECATIONS_HELPER`. So if `disabled=0` deprecations are still disabled.

Instead of updating the doc, this PR suggest to make `disabled` behavior consistent with `verbose` behavior, so:
- `disabled` => deprecations disabled
- `disabled=0` => deprecations enabled
- `disabled=1` => deprecations disabled

Commits
-------

6908e3d156 [PHPUnitBridge] deprecations not enabled anymore when disabled=0
2020-09-01 18:27:52 +02:00
Laurent VOULLEMIER
6908e3d156 [PHPUnitBridge] deprecations not enabled anymore when disabled=0
Allow to pass 0 or 1 to "disabled" to be consistent with "verbose" key behavior
2020-09-01 15:29:20 +02:00
Christian Flothmann
59ae592909 Merge branch '5.1' into master
* 5.1:
  Missed AbstractArgument
  swallow deprecations
2020-09-01 15:18:17 +02:00
Christian Flothmann
b7cd4c7d4e Merge branch '4.4' into 5.1
* 4.4:
  swallow deprecations
2020-09-01 15:16:17 +02:00
Christian Flothmann
f0067c106c swallow deprecations 2020-09-01 11:34:43 +02:00
Laurent VOULLEMIER
cc7b6c5e5a [PhpunitBridge] Fix deprecation type detection
When using several vendor directories
2020-08-31 21:10:44 +02:00
Fabien Potencier
cbbca0e6ea Fix Composer constraint 2020-08-30 12:30:32 +02:00
Nate Wiebe
dc6b3bf62d [Translation] Translatable objects 2020-08-28 18:48:14 +02:00
Fabien Potencier
5189571300 Merge branch '4.4' into 5.1
* 4.4:
  Fix typo
2020-08-28 18:19:35 +02:00
Fabien Potencier
4dc9ac0acc Fix typo 2020-08-28 18:19:28 +02:00
Fabien Potencier
5b3ebdc7e6 Merge branch '5.1'
* 5.1:
  [PhpUnitBridge] Create a predictable symlink pointing to the local install
  [PropertyInfo] Backport support for typed properties (PHP 7.4)
  [PhpUnitBridge] Polyfill new phpunit 9.1 assertions
  [PhpUnitBridge] Move assertMatchesRegularExpression in PolyfillAssertTrait
  [PhpUnit] Add polyfill for assertMatchesRegularExpression()
  Update Notifier bridge readme
  [TwigBridge] Fix #37931: BC break where filter method `trans` did not allow null values for `$message` parameter anymore
  [PropertyAccess] Fix accessing dynamic properties
2020-08-28 18:19:10 +02:00
Fabien Potencier
f6c0706762 Merge branch '4.4' into 5.1
* 4.4:
  [PhpUnitBridge] Create a predictable symlink pointing to the local install
  [PropertyInfo] Backport support for typed properties (PHP 7.4)
  [PhpUnitBridge] Polyfill new phpunit 9.1 assertions
  [PhpUnitBridge] Move assertMatchesRegularExpression in PolyfillAssertTrait
  [PhpUnit] Add polyfill for assertMatchesRegularExpression()
2020-08-28 18:18:32 +02:00
Fabien Potencier
ac96fdacd3 minor #37974 [PhpUnitBridge] Create a predictable symlink pointing to the local install (dunglas)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[PhpUnitBridge] Create a predictable symlink pointing to the local install

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | n/a
| License       | MIT
| Doc PR        | n/a

Static analysis tools such as PHPStan need to be able to autoload classes provided by to work. It's also useful to use the assertions provided by PHPUnit with other testing tools such as Behat.
When using `simple-phpunit`, PHPUnit isn't installed in the `vendor/` directory, consequently other tools cannot autoload its classes.

A workaround is to configure these tools to load the autoloader installed by `simple-phpunit`. Example with PHPstan:

```neon
parameters:
	bootstrapFiles:
		- vendor/bin/.phpunit/phpunit-9.2-0/vendor/autoload.php
```

However, the path of the autoloader isn't predictable: it depends of PHPUnit version.

This PR changes `simple-phpunit` to create a symlink with a predictable path (`vendor/.phpunit/phpunit`) pointing to the currently used version of PHPUnit, so it is possible to hardcode this value in config files.

The symlink is recreated before every run, so if a different version of PHPUnit must be used because the PHP version in use is different from the previous run (frequent when developing libraries compatible with multiple PHP versions), it still works.

Commits
-------

bf7654f245 [PhpUnitBridge] Create a predictable symlink pointing to the local install
2020-08-28 12:27:13 +02:00
Kévin Dunglas
bf7654f245 [PhpUnitBridge] Create a predictable symlink pointing to the local install 2020-08-28 12:27:07 +02:00
Mohammad Emran Hasan
d945b88c1a [PhpUnitBridge] Polyfill new phpunit 9.1 assertions 2020-08-28 09:39:33 +02:00
Kévin Dunglas
0426113eda
[PhpUnitBridge] Move assertMatchesRegularExpression in PolyfillAssertTrait 2020-08-27 16:43:53 +02:00
Kévin Dunglas
33eccd2a00 [PhpUnit] Add polyfill for assertMatchesRegularExpression() 2020-08-27 16:03:04 +02:00
Flinsch
039fc80d6c [TwigBridge] Fix #37931: BC break where filter method trans did not allow null values for $message parameter anymore 2020-08-26 16:33:04 +02:00
Fabien Potencier
704c648ba5 feature #37708 Allow Drupal to wrap the Symfony test listener (alexpott)
This PR was squashed before being merged into the 5.2-dev branch.

Discussion
----------

Allow Drupal to wrap the Symfony test listener

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | kinda
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | symfony/symfony-docs#... <!-- required for new features -->

Drupal has a test listener that wraps the Symfony listener as we need to manipulate deprecation testing to skip specific deprecations. We've managed to remove some how custom stuff and reaching into Symfony's privates via reflection recently (and fix a bug or two) but now we're getting output like:
```
  2x: a:4:{s:11:"deprecation";s:191:"Calling Drupal\Tests\WebAssert::responseNotMatches with more than one argument is deprecated in drupal:9.1.0 and will throw an exception in drupal:10.0.0. See https://www.drupal.org/node/TODO";s:5:"class";s:52:"Drupal\Tests\comment\Functional\CommentAnonymousTest";s:6:"method";s:13:"testAnonymous";s:15:"triggering_file";s:74:"/Users/alex/dev/sites/drupal8alt.dev/core/tests/Drupal/Tests/WebAssert.php";}
    2x in DrupalListener::endTest from Drupal\Tests\Listeners
```
instead of
```
  2x: Calling Drupal\Tests\WebAssert::responseNotMatches with more than one argument is deprecated in drupal:9.1.0 and will throw an exception in drupal:10.0.0. See https://www.drupal.org/node/TODO
    2x in CommentAnonymousTest::testAnonymous from Drupal\Tests\comment\Functional
```

We can fix this by aliasing and copying the \Symfony\Bridge\PhpUnit\DeprecationErrorHandler\Deprecation class but ideally that class could be a bit more liberal in its implementation.

Commits
-------

91de46da3f Allow Drupal to wrap the Symfony test listener
2020-08-23 19:24:34 +02:00
Alex Pott
91de46da3f Allow Drupal to wrap the Symfony test listener 2020-08-23 19:24:26 +02:00
Fabien Potencier
374a0b2eb5 Merge branch '5.1'
* 5.1:
  fix passing arguments to call_user_func_array() on PHP 8
  allow Doctrine DBAL 3
  [Filesystem] fix test on PHP 8
2020-08-21 19:20:41 +02:00
Fabien Potencier
0611b6331c Merge branch '4.4' into 5.1
* 4.4:
  fix passing arguments to call_user_func_array() on PHP 8
  allow Doctrine DBAL 3
  [Filesystem] fix test on PHP 8
2020-08-21 19:19:47 +02:00
Christian Flothmann
967331e63a allow Doctrine DBAL 3 2020-08-21 14:55:23 +02:00
Matthieu Napoli
ec945f10d8 [HttpKernel] Add $kernel->getBuildDir() to separate it from the cache directory 2020-08-21 08:43:34 +02:00
Fabien Potencier
779303a248 feature #37847 [Serializer][Mime] Fix Mime message serialization (fabpot)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Serializer][Mime] Fix Mime message serialization

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | yes
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       | Fix #37414, Fix #37324 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License       | MIT
| Doc PR        | n/a

Symfony serialization is used by Messenger to serialize Emails. By Email messages are data objects with some logic to prepare emails to be sent. Without configuration, the Symfony Serializer serializes Emails with too many data (and triggers some unneeded validation).

This PR aims to fix the above issue and at the same time makes serialized emails as small as possible and as readable as possible.

Commits
-------

9d869b1ece Fix Mime message serialization
2020-08-17 13:58:42 +02:00
Fabien Potencier
5d15ce4e65 Merge branch '5.1'
* 5.1:
  stop using deprecated PHPUnit APIs
2020-08-17 12:01:44 +02:00
Fabien Potencier
38e5a15ff4 Merge branch '4.4' into 5.1
* 4.4:
  stop using deprecated PHPUnit APIs
2020-08-17 12:01:29 +02:00
Fabien Potencier
dbe4e83ae6 minor #37831 stop using deprecated PHPUnit APIs (xabbuh)
This PR was merged into the 4.4 branch.

Discussion
----------

stop using deprecated PHPUnit APIs

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

Commits
-------

3d209c46e4 stop using deprecated PHPUnit APIs
2020-08-17 11:56:45 +02:00
Christian Flothmann
3d209c46e4 stop using deprecated PHPUnit APIs 2020-08-17 11:35:39 +02:00
Fabien Potencier
a5b28c55f8 Merge branch '5.1'
* 5.1:
  Fix CS
  Fix CS
  Fix CS
  [Validator] Add Polish translation for ISIN constraint
2020-08-17 09:50:35 +02:00
Fabien Potencier
524941e36e Merge branch '4.4' into 5.1
* 4.4:
  Fix CS
  Fix CS
  [Validator] Add Polish translation for ISIN constraint
2020-08-17 09:42:30 +02:00
Fabien Potencier
85090fcfb8 Fix CS 2020-08-17 09:39:58 +02:00
Fabien Potencier
c9cdac153f Merge branch '3.4' into 4.4
* 3.4:
  Fix CS
  [Validator] Add Polish translation for ISIN constraint
2020-08-17 09:31:35 +02:00
Fabien Potencier
ba042b1acf Fix CS 2020-08-17 09:27:37 +02:00
Fabien Potencier
9d869b1ece Fix Mime message serialization 2020-08-17 08:40:05 +02:00
Fabien Potencier
f58b50c336 Merge branch '5.1'
* 5.1:
  Postpone BC layer removal to 6.0.
  add validator translation 99 for Italian language
  stop using the deprecated at() PHPUnit matcher
  Fix typehint phpdoc
2020-08-13 16:19:50 +02:00
Fabien Potencier
cb92a3c8c1 Merge branch '4.4' into 5.1
* 4.4:
  add validator translation 99 for Italian language
  stop using the deprecated at() PHPUnit matcher
  Fix typehint phpdoc
2020-08-13 16:19:42 +02:00
Fabien Potencier
544d276cba Merge branch '3.4' into 4.4
* 3.4:
  add validator translation 99 for Italian language
  stop using the deprecated at() PHPUnit matcher
  Fix typehint phpdoc
2020-08-13 16:18:44 +02:00
Christian Flothmann
850389731c stop using the deprecated at() PHPUnit matcher 2020-08-12 16:55:37 +02:00
Grégoire Pineau
25095d8908 feature #37539 [Workflow] Added Context to Workflow Event (epitre)
This PR was merged into the 5.2-dev branch.

Discussion
----------

[Workflow] Added Context to Workflow Event

There's also a default context for the initial marking event.

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #37421
| License       | MIT
| Doc PR        | https://github.com/symfony/symfony-docs/pull/13947

This time, I need context in the events, because, sometimes, the transition is automatic and sometimes, it is manual. I want to be able to make the difference. I figured using the context for that is a good idea. I hope you do too :)

By the way, I believe it also fixes #37421 . I took @pluk77 request to be able to differentiate an initial marking by having a default context in that case

Commits
-------

bfe07dda83 Added Context to Workflow Event There's also a default context for the initial marking event.
2020-08-12 15:17:24 +02:00
Fabien Potencier
b912af9261 Merge branch '5.1'
* 5.1:
  Fix typo
  Fix deprecated libxml_disable_entity_loader
  Add Tagalog translations for validator messages 94, 95, 96 and 99
  PHPUnit's assertContains() performs strict comparisons now.
  [ClassLoader][Routing] Fix namespace parsing on php 8.
  Fix deprecated libxml_disable_entity_loader
  Made reference to PHPUnit\Util\XML::loadfile php5-compatible.
  [Validator] Add missing translations for german and vietnamese
  Modernized deprecated PHPUnit assertion calls
  [Console] The message of "class not found" errors has changed in php 8.
  The PHPUnit\Util\XML class has been removed in PHPUnit 9.3.
  [Console] Make sure we pass a numeric array of arguments to call_user_func_array().
  Remove outdated references from base_js.html.twig file
  [String] We cannot have a "provides" function in test cases.
  Typo: somes styles fixed
  [Serializer] Fix that it will never reach DOMNode
  [Validator] sync translations
  [VarDumper] Improve previous fix on light array coloration
  [Cache] Fix #37667
2020-08-10 10:10:48 +02:00
Fabien Potencier
c44c606b11 Merge branch '4.4' into 5.1
* 4.4:
  Fix typo
  Fix deprecated libxml_disable_entity_loader
  Add Tagalog translations for validator messages 94, 95, 96 and 99
  PHPUnit's assertContains() performs strict comparisons now.
  [ClassLoader][Routing] Fix namespace parsing on php 8.
  Fix deprecated libxml_disable_entity_loader
  Made reference to PHPUnit\Util\XML::loadfile php5-compatible.
  [Validator] Add missing translations for german and vietnamese
  Modernized deprecated PHPUnit assertion calls
  [Console] The message of "class not found" errors has changed in php 8.
  The PHPUnit\Util\XML class has been removed in PHPUnit 9.3.
  [Console] Make sure we pass a numeric array of arguments to call_user_func_array().
  [Serializer] Fix that it will never reach DOMNode
  [Validator] sync translations
  [VarDumper] Improve previous fix on light array coloration
  [Cache] Fix #37667
2020-08-10 10:03:57 +02:00
Fabien Potencier
3a04739a83 Merge branch '3.4' into 4.4
* 3.4:
  Add Tagalog translations for validator messages 94, 95, 96 and 99
  PHPUnit's assertContains() performs strict comparisons now.
  [ClassLoader][Routing] Fix namespace parsing on php 8.
  Fix deprecated libxml_disable_entity_loader
  Made reference to PHPUnit\Util\XML::loadfile php5-compatible.
  [Validator] Add missing translations for german and vietnamese
  Modernized deprecated PHPUnit assertion calls
  [Console] The message of "class not found" errors has changed in php 8.
  The PHPUnit\Util\XML class has been removed in PHPUnit 9.3.
  [Console] Make sure we pass a numeric array of arguments to call_user_func_array().
  [Serializer] Fix that it will never reach DOMNode
  [Validator] sync translations
  [VarDumper] Improve previous fix on light array coloration
  [Cache] Fix #37667
2020-08-10 09:27:51 +02:00
Alexander M. Turek
ab417f7040 Modernized deprecated PHPUnit assertion calls 2020-08-09 10:13:48 +02:00
Alexander M. Turek
cdd727a93b
[PhpUnitBridge] Fix assertDoesNotMatchRegularExpression() polyfill. 2020-08-08 20:25:28 +02:00
dbrekelmans
c1344257f1 Fix getTranslationNodeVisitor() return type 2020-07-31 07:47:48 +02:00
Nicolas Grekas
91487707db Merge branch '5.1'
* 5.1:
  Allow doctrine/persistence 2
  Fix Redis tests
  [DoctrineBridge] Bump doctrine/data-fixtures.
2020-07-23 18:56:54 +02:00
Nicolas Grekas
20cf5df00b Merge branch '5.0' into 5.1
* 5.0:
  Allow doctrine/persistence 2
  Fix Redis tests
  [DoctrineBridge] Bump doctrine/data-fixtures.
2020-07-23 18:55:47 +02:00
Nicolas Grekas
081ad138f7 Merge branch '4.4' into 5.0
* 4.4:
  Allow doctrine/persistence 2
  Fix Redis tests
  [DoctrineBridge] Bump doctrine/data-fixtures.
2020-07-23 18:54:02 +02:00
Alexander M. Turek
cd22fe6c92 Allow doctrine/persistence 2 2020-07-23 18:49:41 +02:00
Nicolas Grekas
4a8f11c1dd Merge branch '3.4' into 4.4
* 3.4:
  Fix Redis tests
  [DoctrineBridge] Bump doctrine/data-fixtures.
2020-07-23 18:48:29 +02:00
Alexander M. Turek
4b611015d5 [DoctrineBridge] Bump doctrine/data-fixtures. 2020-07-23 14:17:19 +02:00
Nicolas Grekas
4b1db18b76 Merge branch '5.1'
* 5.1:
  [PhpUnitBridge] Fix tests on Windows
2020-07-23 11:29:40 +02:00
Nicolas Grekas
266fe76208 [PhpUnitBridge] Fix tests on Windows 2020-07-23 11:26:24 +02:00
Nicolas Grekas
b72e9c28da Merge branch '5.1'
* 5.1:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Removed @internal from Composite
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [Messenger] fix ignore account & endpoint options amazon sqs connection
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
2020-07-23 10:36:44 +02:00
Nicolas Grekas
1b7714a05c Merge branch '5.0' into 5.1
* 5.0:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
2020-07-23 10:36:24 +02:00
Nicolas Grekas
5d79383028 Merge branch '4.4' into 5.0
* 4.4:
  fix merge
  Require PHPUnit 9.3 on PHP 8
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [Serializer] Support multiple levels of discriminator mapping
  Use hexadecimal numerals instead of hexadecimals in strings to represent error codes.
  [SCA] Minor fixes on tests
  [WebProfilerBundle] modified url generation to use absolute urls
  [Mailer] Fix reply-to functionality in the SendgridApiTransport
  [Mime] Fix compat with HTTP requests
  ticket_36879 - Fix mandrill raw http request setting from email/name
2020-07-23 10:36:09 +02:00
Nicolas Grekas
50505cb9d2 Merge branch '3.4' into 4.4
* 3.4:
  [Cache] fix catching auth errors
  Fix CS
  [FrameworkBundle] set default session.handler alias if handler_id is not provided
  Fix CS
  Readability update
  Fix checks for phpunit releases on Composer 2 (resolves #37601)
  [SCA] Minor fixes on tests
2020-07-23 10:31:43 +02:00
Graham Campbell
54b13c04c9 Require PHPUnit 9.3 on PHP 8 2020-07-23 10:21:55 +02:00
Colin O'Dell
2bb3f08fba
Fix checks for phpunit releases on Composer 2 (resolves #37601) 2020-07-22 18:00:00 -04:00
Mohammad Emran Hasan
51c0bf0d0d [PhpUnitBridge] Polyfill new phpunit 9.1 assertions 2020-07-15 14:47:34 +02:00
Nicolas Grekas
ef19a03b2b Merge branch '5.1'
* 5.1:
  [Cache] Use the default expiry when saving (not when creating) items
  Fix typo
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  [OptionsResolver] Fix force prepend normalizer
  add vietnamese translation for html5 color validation
2020-07-12 14:58:15 +02:00
Nicolas Grekas
c87847c361 Merge branch '5.0' into 5.1
* 5.0:
  [Cache] Use the default expiry when saving (not when creating) items
  Fix typo
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  [OptionsResolver] Fix force prepend normalizer
  add vietnamese translation for html5 color validation
2020-07-12 14:58:00 +02:00
Nicolas Grekas
afd9760357 Merge branch '4.4' into 5.0
* 4.4:
  [Cache] Use the default expiry when saving (not when creating) items
  Fix typo
  Fix DBAL deprecation
  [Form] Fix ChoiceType translation domain
  Add Tagalog translations for new form messages
  [Form] Add missing vietnamese translations
  sync translations from master
  [OptionsResolver] Fix force prepend normalizer
  add vietnamese translation for html5 color validation
2020-07-12 14:51:51 +02:00