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

Skip to content

[Notifier] Make TransportTestCase data providers static #49385

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

Conversation

alexandre-daubois
Copy link
Member

@alexandre-daubois alexandre-daubois commented Feb 15, 2023

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Part of #49368
License MIT
Doc PR -

ℹ️ Note: the TransportTestCase::createTransport() method also had to be passed to static.

cc @OskarStark

@carsonbot carsonbot added this to the 5.4 milestone Feb 15, 2023
@alexandre-daubois alexandre-daubois force-pushed the bc-notifier-static-data-providers branch 3 times, most recently from 471c943 to 1509b1a Compare February 15, 2023 08:04
@nicolas-grekas nicolas-grekas changed the title [Notifier] Make TransportTestCase data providers static [Notifier] [BC BREAK] Make TransportTestCase data providers static Feb 15, 2023
UPGRADE-5.4.md Outdated
Notifier
--------

* The following data providers for `TransportTestCase` are now static: `toStringProvider()`, `supportedMessagesProvider()` and `unsupportedMessagesProvider()`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already done in #49368

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was in case the main PR is not ready for the next patch version of 5.4. But I guess we'll be able to tackle everything before next release so I'll remove it! 🙂

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good to see it green. Can you please send a PR to 6.2 also? I will use it when merging up this branch. (+6.3 but the number of new bridges should be small so I could do it myself I suppose).

My reasoning for doing this in 5.4 is that while this is a BC BREAK, I consider phpunit as part of the PHP infrastructure. Exactly like we consider supporting new PHP versions as bug fixes, we should consider supporting new phpunit versions as bug fixes. The benefit of doing so is well known: enabling smooth migrations (this change won't break compact with phpunit < 10.)

About the BC BREAK itself, it cannot have prod impact since we're talking about test classes. Also, it would impact private notifier bridges. I suspect these to be quite rare.

👍

UPGRADE-5.4.md Outdated
@@ -69,6 +69,13 @@ Messenger
* Deprecate not setting the `delete_after_ack` config option (or DSN parameter) using the Redis transport,
its default value will change to `true` in 6.0


Notifier
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alpha order => after M* :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated 🙂

@carsonbot carsonbot changed the title [Notifier] [BC BREAK] Make TransportTestCase data providers static [Notifier] Make TransportTestCase data providers static Feb 15, 2023
@alexandre-daubois alexandre-daubois force-pushed the bc-notifier-static-data-providers branch from 1509b1a to 6a9f1d0 Compare February 15, 2023 12:02
@alexandre-daubois
Copy link
Member Author

alexandre-daubois commented Feb 15, 2023

About the 6.2 targeting PR, I'm on it! 👌

Edit: it's available here: #49389

@nicolas-grekas
Copy link
Member

thank you @alexandre-daubois

@alexandre-daubois alexandre-daubois deleted the bc-notifier-static-data-providers branch February 15, 2023 16:03
bitgandtter added a commit to timgchile/symfony that referenced this pull request Feb 15, 2023
@nicolas-grekas
Copy link
Member

Arf sorry I realize only now that none of the classes in the Fixtures namespace should have been added.

  • MockHttpClient should be used instead of DummyHttpClient
  • *NullLogger for DummerLogger
  • DummyHub should be moved to the Mercure bridge
  • and there are already DummyMailer + DummyMessage implementations in Notifier that we should reuse

Can you please send a PR?

@alexandre-daubois
Copy link
Member Author

Of course, working on it 👍

bitgandtter added a commit to timgchile/symfony that referenced this pull request Feb 15, 2023
bitgandtter added a commit to timgchile/symfony that referenced this pull request Feb 15, 2023
bitgandtter added a commit to timgchile/symfony that referenced this pull request Feb 15, 2023
nicolas-grekas added a commit that referenced this pull request Feb 16, 2023
…lace mocks (alexandre-daubois)

This PR was merged into the 5.4 branch.

Discussion
----------

[Notifier] Replace tests dummy instances by already in place mocks

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #49385 (comment)
| License       | MIT
| Doc PR        | _NA_

Replacing dummy classes to use already existing mocks and stubs (`MockHttpClient`, `NullLogger` and so on).

Commits
-------

83120cb [Notifier] Replace tests dummy instances by already in place mocks
This was referenced Feb 28, 2023
OskarStark pushed a commit to OskarStark/symfony that referenced this pull request Dec 28, 2023
OskarStark pushed a commit to OskarStark/symfony that referenced this pull request Dec 28, 2023
OskarStark pushed a commit to OskarStark/symfony that referenced this pull request Dec 28, 2023
OskarStark pushed a commit to OskarStark/symfony that referenced this pull request Dec 28, 2023
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.

4 participants