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

Skip to content

[MonologBridge] Prefer PSR-3 to interact with Monolog in tests #27882

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

Merged
merged 1 commit into from
Jul 9, 2018

Conversation

derrabus
Copy link
Member

@derrabus derrabus commented Jul 6, 2018

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets part of #27857
License MIT
Doc PR N/A

This PR changes tests in the Monolog bridge:

  • Calls to Logger::addInfo() are changed to Logger::info().
  • The return value of Logger::debug(), Logger::info(), Logger::notice(), Logger::warning(), Logger::error() etc. is no longer asserted to be true.

This way, the tests only use PSR-3 compatible code to interact with the logger, which makes them forward-compatible with the changes in Monolog 2.

@nicolas-grekas
Copy link
Member

Why on 3.4 and not on master btw?

@derrabus
Copy link
Member Author

derrabus commented Jul 7, 2018

Why on 3.4 and not on master btw?

PSR-3 should be the recommended way to interact with the logger in Monolog 1 already. Also, the tests don't differ much between 3.4 and master yet, so I thought it might be easier for the maintenance if I apply the change here.

But I can rebase to master, if you want me to.

@nicolas-grekas
Copy link
Member

Let's go on master, these tests are fine for 3.4 IMHO.

@derrabus derrabus force-pushed the 3.4-monolog-psr3-tests branch from 17f8f7d to 78498d3 Compare July 9, 2018 06:04
@derrabus derrabus requested review from dunglas, lyrixx and sroze as code owners July 9, 2018 06:04
@derrabus derrabus changed the base branch from 3.4 to master July 9, 2018 06:04
@derrabus
Copy link
Member Author

derrabus commented Jul 9, 2018

✅ Rebased to master.

@nicolas-grekas
Copy link
Member

Thank you @derrabus.

@nicolas-grekas nicolas-grekas merged commit 78498d3 into symfony:master Jul 9, 2018
nicolas-grekas added a commit that referenced this pull request Jul 9, 2018
… tests (derrabus)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[MonologBridge] Prefer PSR-3 to interact with Monolog in tests

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

This PR changes tests in the Monolog bridge:
* Calls to `Logger::addInfo()` are changed to `Logger::info()`.
* The return value of `Logger::debug()`, `Logger::info()`, `Logger::notice()`, `Logger::warning()`, `Logger::error()` etc. is no longer asserted to be `true`.

This way, the tests only use PSR-3 compatible code to interact with the logger, which makes them forward-compatible with the changes in Monolog 2.

Commits
-------

78498d3 Prefer PSR-3 to interact with Monolog in tests.
@derrabus derrabus deleted the 3.4-monolog-psr3-tests branch July 9, 2018 14:54
@nicolas-grekas nicolas-grekas removed this from the next milestone Nov 1, 2018
@nicolas-grekas nicolas-grekas added this to the 4.2 milestone Nov 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants