Commit Graph

44175 Commits

Author SHA1 Message Date
Nicolas Grekas 9d472c715f minor #33482 fix tests mocking final events (Tobion)
This PR was merged into the 4.4 branch.

Discussion
----------

fix tests mocking final events

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #...   <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        |

Fix tests in 4.4 extracted from #33297

Commits
-------

637461fd51 fix tests mocking final events
2019-09-06 17:55:53 +02:00
Nicolas Grekas 654b8037f1 minor #33492 [MonologBridge] Bump min version for monolog ^1.25 and drop dead code (lyrixx)
This PR was merged into the 4.4 branch.

Discussion
----------

[MonologBridge] Bump min version for monolog ^1.25 and drop dead code

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

Commits
-------

1e19c65b67 [MonologBridge] Bump min version for monolog ^1.25 and drop dead code
2019-09-06 17:53:25 +02:00
Nicolas Grekas 108a799512 minor #33490 [Bridge/Twig] use tty group on testLintDefaultPaths (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Bridge/Twig] use tty group on testLintDefaultPaths

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/pull/33446#issuecomment-528811376
| License       | MIT
| Doc PR        | -

Note that I still think we should deprecate reading from STDIN when not explicitly asked for, as explained in https://github.com/symfony/symfony/pull/33446#issuecomment-528276646

Commits
-------

3c59bb5c93 [Bridge/Twig] use tty group on testLintDefaultPaths
2019-09-06 17:52:51 +02:00
Nicolas Grekas 9dca229573 [Mailer] fix deps=low 2019-09-06 17:26:18 +02:00
Nicolas Grekas 388f28f726 Merge branch '4.3' into 4.4
* 4.3:
  cs fix
2019-09-06 16:52:15 +02:00
Nicolas Grekas 87ec83c00f Merge branch '3.4' into 4.3
* 3.4:
  cs fix
2019-09-06 16:50:57 +02:00
Nicolas Grekas fbeef96d66 cs fix 2019-09-06 16:49:07 +02:00
Fabien Potencier b58876c5b3 feature #33471 [Mailer] Check email validity before opening an SMTP connection (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Check email validity before opening an SMTP connection

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes-ish
| New feature?  | yes
| BC breaks?    | no-ish
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

When using an SMTP server to send emails, the connection to the SMTP server happens before being sure that the email to sent is valid. That does not happen with HTTP transports.

This pull request implements a new method to be sure that we don't connect to the SMTP server if the email is not valid.

Commits
-------

dc376f52a5 [Mailer] Check email validity before opening an SMTP connection
2019-09-06 16:42:40 +02:00
Nicolas Grekas a86b8cfd1a Merge branch '4.3' into 4.4
* 4.3:
  [FrameworkBundle] Fixed suggested package for missing server:dump command
  Add BC break note to UPGRADE-4.2.md
2019-09-06 16:33:21 +02:00
Nicolas Grekas cfed7d7970 typo 2019-09-06 16:32:32 +02:00
Grégoire Pineau 1e19c65b67 [MonologBridge] Bump min version for monolog ^1.25 and drop dead code 2019-09-06 16:22:32 +02:00
Nicolas Grekas 7a1545cc8f minor #33491 [Debug] disable new DebugClassLoader when testing the legacy one (nicolas-grekas)
This PR was merged into the 4.4 branch.

Discussion
----------

[Debug] disable new DebugClassLoader when testing the legacy one

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

Commits
-------

25a683bbeb [Debug] disable new DebugClassLoader when testing the legacy one
2019-09-06 16:08:36 +02:00
Nicolas Grekas 25a683bbeb [Debug] disable new DebugClassLoader when testing the legacy one 2019-09-06 16:02:48 +02:00
Fabien Potencier dc376f52a5 [Mailer] Check email validity before opening an SMTP connection 2019-09-06 15:51:50 +02:00
Fabien Potencier 8e50eb92e4 feature #31177 #21571 Comparing roles to detected that users has changed (oleg-andreyev)
This PR was merged into the 4.4 branch.

Discussion
----------

#21571 Comparing roles to detected that users has changed

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT
| Fixed tickets | https://github.com/symfony/symfony/issues/21571#issuecomment-385757813
| Docs | https://github.com/symfony/symfony-docs/pull/11457

**Case 1:**
User A has roles `foo, bar and admin`, User A is signed-in into application and token is persisted, later another User B with role `admin`, decided to restrict role `admin` for User A, so User A won't lose it's privileges until session is expired or logout, because token is persisted with `roles` and `authenticated=true` and roles are not compared.

Ref. to the previous attempt: #27121

Commits
-------

4f4c30d59e - updated AbstractToken to compare Roles - Updated isEqualTo method to match roles as default User implements EquatableInterface - added test case - bumped symfony/security-core to 4.4
2019-09-06 15:34:30 +02:00
Oleg Andreyev 4f4c30d59e - updated AbstractToken to compare Roles
- Updated isEqualTo method to match roles as default User implements EquatableInterface
- added test case
- bumped symfony/security-core to 4.4
2019-09-06 15:59:50 +03:00
Fabien Potencier c81fc3a079 bug #33469 [FrameworkBundle] Fixed suggested package for missing server:dump command (lyrixx)
This PR was merged into the 4.3 branch.

Discussion
----------

[FrameworkBundle] Fixed suggested package for missing server:dump command

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

Commits
-------

4017477eed [FrameworkBundle] Fixed suggested package for missing server:dump command
2019-09-06 14:26:40 +02:00
Grégoire Pineau 4017477eed [FrameworkBundle] Fixed suggested package for missing server:dump command 2019-09-06 14:20:26 +02:00
Nicolas Grekas 3c59bb5c93 [Bridge/Twig] use tty group on testLintDefaultPaths 2019-09-06 13:06:38 +02:00
Fabien Potencier 255cc7f24b minor #33477 Add BC break note to UPGRADE-4.2.md (umpirsky)
This PR was merged into the 4.3 branch.

Discussion
----------

Add BC break note to UPGRADE-4.2.md

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

Added a note about upgrade consequences. See #33473

Commits
-------

89f7d77ea0 Add BC break note to UPGRADE-4.2.md
2019-09-06 13:02:23 +02:00
Nicolas Grekas cab412f0cb Merge branch '4.3' into HEAD
* 4.3:
  typos bis
2019-09-06 12:29:12 +02:00
Nicolas Grekas 7ba77ecc0d typos bis 2019-09-06 12:24:45 +02:00
Nicolas Grekas 4234bc8ced Merge branch '4.3' into 4.4
* 4.3:
  typos
2019-09-06 12:15:53 +02:00
Nicolas Grekas 7d1286884b typos 2019-09-06 12:15:48 +02:00
Nicolas Grekas 28d331bb58 Merge branch '4.3' into 4.4
* 4.3:
  Fix more bad tests
  Fix test fixtures with deprecated method signatures.
  Fix 4.3 tests forward compat
  [Messenger] fix empty amqp body returned as false
  Fix routing cache broken when using generator_class
2019-09-06 12:03:11 +02:00
Nicolas Grekas 54a514fc1d bug #31964 [Router] routing cache crash when using generator_class (dFayet)
This PR was merged into the 4.3 branch.

Discussion
----------

[Router] routing cache crash when using generator_class

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

Since #28865 the Router use, by default, new generator, matcher, and dumpers.
This leads to crash when the Router use a custom generator, or matcher based on the old ones.

Commits
-------

a5b46e5390 Fix routing cache broken when using generator_class
2019-09-06 12:00:20 +02:00
Nicolas Grekas 1b835d1249 minor #33484 Fix test fixtures with deprecated method signatures (derrabus, nicolas-grekas)
This PR was merged into the 4.3 branch.

Discussion
----------

Fix test fixtures with deprecated method signatures

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #33483 (partly)
| License       | MIT
| Doc PR        | N/A

This PR upgrades two fixtures that implemented deprecated method signatures. As far as I can tell, they are used in tests that do not specifically test legacy behavior, so the fixtures should be up to date. Currently, these fixtures cause failing tests on the 4.4 branch.

Commits
-------

cc3e3d54ea Fix more bad tests
592aacff6f Fix test fixtures with deprecated method signatures.
2019-09-06 11:53:27 +02:00
Nicolas Grekas 2feae7bebb minor #33479 [SecurityBundle] Fix 4.3 tests forward compat (yceruto)
This PR was merged into the 4.3 branch.

Discussion
----------

[SecurityBundle] Fix 4.3 tests forward compat

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | https://github.com/symfony/symfony/issues/33478
| License       | MIT
| Doc PR        | -

Commits
-------

f092331eb1 Fix 4.3 tests forward compat
2019-09-06 11:49:53 +02:00
Nicolas Grekas d081f1689b bug #33481 [Messenger] fix empty amqp body returned as false (Tobion)
This PR was merged into the 4.3 branch.

Discussion
----------

[Messenger] fix empty amqp body returned as false

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

Having `false` in the body breaks typehints in the serializer and is not consistent with other transports like doctrine. See https://github.com/pdezwart/php-amqp/issues/351

Commits
-------

ee5cbe3658 [Messenger] fix empty amqp body returned as false
2019-09-06 11:42:14 +02:00
Nicolas Grekas cc3e3d54ea Fix more bad tests 2019-09-06 11:34:03 +02:00
Saša Stamenković 89f7d77ea0 Add BC break note to UPGRADE-4.2.md 2019-09-06 11:27:22 +02:00
Alexander M. Turek 592aacff6f Fix test fixtures with deprecated method signatures. 2019-09-06 00:33:19 +02:00
Tobias Schultze 637461fd51 fix tests mocking final events 2019-09-05 22:36:38 +02:00
Yonel Ceruto f092331eb1 Fix 4.3 tests forward compat 2019-09-05 14:00:30 -04:00
Tobias Schultze ee5cbe3658 [Messenger] fix empty amqp body returned as false 2019-09-05 18:44:17 +02:00
Nicolas Grekas 5765539a3c minor #33480 [Mailer] Added messenger to dev dependencies (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Added messenger to dev dependencies

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

PR #33454 introduced a new test case that mocks the `MessageBusInterface` from the messenger component. This makes the tests suite fail on travis because PHPUnit refuses to create a mock for an interface that does not exist.

```
There was 1 failure:

1) Symfony\Component\Mailer\Tests\MailerTest::testSendingRawMessages

Failed asserting that exception of type "PHPUnit\Framework\MockObject\RuntimeException" matches expected exception "Symfony\Component\Mailer\Exception\LogicException". Message was: "Cannot stub or mock class or interface "Symfony\Component\Messenger\MessageBusInterface" which does not exist" at

/home/travis/build/symfony/symfony/src/Symfony/Component/Mailer/Tests/MailerTest.php:28
```

This PR fixes the test by adding the Messenger component to Mailer's dev dependencies.

Commits
-------

248f0827c7 [Mailer] Added messenger to dev dependencies.
2019-09-05 17:51:47 +02:00
Alexander M. Turek 248f0827c7 [Mailer] Added messenger to dev dependencies. 2019-09-05 17:38:24 +02:00
Nicolas Grekas f94d600220 minor #33475 [Validator] Update "suggest" section in composer.json (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Update "suggest" section in composer.json

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

After #33459, the composer suggestions for the validator component are a bit misleading. Sorry for having missed that in my PR.

Commits
-------

5bf8ccae17 [Validator] Update "suggest" section in composer.json.
2019-09-05 15:24:54 +02:00
Alexander M. Turek 5bf8ccae17 [Validator] Update "suggest" section in composer.json. 2019-09-05 15:19:43 +02:00
Nicolas Grekas eb0ffbc8a4 feature #33459 [Validator] Deprecated CacheInterface in favor of PSR-6 (derrabus)
This PR was merged into the 4.4 branch.

Discussion
----------

[Validator] Deprecated CacheInterface in favor of PSR-6

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

With PSR-6, the validator component does not need its own `CacheInterface`, so let's remove it.

Note that I still use the now deprecated `Psr6Cache` class to keep the logic inside `LazyLoadingMetadataFactory` simple. My plan would be to inline all logic from `Psr6Cache` into `LazyLoadingMetadataFactory` for 5.0.

Commits
-------

0b08040459 [Validator] Deprecated CacheInterface in favor of PSR-6.
2019-09-05 14:32:50 +02:00
Alexander M. Turek 0b08040459 [Validator] Deprecated CacheInterface in favor of PSR-6. 2019-09-05 14:29:38 +02:00
Fabien Potencier b7371ea5c6 feature #33271 Added new ErrorController + Preview and enabling there the error renderer mechanism (yceruto)
This PR was merged into the 4.4 branch.

Discussion
----------

Added new ErrorController + Preview and enabling there the error renderer mechanism

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | yes
| Tests pass?   | yes (deps=high failure is normal)
| Fixed tickets | -
| License       | MIT
| Doc PR        | TODO

After deprecating the `ExceptionController` in TwigBundle (refs https://github.com/symfony/symfony/pull/31398) the `twig.exception_controller` config key becomes useless as feature provided by TwigBundle, while the preview controller is taking more relevance for the error renderer mechanish.

**Proposal**
 * Deprecate the `twig.exception_controller` config key in favor of `framework.error_controller` with default `ErrorController` that activates the error renderer mechanism through the current `ExceptionListener`, meaning also that `DebugHandlersListener::onKernelException` method becomes useless too.
 * Deprecate the `PreviewErrorController` from TwigBundle in favor of similar in FrameworkBundle.

So you no longer need to install TwigBundle to create a custom error controller or check the preview output of an error renderer (included `TwigHtmlErrorRenderer`).

Btw this would fix https://github.com/symfony/symfony/pull/31398#issuecomment-490081769, removing here workaround in SecurityBundle.

TODO:
- [x] Update CHANGELOG & UPGRADE files
- [x] Add tests

WDYT?

Commits
-------

b79532ab0e Add ErrorController to preview and render errors
2019-09-05 13:15:04 +02:00
Fabien Potencier 7a9c5da1de minor #33463 [Mailer] Fix an error message (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Fix an error message

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

Now  that the host is not the name anymore, the error message when not having a host is wrong.

Commits
-------

60bb1c0ddc [Mailer] Fix an error message
2019-09-05 10:11:06 +02:00
Fabien Potencier f0c3c47a07 Fix wrong namespace 2019-09-05 05:08:57 +02:00
Fabien Potencier b2ca530d82 [Mailer] Fix typo 2019-09-05 03:35:53 +02:00
Fabien Potencier 60bb1c0ddc [Mailer] Fix an error message 2019-09-05 03:13:57 +02:00
Fabien Potencier 3e8a726c41 Merge branch '4.3' into 4.4
* 4.3:
  maintain sender/recipient name in SMTP envelopes
  Fix #32148 TransportException was not thrown
2019-09-04 12:09:07 +02:00
Fabien Potencier 828e5a4ae3 bug #33387 [Mailer] maintain sender/recipient name in SMTP envelopes (xabbuh)
This PR was merged into the 4.3 branch.

Discussion
----------

[Mailer] maintain sender/recipient name in SMTP envelopes

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

Commits
-------

46ed0e84cd maintain sender/recipient name in SMTP envelopes
2019-09-04 12:04:48 +02:00
Christian Flothmann 46ed0e84cd maintain sender/recipient name in SMTP envelopes 2019-09-04 11:58:50 +02:00
Fabien Potencier 6988286b23 feature #33454 [Mailer] Improve an exception when trying to send a RawMessage without an Envelope (fabpot)
This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Improve an exception when trying to send a RawMessage without an Envelope

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #33256
| License       | MIT
| Doc PR        | n/a

<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.

Additionally (see https://symfony.com/roadmap):
 - Bug fixes must be submitted against the lowest maintained branch where they apply
   (lowest branches are regularly merged to upper ones so they get the fixes too).
 - Features and deprecations must be submitted against branch 4.4.
 - Legacy code removals go to the master branch.
-->

Commits
-------

c6d56de86d [Mailer] Improve an exception when trying to send a RawMessage without an Envelope
2019-09-04 08:40:15 +02:00